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

Fix Stream Protocol for Externalizable: Enable skipping externalizable data

XMLWordPrintable

    • 1.1.6
    • generic
    • solaris_2.5
    • Verified

        Backwards compatibility of a serialized stream does not work for
        following class evolution scenario.

        A Serializable Class A is evolved in the following manner.

        Add a new field, fieldA, to Class A.
        The type of the field is also new and it is exernalizable.
        Produce a serialized stream containing Class A.

        Attempt to read the serialized stream using the original
        Class A definition that did not include field A. Additionally,
        the type of fieldA does not exist in this class path.

        While reading an instance of A, the following stack trace is produced

        java.io.StreamCorruptedException: Type code out of range, is 66
                at java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1168)
                at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)

              jfialli Joe Fialli
              jfialli Joe Fialli
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: