<Swing Dev> Integrated: 8256014: Eliminate the warning about serialization in non-public API of Swing

Sergey Bylokhov serb at openjdk.java.net
Mon Nov 9 06:43:56 UTC 2020


On Sun, 8 Nov 2020 09:14:41 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> As part of the serialization cleanup, I would like to remove the serialization warning below from the non-public API(mostly motif and windows L&Fs). Later I will remove it from the public API and move this warning to the "javax.swing" package spec.
> 
>  * <strong>Warning:</strong>
>  * 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. A future release of Swing will provide support for
>  * long term persistence.
> 
> Note that this warning is useless because the UI delegates(parts of L&F) should never be serialized. Such classes were marked as "Serializable" by accident. If the component like JButton is serialized then parts related to the L&F are removed from the stream. This is because default L&F could be different before/after serialization.

This pull request has now been integrated.

Changeset: c7551c37
Author:    Sergey Bylokhov <serb at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/c7551c37
Stats:     1405 lines in 67 files changed: 404 ins; 700 del; 301 mod

8256014: Eliminate the warning about serialization in non-public API of Swing

Reviewed-by: prr, psadhukhan

-------------

PR: https://git.openjdk.java.net/jdk/pull/1110


More information about the swing-dev mailing list