RFR: 6529151: NullPointerException in swing.plaf.synth.SynthLookAndFeel$Handler

Sergey Bylokhov serb at openjdk.org
Tue Sep 6 23:09:49 UTC 2022


On Mon, 5 Sep 2022 12:45:53 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> NPE is thrown for closed/disposed JDialogs after uninstalling the UI which is because for SynthEditorPaneUI even though is disposed of, Nimbus propertyHandler tries to get the style of this disposed component resulting in NPE, 
> which is fixed by a null check to prevent deferencing style object to get the color.

test/jdk/javax/swing/plaf/synth/RepaintNPE.java line 84:

> 82:                     try
> 83:                     {
> 84:                         Method method = jComp.getClass().getMethod ( "getUI" );

The getUI() method is public, can be used directly.

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

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



More information about the client-libs-dev mailing list