RFR: 6441373: Editing JTable is not Serializable

Prasanta Sadhukhan psadhukhan at openjdk.org
Tue Dec 9 05:17:54 UTC 2025


On Tue, 9 Dec 2025 05:08:20 GMT, Sergey Bylokhov <serb 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().

I dont understand what you are trying to say. WHen JTable is serialized, writeObject also tries to serialize inner GenericEditor class (which is by default Serializable) which it fails to do..I dont see any other way of it being serialized..

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

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


More information about the client-libs-dev mailing list