harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496106 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicProgressBarUI.java test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java
Date Sun, 14 Jan 2007 18:05:55 GMT
Author: hindessm
Date: Sun Jan 14 10:05:54 2007
New Revision: 496106

URL: http://svn.apache.org/viewvc?view=rev&rev=496106
Log:
Applying patches from "[#HARMONY-2699] [classlib][swing]
javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex(int newValue)
throws unspecified  ArithmeticException while RI throws NPE".  As suggested
I left the test excluded.

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicProgressBarUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicProgressBarUI.java?view=diff&rev=496106&r1=496105&r2=496106
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicProgressBarUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicProgressBarUI.java
Sun Jan 14 10:05:54 2007
@@ -337,6 +337,9 @@
     }
 
     protected void setAnimationIndex(final int newValue) {
+        if (progressBar == null) {
+            throw new NullPointerException("progressBar is null");
+        }
         animationIndex = newValue % maxAnimationIndex;
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java?view=diff&rev=496106&r1=496105&r2=496106
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java
Sun Jan 14 10:05:54 2007
@@ -128,10 +128,19 @@
         assertEquals(ui.getPreferredInnerHorizontal().height, inner.height);
     }
 
-    public void testAnimation() {
+    public void testAnimation() throws ArithmeticException {
         ui.installUI(progressBar);
         progressBar.setIndeterminate(true);
         assertEquals(0, ui.getAnimationIndex());
+        ui.setAnimationIndex(5);
+        assertEquals(5, ui.getAnimationIndex());
+
+        try { //Regression test for HARMONY-2699
+            new BasicProgressBarUI().setAnimationIndex(5);
+            fail("NullPointerException should have been thrown");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
     
     /**



Mime
View raw message