harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496280 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI.java test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUITest.java
Date Mon, 15 Jan 2007 11:40:35 GMT
Author: hindessm
Date: Mon Jan 15 03:40:34 2007
New Revision: 496280

URL: http://svn.apache.org/viewvc?view=rev&rev=496280
Log:
Applying patches from "[#HARMONY-2888] [classlib][swing]
javax.swing.plaf.basic.BasicTabbedPaneUI.createScrollButton(int) does not
throw IllegalArgumentException in case of incorrect direction".

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI.java?view=diff&rev=496280&r1=496279&r2=496280
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI.java
Mon Jan 15 03:40:34 2007
@@ -895,6 +895,10 @@
     }
 
     protected JButton createScrollButton(final int direction) {
+        if (direction != NORTH && direction != SOUTH && direction != EAST
&& direction != WEST) {
+            throw new IllegalArgumentException();
+        }
+
         return new ScrollButton(direction);
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUITest.java?view=diff&rev=496280&r1=496279&r2=496280
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUITest.java
Mon Jan 15 03:40:34 2007
@@ -192,6 +192,18 @@
         assertFalse(b.isFocusable());
         assertTrue(b.getWidth() > 5);
         assertTrue(b.getHeight() > 5);
+
+        try {     
+            new BasicTabbedPaneUI() {
+                public JButton createScrollButton(int direction) {
+                    return super.createScrollButton(direction);
+                }
+            }.createScrollButton(80);
+            
+            fail("IllegalArgumentException expected");
+        } catch (IllegalArgumentException e) {    
+            // PASSED          
+        }
     }
 
     public void testExpandTabRunsArray() {



Mime
View raw message