<Swing Dev> [10] RFR JDK-8181421: 3 regtest fail on windows7 in Nimbus L&F

Sergey Bylokhov sergey.bylokhov at oracle.com
Mon Jun 19 14:34:28 UTC 2017


> private void updateStyle(JPanel c) {
>         SynthContext context = getContext(c, ENABLED);
>         style = SynthLookAndFeel.updateStyle(context, this);
>     }
> it calls getContext() which in turn calls SynthContext.getContext() with style variable. 
> private SynthContext getContext(JComponent c, int state) {
>         return SynthContext.getContext(c, style, state);
>     }
> Now, "style"  variable seems to be null at this point in SYnthPanelUI.java and 
> it only gets updated after getContext() call when it calls then next line SynthLookAndFeel.updateStyle(context, this);

And the question why it is null here in these test cases, but correct value in others tests.

> 
> I could not remove the html file as I am getting some serialization issue if I moved from applet to main based so I retained applet based test, as of now. Also, due to it being applet, I am not sure how to run them over installed l&f inside the test.

I see that in the latest version you remove html files, and now you can iterate over all installed l&f.

> 
> Modified webrev with test issues rectfied
> http://cr.openjdk.java.net/~psadhukhan/8181421/webrev.01/ <http://cr.openjdk.java.net/~psadhukhan/8181421/webrev.01/>
> 
> Regards
> Prasanta
> On 6/2/2017 1:35 AM, Sergey Bylokhov wrote:
>> Hi, Prasanta.
>> I have few small notes.
>>  - Did you check why the null value was passed to this method?
>>  - It seems that the tests are passed by default. It would be good to run them over the installed l&f. In this case they will fail before the fix.
>>  - Is it possible to remove the html files from the tests?
>>  - The tests also have some common issues, the Swing components are accessed on non-edt thread. some unnecessary commented code, etc.
>> 
>> ----- prasanta.sadhukhan at oracle.com <mailto:prasanta.sadhukhan at oracle.com> wrote: 
>> >
>> Hi All,
>> Please review a subitem fix of JDK-7190554 <https://bugs.openjdk.java.net/browse/JDK-7190554> where some closed regression test is failing with Nimbus L&F.
>> Issue was we were getting NPE 
>> > which is because a null style was used in SynthPanelUI to generate the SynthContext
>> > 
>> > java.lang.NullPointerException: You must supply a non-null component, region and style
>> >     at java.desktop/javax.swing.plaf.synth.SynthContext.getContext(SynthContext.java:58)
>> >     at java.desktop/javax.swing.plaf.synth.SynthContext.getContext(SynthContext.java:49)
>> >     at java.desktop/javax.swing.plaf.synth.SynthPanelUI.getContext(SynthPanelUI.java:128)
>> >     at java.desktop/javax.swing.plaf.synth.SynthPanelUI.updateStyle(SynthPanelUI.java:115)
>> >     at java.desktop/javax.swing.plaf.synth.SynthPanelUI.installDefaults(SynthPanelUI.java:100)
>> > 
>> > Proposed fix is to generate a style before generating SynthContext because as per spec,
>> > https://docs.oracle.com/javase/8/docs/api/index.html?javax/swing/plaf/synth/SynthContext.html <https://docs.oracle.com/javase/8/docs/api/index.html?javax/swing/plaf/synth/SynthContext.html>
>> > it should throw NPE - if component, region or style is null.
>> > 
>> > Bug: https://bugs.openjdk.java.net/browse/JDK-8181421 <https://bugs.openjdk.java.net/browse/JDK-8181421>
>> > webrev: http://cr.openjdk.java.net/~psadhukhan/8181421/webrev.00/ <http://cr.openjdk.java.net/%7Epsadhukhan/8181421/webrev.00/>
>> > 
>> > Regards
>> > Prasanta
>> > 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20170619/2f192722/attachment.html>


More information about the swing-dev mailing list