harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey A. Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-2766) [classlib][swing] javax.swing.plaf.basic.BasicListUI.getCellBounds() does not throw unspecified NPE while RI does
Date Wed, 20 Dec 2006 09:08:23 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-2766?page=all ]

Alexey A. Ivanov updated HARMONY-2766:
--------------------------------------

    Attachment: H2766-BasicListUITest.patch
                H2766-BasicListUI.patch

Regression test case and the fix.

I've just placed component installation above other parameters validation.

> [classlib][swing] javax.swing.plaf.basic.BasicListUI.getCellBounds() does not throw unspecified
NPE while RI does
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2766
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2766
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Attachments: H2766-BasicListUI.patch, H2766-BasicListUITest.patch
>
>
> There is no mention of any exception in the specification for  getCellBounds(JList list,int
index1, int index2).
> Harmony throws unspecified NPE if JList == null and index1>0. RI also throws NPE.
> But  Harmony does not throw NPE if JList == null and index1<0 while RI does.
> import javax.swing.plaf.basic.BasicListUI;
> import javax.swing.UIDefaults;
> import javax.swing.*;
> public class test {
>     public static void main(String[] args) {
>         try {
>                BasicListUI bl = new BasicListUI();
>                 bl.getCellBounds((JList) null, -1, 9);
>          } catch (Exception e) {
>                 e.printStackTrace();
>         }
>         try {
>                BasicListUI bl = new BasicListUI();
>                 bl.getCellBounds((JList) null, 1, 9);
>          } catch (Exception e) {
>                 e.printStackTrace();
>          }
>     }
> }
> Output on RI:
> java.lang.NullPointerException
>         at
> javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1125)
>         at
> javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1105)
>         at
> javax.swing.plaf.basic.BasicListUI.getCellBounds(BasicListUI.java:746)
>         at test.main(test.java:10)
> java.lang.NullPointerException
>         at
> javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1125)
>         at
> javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1105)
>         at
> javax.swing.plaf.basic.BasicListUI.getCellBounds(BasicListUI.java:746)
>         at test.main(test.java:16)
>  Output on Harmony +j9:
> java.lang.NullPointerException
>         at
> javax.swing.plaf.basic.BasicListUI.getCellBounds(BasicListUI.java:375)
>         at test.main(test.java:16)

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

        

Mime
View raw message