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

Summary: Add serialVersionUID to serializable templates
Product: java Reporter: kitfox <kitfox>
Component: UnsupportedAssignee: issues@java <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: athompson, rkubacki
Priority: P4    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

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 ***