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

serialVersionUID computation should ignore the ACC_SYNTHETIC flag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 5.0
    • 5.0
    • core-libs
    • tiger
    • generic, x86
    • generic, windows_2000
    • Verified

      A new JVM_ACC_SYNTHETIC bit is now showing up in the public modifier bits
      for classes, fields, and methods. In classes which do not define explicit
      serialVersionUIDs, this is causing default serialVersionUID values to change.
      Although it's not possible to preserve default serialVersionUIDs overall
      (since the default serialVersionUID computation algorithm is highly sensitive
      to class changes, including some that may result from valid differences
      in java compiler implementations), it would make sense to change
      ObjectStreamClass's implementation of the serialVersionUID computation to
      ignore the JVM_ACC_SYNTHETIC modifier, so as to minimize the impact of this
      change.

      This change may not necessarily require a spec update, since the serialization
      spec does not strictly specify how the class, field, constructor, and method
      modifier values written out during serialVersionUID computation are obtained,
      or whether all flags in the modifier bit-vector are considered--the current
      implementation of the serialVersionUID computation algorithm masks out all
      flags except those representing the public, final, interface, and abstract
      modifiers for classes, but does not perform the same masking for field,
      constructor, and method modifiers.

            mwarressunw Michael Warres (Inactive)
            mwarressunw Michael Warres (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: