- Adds Eclipse .project and .classpath files to ease the import of the project into the IDE.
- Removes Override annotations on interface implementations to avoid compilation errors. - Overrides hashCode in a class which overrides equals in order to maintain the general contract of the hashCode method and to avoid possible (future) issues related to hashtables.
This commit is contained in:
parent
12e275f640
commit
290572f32f
10
.classpath
Normal file
10
.classpath
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="lib/jain-sdp.jar"/>
|
||||
<classpathentry kind="lib" path="lib/junit.jar"/>
|
||||
<classpathentry kind="lib" path="lib/weupnp-0.1.2-SNAPSHOT.jar"/>
|
||||
<classpathentry kind="lib" path="lib/xalan-2.6.0.jar"/>
|
||||
<classpathentry kind="output" path="classes"/>
|
||||
</classpath>
|
||||
17
.project
Normal file
17
.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>ice4j</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@ -239,7 +239,6 @@ public class PseudoTcpSocket implements IPseudoTcpNotify
|
||||
pseudoTcp.NotifyClock(System.currentTimeMillis());
|
||||
receiveThread = new Thread(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
ReceivePackets();
|
||||
@ -247,7 +246,6 @@ public class PseudoTcpSocket implements IPseudoTcpNotify
|
||||
}, "PseudoTcpReceiveThread");
|
||||
clockThread = new Thread(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
RunClock();
|
||||
@ -298,7 +296,6 @@ public class PseudoTcpSocket implements IPseudoTcpNotify
|
||||
*
|
||||
* @param tcp
|
||||
*/
|
||||
@Override
|
||||
public void OnTcpOpen(PseudoTCPBase tcp)
|
||||
{
|
||||
logger.log(Level.FINE, "tcp opened");
|
||||
@ -316,7 +313,6 @@ public class PseudoTcpSocket implements IPseudoTcpNotify
|
||||
*
|
||||
* @param tcp
|
||||
*/
|
||||
@Override
|
||||
public void OnTcpReadable(PseudoTCPBase tcp)
|
||||
{
|
||||
//release all thread blocked at read_notify monitor
|
||||
@ -334,7 +330,6 @@ public class PseudoTcpSocket implements IPseudoTcpNotify
|
||||
*
|
||||
* @param tcp
|
||||
*/
|
||||
@Override
|
||||
public void OnTcpWriteable(PseudoTCPBase tcp)
|
||||
{
|
||||
|
||||
@ -355,7 +350,6 @@ public class PseudoTcpSocket implements IPseudoTcpNotify
|
||||
* @param tcp
|
||||
* @param e
|
||||
*/
|
||||
@Override
|
||||
public void OnTcpClosed(PseudoTCPBase tcp, IOException e)
|
||||
{
|
||||
if (e != null)
|
||||
@ -415,7 +409,6 @@ public class PseudoTcpSocket implements IPseudoTcpNotify
|
||||
* @param len
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public WriteResult TcpWritePacket(PseudoTCPBase tcp, byte[] buffer, int len)
|
||||
{
|
||||
if (logger.isLoggable(Level.FINEST))
|
||||
|
||||
@ -14,13 +14,11 @@ import java.net.*;
|
||||
import java.nio.channels.*;
|
||||
import java.util.logging.*;
|
||||
|
||||
import org.ice4j.stack.*;
|
||||
|
||||
/**
|
||||
* Implements a <tt>DatagramSocket</tt> which delegates its calls to a specific
|
||||
* <tt>DatagramSocket</tt>.
|
||||
*
|
||||
* @author Lubomir Marinov
|
||||
* @author Lyubomir Marinov
|
||||
*/
|
||||
public class DelegatingDatagramSocket
|
||||
extends DatagramSocket
|
||||
|
||||
@ -10,8 +10,6 @@ import java.io.*;
|
||||
import java.nio.channels.*;
|
||||
import java.net.*;
|
||||
|
||||
import org.ice4j.stack.*;
|
||||
|
||||
/**
|
||||
* Implements a <tt>Socket</tt> which delegates its calls to a specific
|
||||
* <tt>Socket</tt>.
|
||||
|
||||
@ -18,7 +18,7 @@ import org.ice4j.message.*;
|
||||
* "Session Traversal Utilities for NAT (STUN)" i.e. with method Binding or the
|
||||
* reserved method 0x000 and 0x002/SharedSecret.
|
||||
*
|
||||
* @author Lubomir Marinov
|
||||
* @author Lyubomir Marinov
|
||||
*/
|
||||
public class StunDatagramPacketFilter
|
||||
implements DatagramPacketFilter
|
||||
@ -132,27 +132,38 @@ public class StunDatagramPacketFilter
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether some other DatagramPacketFilter is "equal to" this one.
|
||||
* Indicates whether some other object is "equal to" this one.
|
||||
*
|
||||
* @param obj the reference object with which to compare.
|
||||
* @return <code>true</code> if this <tt>StunDatagramPacketFilter</tt> is
|
||||
* equal to the obj argument; <code>false</code> otherwise.
|
||||
*
|
||||
* @throws java.lang.NullPointerException if <tt>obj</tt> is null;
|
||||
* @return <tt>true</tt> if this <tt>StunDatagramPacketFilter</tt> is equal
|
||||
* to the <tt>obj</tt> argument; <tt>false</tt>, otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
throws NullPointerException
|
||||
{
|
||||
if(obj == this)
|
||||
if (null == obj)
|
||||
return false;
|
||||
else if (this == obj)
|
||||
return true;
|
||||
else
|
||||
return getClass().equals(obj.getClass());
|
||||
}
|
||||
|
||||
if(obj.getClass().equals(getClass()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
/**
|
||||
* Returns a hash code value for this object for the benefit of hashtables
|
||||
* such as those provided by <tt>Hashtable</tt>.
|
||||
*
|
||||
* @return a hash code value for this object
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
/*
|
||||
* Overrides the super implementation in order to maintain the general
|
||||
* contract of the hashCode method which states that equal objects must
|
||||
* have equal hash codes.
|
||||
*/
|
||||
return getClass().hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user