Fixes javadocs, warnings.

This commit is contained in:
Lyubomir Marinov 2015-10-01 13:27:18 -05:00
parent 26296f3cbe
commit a7418247f6
2 changed files with 25 additions and 12 deletions

View File

@ -20,7 +20,7 @@ package org.ice4j.socket;
import java.net.*; import java.net.*;
/** /**
* A <tt>DatagramPacketFilter</tt> which accepts only DTLS packets. * A {@code DatagramPacketFilter} which accepts DTLS packets only.
* *
* @author Boris Grozev * @author Boris Grozev
*/ */
@ -28,19 +28,22 @@ public class DTLSDatagramFilter
implements DatagramPacketFilter implements DatagramPacketFilter
{ {
/** /**
* Returns <tt>true</tt> if <tt>p</tt> looks like a DTLS packet. * Determines whether {@code p} looks like a DTLS packet.
* @param p the <tt>DatagramPacket</tt> to check. *
* @return <tt>true</tt>if <tt>p</tt> looks like a DTLS packet. * @param p the {@code DatagramPacket} to check.
* @return {@code true} if {@code p} looks like a DTLS packet; otherwise,
* {@code false}.
*/ */
public static boolean isDTLS(DatagramPacket p) public static boolean isDTLS(DatagramPacket p)
{ {
byte[] data = p.getData();
int off = p.getOffset();
int len = p.getLength(); int len = p.getLength();
if (len > 0) if (len > 0)
{ {
byte[] data = p.getData();
int off = p.getOffset();
int fb = data[off] & 0xff; int fb = data[off] & 0xff;
return 19 < fb && fb < 64; return 19 < fb && fb < 64;
} }

View File

@ -125,10 +125,11 @@ public class MultiplexingSocket
/** /**
* Initializes a new <tt>MultiplexingSocket</tt> instance. * Initializes a new <tt>MultiplexingSocket</tt> instance.
* *
* @param address not used
* @param port not used
* @see Socket#Socket(InetAddress, int) * @see Socket#Socket(InetAddress, int)
*/ */
public MultiplexingSocket(InetAddress address, int port) public MultiplexingSocket(InetAddress address, int port)
throws IOException
{ {
this((Socket) null); this((Socket) null);
} }
@ -136,12 +137,15 @@ public class MultiplexingSocket
/** /**
* Initializes a new <tt>MultiplexingSocket</tt> instance. * Initializes a new <tt>MultiplexingSocket</tt> instance.
* *
* @param address not used
* @param port not used
* @param localAddr not used
* @param localPort not used
* @see Socket#Socket(InetAddress, int, InetAddress, int) * @see Socket#Socket(InetAddress, int, InetAddress, int)
*/ */
public MultiplexingSocket( public MultiplexingSocket(
InetAddress address, int port, InetAddress address, int port,
InetAddress localAddr, int localPort) InetAddress localAddr, int localPort)
throws IOException
{ {
this((Socket) null); this((Socket) null);
} }
@ -149,6 +153,7 @@ public class MultiplexingSocket
/** /**
* Initializes a new <tt>MultiplexingSocket</tt> instance. * Initializes a new <tt>MultiplexingSocket</tt> instance.
* *
* @param proxy not used
* @see Socket#Socket(Proxy) * @see Socket#Socket(Proxy)
*/ */
public MultiplexingSocket(Proxy proxy) public MultiplexingSocket(Proxy proxy)
@ -178,10 +183,10 @@ public class MultiplexingSocket
/** /**
* Initializes a new <tt>MultiplexingSocket</tt> instance. * Initializes a new <tt>MultiplexingSocket</tt> instance.
* *
* @param impl not used
* @see Socket#Socket(SocketImpl) * @see Socket#Socket(SocketImpl)
*/ */
protected MultiplexingSocket(SocketImpl impl) protected MultiplexingSocket(SocketImpl impl)
throws SocketException
{ {
this((Socket) null); this((Socket) null);
} }
@ -189,10 +194,11 @@ public class MultiplexingSocket
/** /**
* Initializes a new <tt>MultiplexingSocket</tt> instance. * Initializes a new <tt>MultiplexingSocket</tt> instance.
* *
* @param host not used
* @param port not used
* @see Socket#Socket(String, int) * @see Socket#Socket(String, int)
*/ */
public MultiplexingSocket(String host, int port) public MultiplexingSocket(String host, int port)
throws UnknownHostException, IOException
{ {
this((Socket) null); this((Socket) null);
} }
@ -200,6 +206,10 @@ public class MultiplexingSocket
/** /**
* Initializes a new <tt>MultiplexingSocket</tt> instance. * Initializes a new <tt>MultiplexingSocket</tt> instance.
* *
* @param host not used
* @param port not used
* @param localAddr not used
* @param localPort not used
* @see Socket#Socket(String, int, InetAddress, int) * @see Socket#Socket(String, int, InetAddress, int)
*/ */
public MultiplexingSocket( public MultiplexingSocket(
@ -511,8 +521,8 @@ public class MultiplexingSocket
} }
accepted = true; accepted = true;
// Emil: Don't break because we want all filtering // Emil Ivov: Don't break because we want all
// sockets to get the received packet. // filtering sockets to get the received packet.
} }
} }
if (!accepted) if (!accepted)