FIX: java.text.DateFormat.parse() Throws a NullPointerExceptionID: Q177751
|
When the parse() method of the java.text.DateFormat cannot parse a date, the Microsoft virtual machine incorrectly throws a NullPointerException error instead of a ParseException error.
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.
This bug was corrected in the Microsoft virtual machine contained in the SDK for Java 3.0 and later.
class Test
{
public static void main(String[] args)
{
try
{
java.text.DateFormat Df;
Df = java.text.DateFormat.getDateInstance();
Df.parse("Foo");
System.out.println ("Done.");
}
catch(Exception e)
{
System.err.println("caught exception");
e.printStackTrace();
}
}
}
For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java,
please see the following pages on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/
http://support.microsoft.com/support/java/
Additional query words: DateFormat parse exception
Keywords : kbSDKJava300fix JVM kbSDKJava310fix
Version : WINDOWS:2.0,4.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: July 26, 1999