From 77ff19774651f1c41bbb1e59b2873d74522c8666 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Wed, 4 Jan 2023 03:26:32 +0000 Subject: [PATCH] 7030853: JDK 7 Serializable Swing classes not compatible with JDK 6 Reviewed-by: serb, aivanov --- .../share/classes/javax/swing/LayoutComparator.java | 7 +++++++ .../share/classes/javax/swing/package-info.java | 8 ++++++++ .../javax/swing/text/html/parser/ParserDelegator.java | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/src/java.desktop/share/classes/javax/swing/LayoutComparator.java b/src/java.desktop/share/classes/javax/swing/LayoutComparator.java index 17de473cfeb..383e3755ae2 100644 --- a/src/java.desktop/share/classes/javax/swing/LayoutComparator.java +++ b/src/java.desktop/share/classes/javax/swing/LayoutComparator.java @@ -36,6 +36,13 @@ import java.awt.Window; * Comparator which attempts to sort Components based on their size and * position. Code adapted from original javax.swing.DefaultFocusManager * implementation. + *

+ * 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. As of 1.4, support for long term storage + * of all JavaBeans has been added to the java.beans package. * * @author David Mendenhall */ diff --git a/src/java.desktop/share/classes/javax/swing/package-info.java b/src/java.desktop/share/classes/javax/swing/package-info.java index a75e62ebf4a..95be24d606f 100644 --- a/src/java.desktop/share/classes/javax/swing/package-info.java +++ b/src/java.desktop/share/classes/javax/swing/package-info.java @@ -128,6 +128,14 @@ * href="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"> * Concurrency in Swing. * + *

Swing's Serialization policy

+ * Warning: + * Serialized objects of any Swing 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. As of 1.4, support for long term storage + * of all JavaBeans has been added to the java.beans package. + * *

Related Documentation

* For overviews, tutorials, examples, guides, and other documentation, * please see: diff --git a/src/java.desktop/share/classes/javax/swing/text/html/parser/ParserDelegator.java b/src/java.desktop/share/classes/javax/swing/text/html/parser/ParserDelegator.java index 33788e3d9c6..0dbeb996778 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/parser/ParserDelegator.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/parser/ParserDelegator.java @@ -42,6 +42,13 @@ import java.security.PrivilegedAction; * Responsible for starting up a new DocumentParser * each time its parse method is invoked. Stores a * reference to the dtd. + *

+ * 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. As of 1.4, support for long term storage + * of all JavaBeans has been added to the java.beans package. * * @author Sunita Mani */