RFR: 6441373: Editing JTable is not Serializable

Sergey Bylokhov serb at openjdk.org
Tue Dec 9 05:10:58 UTC 2025


On Tue, 9 Dec 2025 03:57:16 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>GenericEditor is instantiated from JTable contstuctor
JTable->initializeLocalVars->createDefaultEditors->new GenericEditor()
so when JTable gets serialized in writeObject it calls s.defaultWriteObject() which tried to serialize this class by default which it can't so we got an exception..

It does not matter that we created this object; it is only serialized if it is referenced by the JTable we are serializing or by other objects that are referenced by the JTable.

All references to the editor are marked as transient, so the GenericEditor should not be stored by the JTable. After deserialization, it should be restored by calling readObject() → createDefaultEditors().

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

PR Comment: https://git.openjdk.org/jdk/pull/28627#issuecomment-3630342909


More information about the client-libs-dev mailing list