RFR: 8375011: OldJTable.java - NullPointerException when columnData is null [v3]

Sergey Bylokhov serb at openjdk.org
Wed Jan 28 21:12:15 UTC 2026


On Mon, 19 Jan 2026 07:02:12 GMT, Anupam Dev <adev at openjdk.org> wrote:

>> Hi,
>> 
>> This is a fix for NPE in OldJTable.addColumn
>> 
>> The addColumn method in OldJTable.java was unconditionally calling columnData.toArray(), which caused a NullPointerException when columnData was null (e.g., when called from addColumn(Object, int)).
>> 
>> This commit adds a null check to safe-guard against this NPE, passing null to the underlying DefaultTableModel when columnData is missing.
>> 
>> Kindly review.
>> 
>> Regards,
>> Anupam
>
> Anupam Dev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update full name

/**
 *  The OldJTable is an unsupported class containing some methods that were
 *  deleted from the JTable between releases 0.6 and 0.7
 */

It might be better to just delete it.

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

PR Comment: https://git.openjdk.org/jdk/pull/29226#issuecomment-3813945488


More information about the client-libs-dev mailing list