harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496153 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicListUI.java test/api/java/common/javax/swing/plaf/basic/BasicListUITest.java
Date Sun, 14 Jan 2007 21:13:54 GMT
Author: hindessm
Date: Sun Jan 14 13:13:53 2007
New Revision: 496153

URL: http://svn.apache.org/viewvc?view=rev&rev=496153
Log:
Applying patches from "[#HARMONY-2766] [classlib][swing]
javax.swing.plaf.basic.BasicListUI.getCellBounds() does not throw
unspecified NPE while RI does".

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicListUI.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicListUITest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicListUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicListUI.java?view=diff&rev=496153&r1=496152&r2=496153
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicListUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicListUI.java
Sun Jan 14 13:13:53 2007
@@ -373,6 +373,9 @@
     }
 
     public Rectangle getCellBounds(final JList list, final int index1, final int index2)
{
+        layouter.setList(list);
+        maybeUpdateLayoutState();
+
         Rectangle result = null;
         if (index1 < 0 || index1 >= list.getModel().getSize()
             || index2 < 0 || index2 >= list.getModel().getSize()) {
@@ -380,8 +383,6 @@
             return result;
         }
 
-        layouter.setList(list);
-        maybeUpdateLayoutState();
         if (index1 <= index2) {
             for (int i = index1; i <= index2; i++) {
                 if (result == null) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicListUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicListUITest.java?view=diff&rev=496153&r1=496152&r2=496153
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicListUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicListUITest.java
Sun Jan 14 13:13:53 2007
@@ -190,6 +190,21 @@
         assertEquals(new Rectangle(5, 10, 100 - 5 - 7, 20), ui.getCellBounds(list, 0, 1));
     }
 
+    public void testGetCellBounds_Null() throws Exception {
+        testExceptionalCase(new NullPointerCase() {
+            @Override
+            public void exceptionalAction() throws Exception {
+                ui.getCellBounds(null, -1, 9);
+            }
+        });
+        testExceptionalCase(new NullPointerCase() {
+            @Override
+            public void exceptionalAction() throws Exception {
+                ui.getCellBounds(null, 1, 9);
+            }
+        });
+    }
+
     public void testGetMaximumSize() throws Exception {
         ui.installUI(list);
         assertEquals(ui.getPreferredSize(list), ui.getMaximumSize(list));



Mime
View raw message