JDK-4897937 : serialVersionUID computation should ignore the ACC_SYNTHETIC flag
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io:serialization
  • Affected Version: 5.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows_2000
  • CPU: generic,x86
  • Submitted: 2003-07-29
  • Updated: 2017-05-16
  • Resolved: 2003-08-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 tigerFixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
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.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b16 VERIFIED IN: tiger
14-06-2004

PUBLIC COMMENTS 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.
10-06-2004

EVALUATION Yup. ###@###.### 2003-07-29 Note that while this bug should (and will) be fixed soon, JCK failures caused by it may indicate classes in the JDK which are not explicitly declaring serialVersionUIDs, but should be. Separate bugs should be filed against any classes discovered to be missing explicit serialVersionUID declarations. ###@###.### 2003-08-13
13-08-2003