-
Bug
-
Resolution: Fixed
-
P4
-
1.1
-
1.2beta4
-
sparc
-
solaris_2.5
-
Verified
Name: saC57035 Date: 12/14/96
The java_io.StreamTokenizer constructor StreamTokenizer(InputStream in)
accept and do not check null parameter. Every call to StreamTokenizer
object which is created using null, results in throwing undocumented
NullPointerException.
The constructor should not allow user create object in invalid state.
Here is the example demonstrating this bug
_______________________Test.java ______________________________________
import java.io.*;
public class Test {
public static void main( String argv[] ) {
StreamTokenizer st = new StreamTokenizer(null);
try {
st.nextToken();
System.out.println(st);
System.out.println("No exceptions - rather strange but alright");
} catch (IOException e) {
System.out.println("IOException is thrown - possible result");
} catch (Throwable e) {
System.out.println(e+" is thrown - this is not allowed");
}
}
}
_____________________Output_________________________________________
java.lang.NullPointerException is thrown - this is not allowed
____________________________________________________________________
======================================================================