Article ID: 177751
Article Last Modified on 6/14/2006
APPLIES TO
- Microsoft Software Development Kit for Java 2.02
- Microsoft Internet Explorer 4.01 128-Bit Edition, when used with:
- Microsoft Windows NT 4.0
- Microsoft Windows 95
- Microsoft Java Virtual Machine
This article was previously published under Q177751
SYMPTOMS
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.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are 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.
MORE INFORMATION
Steps to Reproduce Behavior
Create a Java project and include the following class:
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(); } } }
java.text.DateFormat is a package that is included with JDK1.1. Build the above code with the JVC that is provided in the SDK2.0x for Java and execute. You will see that the Microsoft virtual machine throws a NullPointerException instead of ParseException as mentioned in the Documentation.
REFERENCES
For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:
Additional query words: DateFormat parse exception
Keywords: kbbug kbfix kbsdkjava300fix kbsdkjava310fix KB177751