Bug 69959 - compiler warning for serializable classes that do not explicitly declare serialVersionUID
Summary: compiler warning for serializable classes that do not explicitly declare seri...
Status: RESOLVED DUPLICATE of bug 69942
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-13 14:27 EDT by Jim des Rivieres CLA
Modified: 2004-07-13 14:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim des Rivieres CLA 2004-07-13 14:27:03 EDT
There should be a compiler warning for serializable classes that do not 
explicitly declare serialVersionUID. For maximum effectiveness, this compiler 
option should be "warning" by default.

ref: http://c2.com/cgi/wiki?AlwaysDeclareSerialVersionUid

Serializable classes that do not declare serialVersionUID are a serious 
problem for people who build products that rely on Java serialization. The 
problem is that many people forget that changing their class will introduce 
compatibility problems with earlier releases of their product, and that the 
compiler's computation of a SUID is so fragile that it is not recommended.
In one case, only 50 of a product's 1500 serializable classes declared the 
SUID, making it difficult for them to provide inter-version compatibility.
Best practice dictates that one always declares serialVersionUID. (There are 
lots more things that need to be done to manage Java serializability, but this 
is a cornerstore of policy.)
Comment 1 Jim des Rivieres CLA 2004-07-13 14:27:56 EDT
Oops.

*** This bug has been marked as a duplicate of 69942 ***