harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vasily Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-2903) [classlib][swing] j.s.plaf.basic.BasicOptionPaneUI.getIconForType() doesn't throw NPE
Date Mon, 15 Jan 2007 21:40:27 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-2903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vasily Zakharov updated HARMONY-2903:
-------------------------------------

    Attachment: Harmony-2903-Test.patch

> [classlib][swing] j.s.plaf.basic.BasicOptionPaneUI.getIconForType() doesn't throw NPE
> -------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2903
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2903
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib, Non-bug differences from RI
>            Reporter: Alexey A. Ivanov
>            Priority: Minor
>         Attachments: Harmony-2903-Make.patch, Harmony-2903-Test.patch, Harmony-2903-Test.patch,
Harmony-2903.patch
>
>
> javax.swing.plaf.basic.BasicOptionPaneUI.getIconForType(int) returns non-null icon whereas
RI throws NPE:
> java.lang.NullPointerException
> 	at sun.swing.DefaultLookup.get(DefaultLookup.java:81)
> 	at javax.swing.plaf.basic.BasicOptionPaneUI.getIconForType(BasicOptionPaneUI.java:551)
> 	at Test$TestBasicOptionPaneUI.getIconForType(Test.java:8)
> 	at Test.main(Test.java:14)
> Note: if UI is associated with a JOptionPane, then RI returns an icon too and no exception
is thrown.
> (Add the following line before System.out:
>         bop.installUI(new JOptionPane());
> )
> ======= Code to Reproduce =======
> import javax.swing.Icon;
> import javax.swing.plaf.basic.BasicOptionPaneUI;
> public class Test {
>     private static class TestBasicOptionPaneUI extends BasicOptionPaneUI {
>         @Override
>         public Icon getIconForType(int i) {
>             return super.getIconForType(i);
>         }
>     }
>     public static void main(String[] args) {
>         TestBasicOptionPaneUI bop = new TestBasicOptionPaneUI();
>         System.out.println(bop.getIconForType(0));
>     }
> }
> ======= end of code =======

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message