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

Sergey Bylokhov serb at openjdk.java.net
Mon Nov 9 00:42:00 UTC 2020


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.

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

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

Changes: https://git.openjdk.java.net/jdk/pull/1110/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1110&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8256014
  Stats: 1405 lines in 67 files changed: 404 ins; 700 del; 301 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1110.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1110/head:pull/1110

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


More information about the swing-dev mailing list