<Swing Dev> [12] RFR JDK-8192888: AllSwingComponentsBaselineTest fails with NullPointerException for NimbusLookAndFeel
Prasanta Sadhukhan
prasanta.sadhukhan at oracle.com
Wed Sep 12 05:27:58 UTC 2018
Ok. Modified test
http://cr.openjdk.java.net/~psadhukhan/8192888/webrev.1/
Regards
Prasanta
On 12-Sep-18 2:41 AM, Sergey Bylokhov wrote:
> Hi, Prasanta.
> One small comment about the test, it will be good to check all
> supported LaF.
>
> On 11/09/2018 14:09, Sergey Bylokhov wrote:
>> Hi, Prasanta.
>> On 07/09/2018 03:57, Prasanta Sadhukhan wrote:
>>> Please review a fix for an issue where obtaining baseline for Button
>>> UI in Nimbus L&F results in NPE.
>>> Reason for it is when SynthPanelUI#installDefaults is called during
>>> frame instantiation, it calls SynthPanelUI#updateStyle which sets
>>> the context AND then the style
>>> /private void updateStyle(JPanel c) {//
>>> // SynthContext context = getContext(c, ENABLED);//
>>> // style = SynthLookAndFeel.updateStyle(context, this);//
>>> // }/ > Now, SynthContext.getContext is called with style "null"
>>> as style is
>>> updated after calling getContext.
>>> So, when getBaseline is called and it tries to invoke
>>> context.getStyle().getGraphicsUtils() it causes NPE.
>>
>> Why SynthLookAndFeel.updateStyle() which is called in
>> SynthButtonUI.updateStyle(AbstractButton b) did not update the
>> context which is passed to it? Is it possible that
>> SynthButtonUI.installDefaults() was not called before getBaseline()?
>>
>>
>
>
More information about the swing-dev
mailing list