<Swing Dev> JDK 9 RFR of JDK-8034169: Fix serial lint warnings in javax.swing
Joseph Darcy
joe.darcy at oracle.com
Thu Feb 20 00:31:59 UTC 2014
On 2/19/2014 12:37 PM, Phil Race wrote:
>
> >In a small percentage of cases, a serialVersionUID field was added.
> > When such a field was added, the serialver computation was checked
> for consistency on JDK6 and JDK 8.
>
> I'm rather unsure about adding a serialVersionUID to some of these, eg
> RowSorterEvent.
> Looks like all the other javax.swing.event Event types have the usual
> Swing warning that :-
>
> *Warning:* Serialized objects of this class will not be compatible
> with future Swing releases. The current serialization support is
> appropriate for short term storage or RMI between applications running
> the same version of Swing
>
> I think where ever in Swing you did not see that warning it was
> probably an oversight rather
> than implying long-term persistence is supported
>
> In other words where ever I see the annotation added I think there's
> no harm. I'm more worried
> about where I see serialVersionUID added.
>
> So in these cases would be good to have a Swing engineer confirm that
> it is so, for example
> for the Layout classes which also have a serialVersionUID added. I
> don't see how these
> on their own are useful.
There are about 23 cases in this patch where a serialVersionUID was
added in lieu of a @SuppressWarnings("serial") annotation.
If the swing team can provide a definitive ruling, I'm happy to swap
these out to be annotations instead.
Thanks,
-Joe
More information about the swing-dev
mailing list