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

need way to handle multiple serialVersionUIDs for one class

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      Every once in awhile we make a mistake. We create a serializable class, usually an exception
      class, without an explicit serialVersionUID. An update to the class then changes the implicit
      serialVersionUID. It's impossible to create a third version of the class that fixes the bug by
      including an explicit serialVersionUID and that handles the serialized data from both of the
      previous versions.

      It would be nice if the serialization subsystem handled this, e.g, by allowing the class to have an
      acceptSerialVersionUID(long uid) method and a long chooseSerialVersionUID() method.
      (The reading case is easy; the writing case is harder to know which uid to use.)

            Unassigned Unassigned
            bshannon Bill Shannon (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: