Eventhough this class is not intended ot set to be serializable, I'm getting this unusual warning! Could someone let me know if you have come across such odd warning?!
C:\Documents and Settings\...filename.java:60: warning: [serial] serializable class SomeClass has no definition of serialVersionUID
public class NewPortalConnection extends javax.swing.JFrame {
Regards
This warning comes when you derive from a class that implements Serializable. In your case, the Serializable parent class is JFrame.
You can suppress this warning with @SuppressWarnings("serial"), or give the class a serialVersionUID: private static final long serialVersionUID = ...;
(with a long value for the dots).
There is a discussion here on SO on which is preferable.
JFrame
implements Serializable, so all extending classes also implement Serializable.
Here's a tutorial about Serializable and serialVersionUID, but to really understand the topic you should read Chapter 11 of Effective Java (2nd Ed) by Joshua Bloch
If you know your application never serializes things, add -Xlint:-serial
to command line arguments of javac
. For example,
javac -Xlint -Xlint:-serial *****
This way you will have all warnings except "serial".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With