Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P4
-
Resolution: Not an Issue
-
Affects Version/s: 1.1.4
-
Fix Version/s: None
-
Component/s: core-libs
-
Labels:
-
Subcomponent:
-
CPU:sparc
-
OS:solaris_2.5
Description
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
-----------------------------------------------------------------
======================================================================