RFR: 6441373: Editing JTable is not Serializable [v7]

Sergey Bylokhov serb at openjdk.org
Thu Jan 8 00:36:53 UTC 2026


On Fri, 2 Jan 2026 10:05:57 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> Issue is when JTable is in editing mode, it is not Serializable as it gives exception
>> 
>> java.io.NotSerializableException: java.lang.reflect.Constructor
>>         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1149) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1502)
>>         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1467)
>>         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1385)
>>         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1143) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1502)
>> .......
>> 
>> 
>> It is caused by creation of `GenericEditor` class which uses a non-serializable Constructor field.
>> This is fixed by making the field transient..
>> Also, `editorRemover` field is made transient as it is object of `CellEditorRemover` class which is not Serializable..
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Component count leakage fix

src/java.desktop/share/classes/javax/swing/JTable.java line 5965:

> 5963:         throws IOException, ClassNotFoundException
> 5964:     {
> 5965:         this.removeAll();

This will remove all children from the JTable, including those added by the app.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28627#discussion_r2670487927


More information about the client-libs-dev mailing list