harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6228) [classlib][text] SimpleDateFormat serialization round trip fails with NPE
Date Tue, 09 Jun 2009 13:54:07 GMT
[classlib][text] SimpleDateFormat serialization round trip fails with NPE
-------------------------------------------------------------------------

                 Key: HARMONY-6228
                 URL: https://issues.apache.org/jira/browse/HARMONY-6228
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M9
         Environment: All
            Reporter: Tim Ellison


The following code causes a NPE on Harmony, but passes ok on the RI:

        SimpleDateFormat sdf = new SimpleDateFormat(
                "EEE, d MMM yyyy HH:mm:ss Z");

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(bos);
        oos.writeObject(sdf);
        oos.close();

        ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
        ObjectInputStream ois = new ObjectInputStream(bis);
        SimpleDateFormat sdf2 = (SimpleDateFormat)ois.readObject();
        ois.close();


The walkback is:
java.lang.reflect.InvocationTargetException
        at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
        at java.lang.reflect.Method.invoke(Method.java:317)
        at org.apache.harmony.vm.JarRunner.main(JarRunner.java:89)
Caused by: java.lang.NullPointerException
        at java.text.SimpleDateFormat.set2DigitYearStart(SimpleDateFormat.java:722)
        at java.text.SimpleDateFormat.readObject(SimpleDateFormat.java:787)
        at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
        at java.lang.reflect.Method.invoke(Method.java:317)
        at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1406)
        at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2003)
        at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:802)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2152)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2107)
        at SDFTest.main(SDFTest.java:21)
        at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
        ... 2 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message