-
Enhancement
-
Resolution: Fixed
-
P3
-
15
-
b27
The constructor:
public DatagramSocket(int port, InetAddress laddr) throws SocketException {
this(new InetSocketAddress(laddr, port));
}
relies on `InetSocketAddress(laddr, port)` whose specification states "A null address will assign the wildcard address". A similar assertion should be added to the specification of `DatagramSocket(int port, InetAddress laddr)` to clarify what occurs when a null address is passed as a parameter. This is also true for `MulticastSocket(SocketAddress bindaddr)`.
The constructor:
public DatagramSocket(int port) throws SocketException {
this(port, null);
}
mentions "The socket will be bound to the wildcard address, an IP address chosen by the kernel". This is ambiguous and requires clarification.
public DatagramSocket(int port, InetAddress laddr) throws SocketException {
this(new InetSocketAddress(laddr, port));
}
relies on `InetSocketAddress(laddr, port)` whose specification states "A null address will assign the wildcard address". A similar assertion should be added to the specification of `DatagramSocket(int port, InetAddress laddr)` to clarify what occurs when a null address is passed as a parameter. This is also true for `MulticastSocket(SocketAddress bindaddr)`.
The constructor:
public DatagramSocket(int port) throws SocketException {
this(port, null);
}
mentions "The socket will be bound to the wildcard address, an IP address chosen by the kernel". This is ambiguous and requires clarification.
- csr for
-
JDK-8246663 DatagramSocket and MulticastSocket constructors don't specify how a null InetAddress is handled
-
- Closed
-
- duplicates
-
JDK-8243270 DatagramSocket ctor spec and ::getLocalAddress spec are mismatching
-
- Closed
-
- relates to
-
JDK-8243507 DatagramSocket constructors don’t always specify what happens when passed invalid parameters
-
- Resolved
-