This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 58917 - Add serialVersionUID to serializable templates
Summary: Add serialVersionUID to serializable templates
Status: RESOLVED DUPLICATE of bug 70746
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-13 23:22 UTC by kitfox
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kitfox 2005-05-13 23:22:32 UTC
I compile my projects in a free from project, and usually compile with the -lint
flag.  Unfortunately, this causes warnings to be thrown if the serialVersionUID
is not declared in the file.  I find when I compile, I have to go back through
all my Dialogs, Panels and Exeptions adding the serialVersionUID.

Could the serializable templates (Exception, JPanel, JDialog, JFrame, JApplet
and their awt counterparts) be altered to include the below line?  I'd suggest
putting this in the white editable part rather than the blue uneditable part of
the generated code.

    public static final long serialVersionUID = 0;

Mark McKay
http://www.kitfox.com
Comment 1 _ rkubacki 2005-07-08 08:07:29 UTC
SVUID in Swing classes is not a good idea IMO. It can silence some tools but can
also cause some troubles. It is meant to help you keep the compatibility but
compatibility is not guaranteed here. And if you are not going to serialize it
anyway than it just polutes the code.
Comment 2 Jan Pokorsky 2007-04-10 12:32:52 UTC

*** This issue has been marked as a duplicate of 70746 ***