On Wed, 26 Oct 2022 10:28:21 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

> If getDefaultEditor() is called before the JTable model is setup, it results 
> in NPE.
> 
> This is because when JTable sets its model, which ends up firing a table 
> changed event. The testcase is listening for tableChanged events and querying 
> the editor. But the editor isn't installed until after the model is set which 
> results in NPE.
> Fix is to ensure initializeLocalVars() which initializes default editor is 
> setup before JTable sets its model.
> 
> No regression is observed in jtreg/jck testsuite with this change.

This pull request has now been integrated.

Changeset: 18ff1f5a
Author:    Prasanta Sadhukhan <psadhuk...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/18ff1f5a055deb29f56f16e0fb6bbe3f5c7e4169
Stats:     142 lines in 2 files changed: 141 ins; 1 del; 0 mod

6257207: JTable.getDefaultEditor throws NullPointerException

Reviewed-by: tr, dnguyen, aivanov, serb

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

PR: https://git.openjdk.org/jdk/pull/10871

Reply via email to