From 9a580a9401fbd84788016c95c20505b35192aa97 Mon Sep 17 00:00:00 2001 From: bgrozev Date: Tue, 9 Jun 2020 16:25:10 -0500 Subject: [PATCH] Remove unused code, fix typo and formatting (#207) * Remove unused method. * Fix typos and formatting. --- src/main/java/org/ice4j/ice/Agent.java | 33 ------------------- .../java/org/ice4j/ice/CandidatePair.java | 2 +- .../java/org/ice4j/ice/ComponentSocket.java | 2 ++ .../ice4j/stack/MessageProcessingTask.java | 2 +- 4 files changed, 4 insertions(+), 35 deletions(-) diff --git a/src/main/java/org/ice4j/ice/Agent.java b/src/main/java/org/ice4j/ice/Agent.java index 9c4a5ac..b4efb31 100644 --- a/src/main/java/org/ice4j/ice/Agent.java +++ b/src/main/java/org/ice4j/ice/Agent.java @@ -1489,39 +1489,6 @@ public class Agent return null; } - /** - * Returns the local LocalCandidate with the specified - * localAddress if it belongs to any of this {@link Agent}'s - * streams or null if it doesn't. - * - * @param localAddress the {@link TransportAddress} we are looking for. - * @param ufrag local ufrag - * @return the local LocalCandidate with the specified - * localAddress if it belongs to any of this {@link Agent}'s - * streams or null if it doesn't. - */ - public LocalCandidate findLocalCandidate( - TransportAddress localAddress, - String ufrag) - { - for (IceMediaStream stream : mediaStreams.values()) - { - for (Component c : stream.getComponents()) - { - for (LocalCandidate cnd : c.getLocalCandidates()) - { - if (cnd != null - && cnd.getUfrag() != null - && cnd.getUfrag().equals(ufrag)) - { - return cnd; - } - } - } - } - return null; - } - /** * Returns the remote Candidate with the specified * remoteAddress if it belongs to any of this {@link Agent}'s diff --git a/src/main/java/org/ice4j/ice/CandidatePair.java b/src/main/java/org/ice4j/ice/CandidatePair.java index 2d1a617..208c653 100644 --- a/src/main/java/org/ice4j/ice/CandidatePair.java +++ b/src/main/java/org/ice4j/ice/CandidatePair.java @@ -172,7 +172,7 @@ public class CandidatePair * @param localCnd the local Candidate of this * CandidatePair. */ - protected void setLocalCandidate( LocalCandidate localCnd) + protected void setLocalCandidate(LocalCandidate localCnd) { this.localCandidate = localCnd; } diff --git a/src/main/java/org/ice4j/ice/ComponentSocket.java b/src/main/java/org/ice4j/ice/ComponentSocket.java index c2368ed..2befe0b 100644 --- a/src/main/java/org/ice4j/ice/ComponentSocket.java +++ b/src/main/java/org/ice4j/ice/ComponentSocket.java @@ -155,7 +155,9 @@ public class ComponentSocket LocalCandidate localCandidate = pair.getLocalCandidate(); LocalCandidate base = localCandidate.getBase(); if (base != null) + { localCandidate = base; + } TransportAddress remoteAddress = null; RemoteCandidate remoteCandidate = pair.getRemoteCandidate(); diff --git a/src/main/java/org/ice4j/stack/MessageProcessingTask.java b/src/main/java/org/ice4j/stack/MessageProcessingTask.java index 4da5799..45d1bce 100644 --- a/src/main/java/org/ice4j/stack/MessageProcessingTask.java +++ b/src/main/java/org/ice4j/stack/MessageProcessingTask.java @@ -206,7 +206,7 @@ class MessageProcessingTask // On processed callback must be invoked in all cases, even when // cancellation or early exist happen, otherwise // NetAccessManager internal tracking of pooled and active - // message processors will missbehave. + // message processors will misbehave. if (onProcessed != null) { onProcessed.accept(this);