-
Enhancement
-
Resolution: Fixed
-
P3
-
15
-
b26
There are two DatagramSocket constructors that accept a port number, one of which asserts "The local port must be between 0 and 65535 inclusive".
However, neither constructor specify that an IAE is thrown if the port is out of range. The IAE comes from the instantiation of InetSocketAddress, which specifies "IllegalArgumentException – if the port parameter is outside the specified range of valid port values."
Also, neither constructor specifies that if zero is passed for the port number, the system will choose any appropriate port. The two constructors rely on the assertion "A port number of zero will let the system pick up an ephemeral port in a bind operation" from the InetSocketAddress constructor.
Would be good to specify that an IAE is triggered with an incorrect port for these DatagramSocket constructors, and that if zero is passed as port number to the constructors the system will pick any appropriate port number.
However, neither constructor specify that an IAE is thrown if the port is out of range. The IAE comes from the instantiation of InetSocketAddress, which specifies "IllegalArgumentException – if the port parameter is outside the specified range of valid port values."
Also, neither constructor specifies that if zero is passed for the port number, the system will choose any appropriate port. The two constructors rely on the assertion "A port number of zero will let the system pick up an ephemeral port in a bind operation" from the InetSocketAddress constructor.
Would be good to specify that an IAE is triggered with an incorrect port for these DatagramSocket constructors, and that if zero is passed as port number to the constructors the system will pick any appropriate port number.
- clones
-
JDK-8243270 DatagramSocket ctor spec and ::getLocalAddress spec are mismatching
-
- Closed
-
- csr for
-
JDK-8243976 DatagramSocket constructors don't always specify what happens when passed invalid parameters
-
- Closed
-
- duplicates
-
JDK-8243509 DatagramSocket constructors accepting port number deserve to specify behavior for zero port passed
-
- Closed
-
- relates to
-
JDK-8243999 DatagramSocket and MulticastSocket constructors don't specify how a null InetAddress is handled
-
- Resolved
-