<Sound Dev> RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2]
serb at openjdk.java.net
Wed Jan 13 07:07:54 UTC 2021
On Wed, 13 Jan 2021 06:10:53 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> Why do we add serialVersionUID in some classes like DefaultMutableTreeNode.java but not in other swing classes?
Most Swing classes are marked by the specific "Warning" that "Same-version serialization only" is supported. (I think such a warning is missed in a few classes). So generally the serialVersionUID field is not needed in such classes, but if present this provides a small benefit -> this UID is not generated at runtime.
For example, the DefaultMutableTreeNode was updated by the JDK-5017904 fix, which was unrelated to serialization but was targeted for the performance issue.
> Also, if this change is for stricter compile-time checking, shouldn't we remove @SuppressWarnings("serial") check?
At some point, we probably can remove it but will need to fix all serialization warnings which were disabled.
More information about the sound-dev