struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <rahul.akol...@gmail.com>
Subject Re: Should we add serialVersionUID fields for example applications?
Date Thu, 06 Sep 2007 14:01:22 GMT
On 9/6/07, Ted Husted <husted@apache.org> wrote:
> So, for complicated reasons, I'm trying to use Eclipse more these days.
>
<snip/>

;-)


> Something it likes to do is nag that "The serializable class
> $classname does not declare a static final serialVersionUID field of
> type long".
>
> Since the Actions are serializable, we get this alot :)
>
> A seemingly good explanation of the message is here:
>
>  * http://forum.java.sun.com/thread.jspa?threadID=581654&messageID=3501336
>
> Do we want to go ahead and add the field and silence the nag? Or just
> turn it off in our Eclipse IDEs? Or add the "@SupressWarnings"
> annotations? Otherwise, it's hard to tell if we've addressed any other
> warnings.
>
<snap/>

I'd say add
 * I'd imagine you'd want to promote this practice
 * Given these are example apps, it probably won't break anything in prod

However, as already pointed out, adding implies some commitment to
updating those when serialization incompatible changes are made
(again, for example apps, perhaps this is not much of a concern).


> If we were to add it and use the "quick fix", should we "add a default
> serial ID" or  "add generated serial ID"?
>
<snip/>

Default should be fine here IMO. One of the reasons to generate is to
try to best guess the UID of a previous (serialization compatible)
version that didn't specify the UID.

-Rahul


> -Ted.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message