FIX: java.text.DateFormat.parse() Throws a NullPointerException

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

  1. 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:
Propiedades

Id. de artículo: 177751 - Última revisión: 02/14/2017 - Revisión: 1

Microsoft Software Development Kit for Java 2.02, Microsoft Virtual Machine for Java

Comentarios