Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » help me to fix one warning
help me to fix one warning [message #459747] Mon, 15 August 2005 12:20 Go to next message
Eclipse UserFriend
Originally posted by: zhehao.shi.volkswagen.de

Almost in my every GUI class and the example from internet. I got a
warning says "The serializable class SimpleTableDemo does not declare a
static final serialVersionUID field of type long". I never had this
warning before. So I am wandering what is missing in the class and how to
solve it. Because almost every my GUI class has this warning which I dot
have when I used Eclipse 3.0
Re: help me to fix one warning [message #459749 is a reply to message #459747] Mon, 15 August 2005 13:29 Go to previous message
Eclipse UserFriend
Originally posted by: hcs33.egon.gyaloglo.hu

Hi,

When you declare a serializable class you should provide a serialVersionUID
long to avoid implicit serial version generation of vm (this latter can
broke when you switch vm-s: see http://www.javapractices.com/Topic45.cjp for
some details). In Eclipse 3.1 there is a compiler option to help you enforce
the explicit field declaration and since e.g. Swing JComponent is a
serializable class all of its descendants are serizalizable as well. If you
do not want to save / restore your gui using serialization you have nothing
to do with this warning.

If you want, you can turn off this warning in Preferences / Java / Compiler
/ Errors/Warnings / Potential programming problems. Set the 'Serializable
class without serialVersionUID' to 'ignore'.

HTH,
Regards,
Csaba

Shi,Zhehao wrote:
> Almost in my every GUI class and the example from internet. I got a
> warning says "The serializable class SimpleTableDemo does not declare a
> static final serialVersionUID field of type long". I never had this
> warning before. So I am wandering what is missing in the class and how to
> solve it. Because almost every my GUI class has this warning which I dot
> have when I used Eclipse 3.0
Previous Topic:how to load a class of swt
Next Topic:DOTEclipse
Goto Forum:
  


Current Time: Mon Apr 19 13:37:55 GMT 2021

Powered by FUDForum. Page generated in 0.01983 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top