Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4355335

BigInteger deserialize gives Null Ptr

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • 1.3.1
    • 1.3.0
    • core-libs
    • None
    • ladybird
    • sparc
    • solaris_8
    • Verified

        Looks like there is a bug with BigInteger deserialize. This only occurs when you subclass BigInteger to another class, say UnsignedInt64. When you try to serialize and then deserialize, there is a NullPointerException. If, however, it is merely embedded in a class (and not subclassed), there is no problem. This works fine on 1.2.2_05
        I'm attaching two example files. Just run java TestClient to see the result. Our RMI server fails because of this.
        Here is a stack trace:
        java.lang.NullPointerException
                at java.math.BigInteger.readObject(BigInteger.java:2638)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2213)
                at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1410)
                at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
                at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
                at TestClient.deserialize(TestClient.java:20)
                at TestClient.main(TestClient.java:8)

              mmcclosksunw Michael Mccloskey (Inactive)
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: