From 4cc6d4ab72dc34929a534d124e8067c7269d15a0 Mon Sep 17 00:00:00 2001 From: "lubomir.marinov" Date: Wed, 12 Dec 2012 01:21:04 +0000 Subject: [PATCH] Fixes warnings. --- src/org/ice4j/ice/Agent.java | 8 +++---- src/org/ice4j/ice/Candidate.java | 6 ++--- src/org/ice4j/ice/CandidatePair.java | 4 ++-- src/org/ice4j/ice/Component.java | 22 +++++++++---------- src/org/ice4j/ice/FoundationsRegistry.java | 2 +- .../ice4j/ice/harvest/HarvestingTimeStat.java | 4 ---- .../ice/harvest/StunCandidateHarvester.java | 10 ++++++--- .../ice/harvest/TurnCandidateHarvest.java | 2 +- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/org/ice4j/ice/Agent.java b/src/org/ice4j/ice/Agent.java index 8192151..044e1bf 100644 --- a/src/org/ice4j/ice/Agent.java +++ b/src/org/ice4j/ice/Agent.java @@ -348,7 +348,7 @@ public class Agent gatherCandidates(component, preferredPort, minPort, maxPort); - for(Candidate candidate : component.getLocalCandidates()) + for(Candidate candidate : component.getLocalCandidates()) { logger.info("\t" + candidate.getTransportAddress() + " (" + candidate.getType() + ")"); @@ -692,7 +692,7 @@ public class Agent { List candidates = component.getLocalCandidates(); - for (Candidate cand : candidates) + for (Candidate cand : candidates) foundationsRegistry.assignFoundation(cand); } @@ -851,8 +851,8 @@ public class Agent * check for outgoing Binding Requests. */ private String generateUserName( - Candidate candidate1, - Candidate candidate2) + Candidate candidate1, + Candidate candidate2) { String ret = null; String ufrag1 = candidate1.getUfrag(); diff --git a/src/org/ice4j/ice/Candidate.java b/src/org/ice4j/ice/Candidate.java index 5c9f856..001f8bd 100644 --- a/src/org/ice4j/ice/Candidate.java +++ b/src/org/ice4j/ice/Candidate.java @@ -27,7 +27,7 @@ import org.ice4j.*; * @author Lyubomir Marinov */ public abstract class Candidate - + > { /** * The transport address represented by this candidate. @@ -291,7 +291,7 @@ public abstract class Candidate if( ! (obj instanceof Candidate)) return false; - Candidate targetCandidate = (Candidate)obj; + Candidate targetCandidate = (Candidate) obj; //compare candidate addresses if( ! targetCandidate.getTransportAddress() @@ -786,7 +786,7 @@ public abstract class Candidate * otherwise. * */ - public boolean canReach(Candidate dst) + public boolean canReach(Candidate dst) { return getTransportAddress().canReach(dst.getTransportAddress()); } diff --git a/src/org/ice4j/ice/CandidatePair.java b/src/org/ice4j/ice/CandidatePair.java index fe83b6c..944f28f 100644 --- a/src/org/ice4j/ice/CandidatePair.java +++ b/src/org/ice4j/ice/CandidatePair.java @@ -299,7 +299,7 @@ public class CandidatePair * @return a reference to the Candidate instance that comes from * the controlling agent. */ - public Candidate getControllingAgentCandidate() + public Candidate getControllingAgentCandidate() { return (getLocalCandidate().getParentComponent().getParentStream() .getParentAgent().isControlling()) @@ -313,7 +313,7 @@ public class CandidatePair * @return a reference to the Candidate instance that comes from * the controlled agent. */ - public Candidate getControlledAgentCandidate() + public Candidate getControlledAgentCandidate() { return (getLocalCandidate().getParentComponent().getParentStream() .getParentAgent().isControlling()) diff --git a/src/org/ice4j/ice/Component.java b/src/org/ice4j/ice/Component.java index 7ac78af..57d5ce5 100644 --- a/src/org/ice4j/ice/Component.java +++ b/src/org/ice4j/ice/Component.java @@ -111,7 +111,7 @@ public class Component * words, the candidate that we would have used to communicate with the * remote peer if we hadn't been using ICE. */ - private Candidate defaultRemoteCandidate = null; + private Candidate defaultRemoteCandidate = null; /** * Creates a new Component with the specified componentID @@ -175,10 +175,10 @@ public class Component synchronized(localCandidates) { int count = 0; - for(Candidate cand : localCandidates) + for(Candidate cand : localCandidates) { - if (cand.getType() == CandidateType.HOST_CANDIDATE - && !cand.isVirtual()) + if ((cand.getType() == CandidateType.HOST_CANDIDATE) + && !cand.isVirtual()) { count++; } @@ -519,9 +519,9 @@ public class Component synchronized(localCandidates) { - for (Candidate cand : localCandidates) + for (Candidate cand : localCandidates) { - buff.append("\n" + cand.toString()); + buff.append('\n').append(cand.toString()); } } } @@ -586,7 +586,7 @@ public class Component localCandidates.toArray(candidates); //first compute the actual priorities - for (Candidate cand : candidates) + for (Candidate cand : candidates) { if(compat == CompatibilityMode.GTALK) { @@ -612,7 +612,7 @@ public class Component * Compares candidates based on their priority. */ private static class CandidatePrioritizer - implements Comparator + implements Comparator> { /** * Compares the two Candidates based on their priority and @@ -627,7 +627,7 @@ public class Component * Candidate has a lower, equal, or greater priority than the * second. */ - public int compare(Candidate c1, Candidate c2) + public int compare(Candidate c1, Candidate c2) { if(c1.getPriority() < c2.getPriority()) return 1; @@ -740,7 +740,7 @@ public class Component * default for this Component or null if no such * Candidate has reported yet. */ - public Candidate getDefaultRemoteCandidate() + public Candidate getDefaultRemoteCandidate() { return defaultRemoteCandidate; } @@ -753,7 +753,7 @@ public class Component * @param candidate the Candidate that the remote party has * reported as default for this Component. */ - public void setDefaultRemoteCandidate(Candidate candidate) + public void setDefaultRemoteCandidate(Candidate candidate) { this.defaultRemoteCandidate = candidate; } diff --git a/src/org/ice4j/ice/FoundationsRegistry.java b/src/org/ice4j/ice/FoundationsRegistry.java index 0514112..1da978f 100644 --- a/src/org/ice4j/ice/FoundationsRegistry.java +++ b/src/org/ice4j/ice/FoundationsRegistry.java @@ -42,7 +42,7 @@ public class FoundationsRegistry * @param candidate the Candidate that we'd like to assign a * foundation to. */ - public void assignFoundation(Candidate candidate) + public void assignFoundation(Candidate candidate) { //create the foundation key String CandidateType candidateType = candidate.getType(); diff --git a/src/org/ice4j/ice/harvest/HarvestingTimeStat.java b/src/org/ice4j/ice/harvest/HarvestingTimeStat.java index e4d3240..0f21a23 100644 --- a/src/org/ice4j/ice/harvest/HarvestingTimeStat.java +++ b/src/org/ice4j/ice/harvest/HarvestingTimeStat.java @@ -7,10 +7,6 @@ */ package org.ice4j.ice.harvest; -import java.util.*; - -import org.ice4j.ice.*; - /** * Manages statisics about harvesting time. * diff --git a/src/org/ice4j/ice/harvest/StunCandidateHarvester.java b/src/org/ice4j/ice/harvest/StunCandidateHarvester.java index cb28dfc..14722ba 100644 --- a/src/org/ice4j/ice/harvest/StunCandidateHarvester.java +++ b/src/org/ice4j/ice/harvest/StunCandidateHarvester.java @@ -231,10 +231,14 @@ public class StunCandidateHarvester component.getComponentID()); stunStack = component.getParentStream().getParentAgent().getStunStack(); - for (Candidate cand : component.getLocalCandidates()) - if (cand instanceof HostCandidate && - cand.getTransport() == stunServer.getTransport()) + for (Candidate cand : component.getLocalCandidates()) + { + if ((cand instanceof HostCandidate) + && (cand.getTransport() == stunServer.getTransport())) + { startResolvingCandidate((HostCandidate) cand); + } + } waitForResolutionEnd(); diff --git a/src/org/ice4j/ice/harvest/TurnCandidateHarvest.java b/src/org/ice4j/ice/harvest/TurnCandidateHarvest.java index 7b57323..ecaeece 100644 --- a/src/org/ice4j/ice/harvest/TurnCandidateHarvest.java +++ b/src/org/ice4j/ice/harvest/TurnCandidateHarvest.java @@ -195,7 +195,7 @@ public class TurnCandidateHarvest */ boolean existsRelayedCandidate = false; - for (Candidate aCandidate : getCandidates()) + for (Candidate aCandidate : getCandidates()) { if (CandidateType.RELAYED_CANDIDATE.equals( aCandidate.getType()))