harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r495201 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/DefaultBoundedRangeModel.java test/api/java/common/javax/swing/DefaultBoundedRangeModel2Test.java
Date Thu, 11 Jan 2007 11:45:04 GMT
Author: odeakin
Date: Thu Jan 11 03:45:03 2007
New Revision: 495201

URL: http://svn.apache.org/viewvc?view=rev&rev=495201
Log:
Apply patch HARMONY-2621 ([classlib][swing] DefaultBoundedRangeModel(Integer.MAX_VALUE,1,2,4)
expected IAE)

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModel2Test.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java?view=diff&rev=495201&r1=495200&r2=495201
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java
Thu Jan 11 03:45:03 2007
@@ -56,7 +56,7 @@
     }
 
     public DefaultBoundedRangeModel(int value, int extent, int min, int max) {
-        if (extent < 0 || min > value || value + extent > max) {
+        if (min > value || value > value + extent || value + extent > max) {
             throw new IllegalArgumentException("invalid range properties");
         }
         this.min = min;

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModel2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModel2Test.java?view=diff&rev=495201&r1=495200&r2=495201
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModel2Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModel2Test.java
Thu Jan 11 03:45:03 2007
@@ -156,6 +156,12 @@
                 new DefaultBoundedRangeModel(1, -1, 1, 2);
             }
         });
+        testExceptionalCase(new IllegalArgumentCase() {
+            @Override // Regression test for HARMONY-2621
+            public void exceptionalAction() throws Exception {
+                new DefaultBoundedRangeModel(Integer.MAX_VALUE,1,2,4);
+            }
+        });
     }
 
     public void testFireStateChanged() {
@@ -329,4 +335,4 @@
         ChangeListener listeners[] = brm1.getChangeListeners();
         assertEquals(0, listeners.length);
     }
-}
\ No newline at end of file
+}



Mime
View raw message