harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Kishenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2766) [classlib][swing] javax.swing.plaf.basic.BasicListUI.getCellBounds() does not throw unspecified NPE while RI does
Date Mon, 18 Dec 2006 11:35:22 GMT
[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


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