-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.1.4
-
sparc
-
solaris_2.5
Name: yyC67448 Date: 10/29/97
The java.net.Socket(SocketImpl impl) does not throw any Exception for
null parameter.
Here is the test demonstrating the bug:
-------------------------------- Test.java -----------------------------
import java.io.*;
import java.net.*;
class NewSocket extends Socket
{
public NewSocket(SocketImpl impl) throws SocketException
{
super(impl);
}
}
class test
{
public static void main(String args[])
{
NewSocket soc = null;
int port = 0;
try {
soc = new NewSocket((SocketImpl)null);
} catch(Exception e)
{
System.out.println("OKAY");
System.exit(-1);
}
try {
port = soc.getPort();
} catch(Exception e)
{
System.out.println("Failed. Unexpected exception:" +e );
System.exit(-1);
}
System.out.println("OKAY");
}
}
---------------------- Output from the test -----------------
Failed. Unexpected exception:java.lang.NullPointerException
-----------------------------------------------------------------
======================================================================