Fixes warnings.
This commit is contained in:
parent
aacc2b3c5d
commit
890ddfd96d
@ -10,12 +10,11 @@ package org.ice4j;
|
||||
* A StunException is thrown when a general STUN exception is encountered.
|
||||
*
|
||||
* <p>Copyright: Copyright (c) 2003</p>
|
||||
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
|
||||
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
|
||||
* <p>Organization: Louis Pasteur University, Strasbourg, France</p>
|
||||
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p>
|
||||
* @author Emil Ivov
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
public class StunException extends Exception
|
||||
{
|
||||
/**
|
||||
@ -23,11 +22,6 @@ public class StunException extends Exception
|
||||
*/
|
||||
private static final long serialVersionUID = 35367793L;
|
||||
|
||||
/**
|
||||
* Error ID.
|
||||
*/
|
||||
private int errorID = 0;
|
||||
|
||||
/**
|
||||
* Means that the the reason that caused the exception was unclear.
|
||||
*/
|
||||
@ -50,7 +44,7 @@ public class StunException extends Exception
|
||||
public static final int INTERNAL_ERROR = 3;
|
||||
|
||||
/**
|
||||
* Thrown when trying to send responses through a non-existant transaction
|
||||
* Thrown when trying to send responses through a non-existent transaction
|
||||
* That may happen when a corresponding request has already been responded
|
||||
* to or when no such request has been received.
|
||||
*/
|
||||
|
||||
@ -7,15 +7,14 @@
|
||||
package org.ice4j.attribute;
|
||||
|
||||
import org.ice4j.*;
|
||||
import org.ice4j.message.*;
|
||||
|
||||
/**
|
||||
* The class provides utilities for decoding a binary stream into an Attribute
|
||||
* class.
|
||||
*
|
||||
* <p>Copyright: Copyright (c) 2003-2008</p>
|
||||
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
|
||||
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
|
||||
* <p>Organization: Louis Pasteur University, Strasbourg, France</p>
|
||||
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p>
|
||||
* @author Emil Ivov
|
||||
* @author Sebastien Vincent
|
||||
* @version 0.1
|
||||
@ -128,5 +127,4 @@ public class AttributeDecoder
|
||||
|
||||
return decodedAttribute;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
*/
|
||||
package org.ice4j.attribute;
|
||||
|
||||
import java.lang.*;
|
||||
|
||||
import org.ice4j.*;
|
||||
|
||||
/**
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
*/
|
||||
package org.ice4j.attribute;
|
||||
|
||||
import java.lang.*;
|
||||
|
||||
import org.ice4j.*;
|
||||
|
||||
/**
|
||||
@ -112,4 +110,3 @@ public class DontFragmentAttribute extends Attribute
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
*/
|
||||
package org.ice4j.attribute;
|
||||
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.ice4j.*;
|
||||
|
||||
/**
|
||||
@ -74,8 +72,8 @@ import org.ice4j.*;
|
||||
* The client should not retry.
|
||||
*
|
||||
* <p>Copyright: Copyright (c) 2003</p>
|
||||
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
|
||||
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
|
||||
* <p>Organization: Louis Pasteur University, Strasbourg, France</p>
|
||||
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p>
|
||||
* @author Emil Ivov
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
@ -6,13 +6,11 @@
|
||||
*/
|
||||
package org.ice4j.attribute;
|
||||
|
||||
import java.lang.*;
|
||||
|
||||
import org.ice4j.*;
|
||||
|
||||
/**
|
||||
* The EVEN-PORT attribute is used to ask the TURN
|
||||
* server to allocate an even port and optionnaly allocate
|
||||
* server to allocate an even port and optionally allocate
|
||||
* the next higher port number.
|
||||
*
|
||||
* There are one flag supported : <br/>
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
*/
|
||||
package org.ice4j.attribute;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.ice4j.*;
|
||||
|
||||
/**
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
*/
|
||||
package org.ice4j.attribute;
|
||||
|
||||
import java.lang.*;
|
||||
|
||||
import org.ice4j.*;
|
||||
|
||||
/**
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
*/
|
||||
package org.ice4j.attribute;
|
||||
|
||||
import java.lang.*;
|
||||
|
||||
import org.ice4j.*;
|
||||
|
||||
/**
|
||||
@ -15,7 +13,7 @@ import org.ice4j.*;
|
||||
* TURN address of certain transport protocol.
|
||||
*
|
||||
* In the original TURN specification, only UDP is supported.
|
||||
* Support of TCP is detailled in draft-ietf-behave-turn-tcp-05.
|
||||
* Support of TCP is detailed in draft-ietf-behave-turn-tcp-05.
|
||||
*
|
||||
* @author Sebastien Vincent
|
||||
* @version 0.1
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
*/
|
||||
package org.ice4j.attribute;
|
||||
|
||||
import org.ice4j.*;
|
||||
|
||||
/**
|
||||
* The XOR-PEER-ADDRESS attribute is given by a TURN client to
|
||||
* indicates the peer destination address of its relayed packet.
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
*/
|
||||
package org.ice4j.attribute;
|
||||
|
||||
import org.ice4j.*;
|
||||
|
||||
/**
|
||||
* The XOR-RELAYED-ADDRESS attribute is given by a TURN server to
|
||||
* indicates the client its relayed address.
|
||||
|
||||
@ -32,7 +32,7 @@ public class Agent
|
||||
/**
|
||||
* Our class logger.
|
||||
*/
|
||||
private final Logger logger
|
||||
private static final Logger logger
|
||||
= Logger.getLogger(Agent.class.getName());
|
||||
|
||||
/**
|
||||
|
||||
@ -17,11 +17,9 @@ import org.ice4j.ice.*;
|
||||
import org.ice4j.message.*;
|
||||
import org.ice4j.stack.*;
|
||||
|
||||
import com.sun.org.apache.bcel.internal.generic.*;
|
||||
|
||||
/**
|
||||
* A <tt>StunCandidateHarvester</tt> gathers STUN <tt>Candidate</tt>s for a
|
||||
* specified {@link org.ice4j.ice.Component}.
|
||||
* specified {@link Component}.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
@ -133,21 +131,28 @@ public class StunCandidateHarvester
|
||||
}
|
||||
|
||||
/**
|
||||
* Blocks the current thread until all resolutions in this harverster
|
||||
* Blocks the current thread until all resolutions in this harvester
|
||||
* have terminated one way or another.
|
||||
*/
|
||||
private void waitForResolutionEnd()
|
||||
{
|
||||
synchronized(resolveMap)
|
||||
{
|
||||
if(resolveMap.isEmpty())
|
||||
return;
|
||||
boolean interrupted = false;
|
||||
|
||||
try
|
||||
{
|
||||
resolveMap.wait();
|
||||
}
|
||||
catch (InterruptedException e){}
|
||||
// Handle spurious wakeups.
|
||||
while (!resolveMap.isEmpty())
|
||||
try
|
||||
{
|
||||
resolveMap.wait();
|
||||
}
|
||||
catch (InterruptedException iex)
|
||||
{
|
||||
interrupted = true;
|
||||
}
|
||||
// Restore the interrupted status.
|
||||
if (interrupted)
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,7 +184,6 @@ public class StunCandidateHarvester
|
||||
logger.finest("received a message tranid=" + tranID);
|
||||
logger.finest("localCand=" + localCand);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -201,7 +205,7 @@ public class StunCandidateHarvester
|
||||
* because of the oddities of the BSD and Java socket implementations, which
|
||||
* is why we currently ignore this method.
|
||||
*
|
||||
* @param event the <tt>StunFailureEvent</tt>
|
||||
* @param event the <tt>StunFailureEvent</tt> containg the
|
||||
* <tt>PortUnreachableException</tt> which signaled that the destination of
|
||||
* the request was found to be unreachable.
|
||||
*/
|
||||
@ -250,8 +254,7 @@ public class StunCandidateHarvester
|
||||
Attribute attribute
|
||||
= response.getAttribute(Attribute.XOR_MAPPED_ADDRESS);
|
||||
|
||||
if(attribute == null
|
||||
|| !(attribute instanceof XorMappedAddressAttribute))
|
||||
if(!(attribute instanceof XorMappedAddressAttribute))
|
||||
return;
|
||||
|
||||
TransportAddress addr = ((XorMappedAddressAttribute)attribute)
|
||||
|
||||
@ -522,10 +522,9 @@ public abstract class Message
|
||||
while (iter.hasNext())
|
||||
{
|
||||
|
||||
Attribute attribute
|
||||
= ((Map.Entry<Character, Attribute>)iter.next()).getValue();
|
||||
|
||||
Attribute attribute = iter.next().getValue();
|
||||
byte[] attBinValue = attribute.encode();
|
||||
|
||||
System.arraycopy(attBinValue, 0, binMsg, offset, attBinValue.length);
|
||||
offset += attBinValue.length;
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
package org.ice4j.stack;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.util.logging.*;
|
||||
|
||||
import org.ice4j.*;
|
||||
@ -33,7 +32,6 @@ import org.ice4j.message.*;
|
||||
* @author Emil Ivov.
|
||||
* @author Pascal Mogeri (contributed configuration of client transactions).
|
||||
*/
|
||||
|
||||
class StunClientTransaction
|
||||
implements Runnable
|
||||
{
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
package org.ice4j.stunclient;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.util.logging.*;
|
||||
|
||||
import org.ice4j.*;
|
||||
|
||||
@ -6,9 +6,6 @@
|
||||
*/
|
||||
package org.ice4j;
|
||||
|
||||
import org.ice4j.attribute.*;
|
||||
import org.ice4j.message.*;
|
||||
|
||||
public class MsgFixture
|
||||
{
|
||||
//---------------------- Attributes ---------------------------------------
|
||||
|
||||
@ -48,7 +48,6 @@ public class MessageFactoryTest extends TestCase {
|
||||
Message actualReturn
|
||||
= messageFactory.createBindingErrorResponse(errorCode);
|
||||
assertEquals("return value", expectedReturn, actualReturn);
|
||||
|
||||
}
|
||||
|
||||
public void testCreateBindingErrorResponse1() throws StunException {
|
||||
@ -66,7 +65,6 @@ public class MessageFactoryTest extends TestCase {
|
||||
.createBindingErrorResponse(errorCode, reasonPhrase);
|
||||
assertEquals("Failed to create an error code attribute.",
|
||||
expectedReturn, actualReturn);
|
||||
|
||||
}
|
||||
|
||||
public void testCreateBindingErrorResponseUnknownAttributes()
|
||||
@ -98,7 +96,6 @@ public class MessageFactoryTest extends TestCase {
|
||||
.createBindingErrorResponseUnknownAttributes(unknownAttributes);
|
||||
//compare
|
||||
assertEquals("return value", expectedReturn, actualReturn);
|
||||
|
||||
}
|
||||
|
||||
public void testCreateBindingErrorResponseUnknownAttributes1()
|
||||
|
||||
@ -29,8 +29,6 @@ public class MessageTest extends TestCase {
|
||||
|
||||
private MsgFixture msgFixture;
|
||||
|
||||
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
msgFixture = new MsgFixture();
|
||||
@ -72,8 +70,6 @@ public class MessageTest extends TestCase {
|
||||
|
||||
bindingResponse.addAttribute(changedAddress);
|
||||
bindingResponse.setTransactionID(msgFixture.TRANSACTION_ID);
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception
|
||||
@ -127,9 +123,6 @@ public class MessageTest extends TestCase {
|
||||
assertEquals("The second attribute could not be extracted.",
|
||||
sourceAddress,
|
||||
getResult);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -155,8 +148,6 @@ public class MessageTest extends TestCase {
|
||||
|
||||
assertTrue("A binding response was not properly encoded",
|
||||
Arrays.equals( expectedReturn, actualReturn ) );
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -187,12 +178,8 @@ public class MessageTest extends TestCase {
|
||||
|
||||
assertEquals("A binding response was not properly decoded",
|
||||
expectedReturn, actualReturn );
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tests the equals method against a null, a different and an identical
|
||||
* object.
|
||||
@ -235,9 +222,6 @@ public class MessageTest extends TestCase {
|
||||
binResTarget.addAttribute(changedAddress);
|
||||
actualReturn = bindingResponse.equals(binResTarget);
|
||||
assertEquals("Equals failed against a different target", expectedReturn, actualReturn);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -252,7 +236,6 @@ public class MessageTest extends TestCase {
|
||||
actualReturn = bindingResponse.getAttributeCount();
|
||||
assertEquals("getAttributeCount failed for a bindingRequest",
|
||||
expectedReturn, actualReturn);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -270,8 +253,5 @@ public class MessageTest extends TestCase {
|
||||
int actualReturn = bindingRequest.getAttributeCount();
|
||||
assertEquals("Attribute count did not change after removing an attribute",
|
||||
expectedReturn, actualReturn);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ public class StunAddressDiscovererTest_v4v6 extends TestCase {
|
||||
stunAddressDiscoverer_v4 = null;
|
||||
|
||||
//give the sockets the time to clear out
|
||||
Thread.currentThread().sleep(1000);
|
||||
Thread.sleep(1000);
|
||||
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user