@SuppressWarnings("serial")

I tried to do my homework on this question but only see scattered answers…

My app is littered with warnings “serializable class … does not declare … serialVersionUID” but still runs fine.

Is it safe just to add @SuppressWarnings(“serial”).

They mainly show up when I extend a Vertical or HorizontalLayout or when I add Listeners.

OR another question… When would I add a Default or Generated serial version ID instead of Suppressing them.

Thanks!
Dana

Serialization of your application is mainly needed if you deploy your application to Google App Engine, which requires everything to be serializable. Your application will most likely work even though you haven’t defined a serializationVersionUID for everything - that is, if you are deploy on eg. Tomcat.

In my opinion, you shouldn’t be suppressing warnings at all, rather fix the warnings, especially when they are so trivial to fix like in this case. If you get used to just suppressing warnings, you might actually suppress something that WILL cause your app to break.