RFR: 6441373: Editing JTable is not Serializable
Prasanta Sadhukhan
psadhukhan at openjdk.org
Tue Dec 9 03:59:56 UTC 2025
On Tue, 9 Dec 2025 03:52:57 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> > GenericEditor extends DefaultCellEditor which extends AbstractCellEditor which is Serializable so I guess by default that class becomes Serializable but in JTable other things are pointing to the fact editing should not be serialized so we have made the field in GenericEditor transient.
>
> It is not serialized by "default", it is only serialized if it is referenced from somewhere. In our case, it is referenced from somewhere inside JTable, which we tried to serialize.
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..
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28627#issuecomment-3630144892
More information about the client-libs-dev
mailing list