-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
5.0
-
generic
-
generic
Name: akR10050 Date: 09/11/2003
Spec for ServerSocket(Proxy) specifies IllegalArgumentException to be thrown if
the argument is null. RI throws NPE instead.
Here is the testcase:
--------------------- Test29.java -----------------------
import java.net.ServerSocket;
public class Test29 {
public static void main(String[] args) {
try {
new ServerSocket(null);
} catch (NullPointerException npe) {
System.err.println("WRONG: " + npe);
} catch (IllegalArgumentException iae) {
System.err.println("CORRECT: " + iae);
}
}
}
--------------------- Test29.java -----------------------
Output:
$ java Test29
WRONG: java.lang.NullPointerException
$ java -version
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b18)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b18, mixed mode)
======================================================================
- duplicates
-
JDK-4921156 ServerSocket(Proxy) accepts HTTP proxy
-
- Resolved
-