The information in this article applies to:
When the parse method of the java.text.DateFormat cannot parse a date, the Microsoft VM 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 VM contained in the SDK for Java 3.0 and later.
To Reproduce Behavior
Create a Java project and include the following class:
class Test { public static void main(String[] args) { { 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 VM throws a NullPointerException instead of ParseException as mentioned in the Documentation.
For the latest Knowledge Base articles and other support information on Microsoft® 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/
DateFormat parse exception