JDK-4851915 : serialization spec unclear about serialVersionUID declaration requirements
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io:serialization
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2003-04-22
  • Updated: 2003-08-13
  • Resolved: 2003-08-13
Related Reports
Duplicate :  
Description
Section 4.6 of the serialization specification states:

  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;

Other than this example, though, the serialization specification does not
state what the strict requirements are for explicit serialVersionUID
declarations.  Since its inception, serialization has checked for explicit
serialVersionUIDs by looking for a field with the name "serialVersionUID"
that is static, final, and of type long.  The serialization specification
should be updated to state this explicitly.

Comments
SUGGESTED FIX See description.
11-06-2004

PUBLIC COMMENTS Section 4.6 of the serialization specification states: 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; Other than this example, though, the serialization specification does not state what the strict requirements are for explicit serialVersionUID declarations. Since its inception, serialization has checked for explicit serialVersionUIDs by looking for a field with the name "serialVersionUID" that is static, final, and of type long. The serialization specification should be updated to state this explicitly.
10-06-2004

EVALUATION Yup. ###@###.### 2003-04-22 This is a sub-issue of bug 4769060, which this bug is being closed as a duplicate of. ###@###.### 2003-08-13
22-04-2003