Bug 204298 - serial warnings showing up on abstract classes when using 3.4M2
Summary: serial warnings showing up on abstract classes when using 3.4M2
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows Vista
: P3 minor (vote)
Target Milestone: 3.4 M3   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-21 13:24 EDT by Mik Kersten CLA
Modified: 2007-10-29 08:36 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 Mik Kersten CLA 2007-09-21 13:24:28 EDT
I just switched to a 3.4M2 I-build and noticed that the following warning:

Severity and Description	Path	Resource	Location	Creation Time	Id
The serializable class UserFilter does not declare a static final serialVersionUID field of type long	org.eclipse.mylyn.jira.core/src/org/eclipse/mylyn/internal/jira/core/model/filter	UserFilter.java	line 16	1190395218366	495489

Now shows up on abstract classes, whereas before it didn't.  While I don't know the JLS rules on this and maybe there is a need, it was against my expectation because I don't see the need for an abstract class to declare the serialVersionUID when the concrete classes extending it have to do so.  To work around it I'm adding the @SuppressWarnings("serial") to the abstract classes, which seems a bit weird, but I'm not sure if it's not more weird to add it?  

To replicate compile the following snippet with 3.4M2:

  public abstract class Foo implements Serializable { }
Comment 1 Olivier Thomann CLA 2007-09-21 14:53:22 EDT
Please look at bug 203241.
We don't intent to revert it, since it is needed and this was a mistake not to report it earlier.
Closing as INVALID.
Comment 2 Olivier Thomann CLA 2007-09-21 14:57:03 EDT
Note that the entry for bug 203241 was missing in the buildnotes. I added it in HEAD in the section v_812.
Comment 3 Mik Kersten CLA 2007-09-21 16:49:17 EDT
Thanks for the clarification Olivier.  Just curious, is Platform's convention/suggestion to put the serialVersionUID on the abstract class(es) or on the leave classes?
Comment 4 Olivier Thomann CLA 2007-09-24 12:38:16 EDT
I think the conventions should be to add a serialVersionUID field as soon as the class is serializable (abstract or not).
Comment 5 Jerome Lanneluc CLA 2007-10-29 08:36:58 EDT
Verified for 3.4M3 using I20071029-0010