-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
tiger
-
generic
-
generic
Name: akR10050 Date: 09/11/2003
Spec for ServerSocket(Proxy) specifies IllegalArgumentException to be thrown if
the specified proxy is of an incompatible type. RI throws nothing.
Here is the testcase:
--------------------- Test30.java -----------------------
import java.net.ServerSocket;
import java.net.Proxy;
import java.net.InetSocketAddress;
public class Test30 {
public static void main(String[] args) {
Proxy p = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(0));
try {
new ServerSocket(p);
} catch (IllegalArgumentException iae) {
System.err.println("CORRECT: " + iae);
}
System.err.println("WRONG: HTTP proxy is not a compatible type for"
+ " socket");
}
}
--------------------- Test30.java -----------------------
Output:
$ java Test29
WRONG: HTTP proxy is not a compatible type for socket
$ 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)
======================================================================
Spec for ServerSocket(Proxy) specifies IllegalArgumentException to be thrown if
the specified proxy is of an incompatible type. RI throws nothing.
Here is the testcase:
--------------------- Test30.java -----------------------
import java.net.ServerSocket;
import java.net.Proxy;
import java.net.InetSocketAddress;
public class Test30 {
public static void main(String[] args) {
Proxy p = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(0));
try {
new ServerSocket(p);
} catch (IllegalArgumentException iae) {
System.err.println("CORRECT: " + iae);
}
System.err.println("WRONG: HTTP proxy is not a compatible type for"
+ " socket");
}
}
--------------------- Test30.java -----------------------
Output:
$ java Test29
WRONG: HTTP proxy is not a compatible type for socket
$ 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-4921152 ServerSocket(Proxy) throws NullPointerException with null proxy
-
- Closed
-