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

need way to handle multiple serialVersionUIDs for one class

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      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.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bshannon Bill Shannon
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: