help me to fix one warning [message #459747] |
Mon, 15 August 2005 12:20 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03397 seconds