- Removes a couple of unnecessary lines which duplicated the previous two lines.

- Fixes a NullPointerException and related warnings about inconsistent synchronization.
This commit is contained in:
lubomir.marinov 2010-02-11 15:48:42 +00:00
parent 605332bbe1
commit ef562bd688
3 changed files with 20 additions and 8 deletions

View File

@ -14,8 +14,8 @@ import org.ice4j.ice.*;
* The Address class is used to define destinations to outgoing Stun Packets. * The Address class is used to define destinations to outgoing Stun Packets.
* *
* @author Emil Ivov * @author Emil Ivov
* @author Lubomir Marinov
*/ */
public class TransportAddress public class TransportAddress
extends InetSocketAddress extends InetSocketAddress
{ {
@ -168,6 +168,21 @@ public class TransportAddress
return transport; return transport;
} }
/**
* Determines whether this <tt>TransportAddress</tt> is value equal to a
* specific <tt>TransportAddress</tt>.
*
* @param transportAddress the <tt>TransportAddress</tt> to test for value
* equality with this <tt>TransportAddress</tt>
* @return <tt>true</tt> if this <tt>TransportAddress</tt> is value equal to
* the specified <tt>transportAddress</tt>; otherwise, <tt>false</tt>
* @see #equalsTransportAddress(Object)
*/
public boolean equals(TransportAddress transportAddress)
{
return equalsTransportAddress(transportAddress);
}
/** /**
* Compares this object against the specified object. The result is * Compares this object against the specified object. The result is
* <tt>true</tt> if and only if the argument is not <tt>null</tt> and it * <tt>true</tt> if and only if the argument is not <tt>null</tt> and it

View File

@ -131,10 +131,6 @@ class Connector
localSock.receive(packet); localSock.receive(packet);
//get lost if we are no longer running.
if(!isRunning)
return;
//get lost if we are no longer running. //get lost if we are no longer running.
if(!isRunning) if(!isRunning)
return; return;
@ -225,6 +221,7 @@ class Connector
* Returns a String representation of the object. * Returns a String representation of the object.
* @return a String representation of the object. * @return a String representation of the object.
*/ */
@Override
public String toString() public String toString()
{ {
return "org.ice4j.stack.AccessPoint@" return "org.ice4j.stack.AccessPoint@"

View File

@ -32,7 +32,7 @@ public class EventDispatcher
* Hashtable for managing property change listeners registered for specific * Hashtable for managing property change listeners registered for specific
* properties. Maps property names to PropertyChangeSupport objects. * properties. Maps property names to PropertyChangeSupport objects.
*/ */
private Hashtable<TransportAddress, EventDispatcher> private final Hashtable<TransportAddress, EventDispatcher>
requestListenersChildren requestListenersChildren
= new Hashtable<TransportAddress, EventDispatcher>(); = new Hashtable<TransportAddress, EventDispatcher>();
@ -176,7 +176,7 @@ public class EventDispatcher
synchronized(requestListenersChildren) synchronized(requestListenersChildren)
{ {
if (requestListenersChildren != null) if (!requestListenersChildren.isEmpty())
{ {
EventDispatcher child = requestListenersChildren.get(localAddr); EventDispatcher child = requestListenersChildren.get(localAddr);
if (child != null && child.requestListeners != null) if (child != null && child.requestListeners != null)
@ -196,6 +196,6 @@ public class EventDispatcher
{ {
if(requestListeners != null) if(requestListeners != null)
requestListeners.removeAllElements(); requestListeners.removeAllElements();
requestListenersChildren = null; requestListenersChildren.clear();
} }
} }