Hi All,
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.
Proposed fix is to updateStyle for this context for this SynthUI object
if style is found to be null.
Bug: https://bugs.openjdk.java.net/browse/JDK-8192888
webrev: http://cr.openjdk.java.net/~psadhukhan/8192888/webrev.0/
Regards
Prasanta