JDK-4769060 : docs: no spec for serialVersionUID
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io:serialization
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris_8
  • CPU: generic
  • Submitted: 2002-10-25
  • 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 Availabitlity Release.

To download the current JDK release, click here.
Other
5.0 tigerFixed
Related Reports
Duplicate :  
Relates :  
Description
There is no specification for the interface in which a serializable class
declares its own serial version UID.  Is there a particular name that must
be used for this variable?  Must it be static?  Must it be private?
Must it be final?  Must it be constant?  Does the user have a choice in
declaring its type?  How does this variable affect serialization?

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

EVALUATION The serialVersionUID field and its requirements are specified in section 4.6 ("Stream Unique Identifiers") of the Java Object Serialization specification. It would make sense to include some of this information, or at least a pointer to it, in the javadoc for the Serializable interface in a future release. Note that the javadoc for the various serialization classes, however, is not intended to be a general specification of serialization--there are numerous other aspects of serialization behavior that are described only in the serialization spec and not in javadoc. ###@###.### 2002-10-25 I read that section. The only text that even mentions serialVersionUID is Each versioned class must identify the original class version for which it is capable of writing streams and from which it can read. For example, a versioned class must declare: private static final long serialVersionUID = 3487495895819393L; The stream-unique identifier is a 64-bit hash of the class name, interface class names, methods, and fields. The value must be declared in all versions of a class except the first. It may be declared in the original class but is not required. The value is fixed for all compatible classes. If the SUID is not declared for a class, the value defaults to the hash for that class. Serializable classes do not need to anticipate versioning; however, Externalizable classes do. Note that because this is only an "example," this text does not answer any of the questions raised in this bug report. ###@###.### 2002-10-25 Right, the serialization spec itself should be clarified as well, though this will have to wait for a release after mantis due to resource constraints. ###@###.### 2002-10-25
2002-10-25