harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Petrenko (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2853) [classlib][swing] j.s.plaf.basic.BasicScrollBarUI.configureScrollBarColors() doesn't throw NPE
Date Thu, 15 Mar 2007 17:55:09 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-2853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481256
] 

Alexey Petrenko commented on HARMONY-2853:
------------------------------------------

Sergey,

your patch throws NPE in case of thumbColor or thumbDarkShadowColor and other colors are nulls.

I've modified the original test a little.
=== cut ===
public class Test { 
    private static class TestBasicScrollBarUI extends BasicScrollBarUI { 
        @Override 
        public void configureScrollBarColors() { 
            super.configureScrollBarColors(); 
        } 
    } 

    public static void main(String[] args) { 
        TestBasicScrollBarUI sbr = new TestBasicScrollBarUI(); 
        sbr.installUI(new JScrollBar()); // added string
        sbr.configureScrollBarColors(); 
    } 
} 
=== cut ===

And RI stops throwing NPE while Harmony with your patch still throws it. This means that RI
throws NPE in case of scrollbar field is null but not thumbColor or thumbDarkShadowColor and
other colors are nulls.

So your patch does not fix the original issue and introduces regression to Harmony code and
it can not be applied.

Please be more careful with your patches.

Thanks in advance.

SY, Alexey

P.S. I'll create a new patch myself.


> [classlib][swing] j.s.plaf.basic.BasicScrollBarUI.configureScrollBarColors() doesn't
throw NPE
> ----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2853
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2853
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: Harmony-2853-BasicScrollBarUI.patch, Harmony-2853-BasicScrollBarUITest.patch
>
>
> ======= Code to Reproduce =======
> import javax.swing.plaf.basic.BasicScrollBarUI;
> public class Test {
>     private static class TestBasicScrollBarUI extends BasicScrollBarUI {
>         @Override
>         public void configureScrollBarColors() {
>             super.configureScrollBarColors();
>         }
>     }
>     public static void main(String[] args) {
>         TestBasicScrollBarUI sbr = new TestBasicScrollBarUI();
>         sbr.configureScrollBarColors();
>     }
> }
> ======= end of code =======
> Harmony works silently, but RI throws NPE:
> java.lang.NullPointerException
> 	at javax.swing.LookAndFeel.installColors(LookAndFeel.java:56)
> 	at javax.swing.plaf.basic.BasicScrollBarUI.configureScrollBarColors(BasicScrollBarUI.java:113)
> 	at Test$TestBasicScrollBarUI.configureScrollBarColors(Test.java:7)
> 	at Test.main(Test.java:13)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message