harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496053 - in /harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/image/RescaleOp.java test/api/java/common/java/awt/image/RescaleOpTest.java
Date Sun, 14 Jan 2007 09:58:32 GMT
Author: hindessm
Date: Sun Jan 14 01:58:32 2007
New Revision: 496053

URL: http://svn.apache.org/viewvc?view=rev&rev=496053
Log:
Applying patches from "[#HARMONY-2691] [classlib][awt][compatibility]
java.awt.image.RescaleOp(float[] scaleFactors, float[] offsets,
RenderingHints hints) throws IllegalArgumentException if an array is
empty".  I modified the test slightly to let junit handle the exceptions.

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RescaleOp.java
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/RescaleOpTest.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RescaleOp.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RescaleOp.java?view=diff&rev=496053&r1=496052&r2=496053
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RescaleOp.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RescaleOp.java
Sun Jan 14 01:58:32 2007
@@ -45,11 +45,6 @@
     public RescaleOp(float[] scaleFactors, float[] offsets, RenderingHints hints) {
         int numFactors = Math.min(scaleFactors.length, offsets.length);
 
-        if (numFactors == 0) {
-            // awt.21C=The number of scale factors should not be zero 
-            throw new IllegalArgumentException(Messages.getString("awt.21C")); //$NON-NLS-1$
-        }
-
         this.scaleFactors = new float[numFactors];
         this.offsets = new float[numFactors];
 

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/RescaleOpTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/RescaleOpTest.java?view=diff&rev=496053&r1=496052&r2=496053
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/RescaleOpTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/RescaleOpTest.java
Sun Jan 14 01:58:32 2007
@@ -21,6 +21,15 @@
 import junit.framework.TestCase;
 
 public class RescaleOpTest extends TestCase {
+    // Regression test for HARMONY-2691
+    public void testRescaleOp() throws IllegalArgumentException {
+        new RescaleOp(new float[] {}, new float[] {0.75F}, null);
+    }
+    // Regression test for HARMONY-2691
+    public void testRescaleOp2() throws IllegalArgumentException {
+        new RescaleOp(new float[] {0.75F}, new float[] {}, null);
+    }
+
     // A regression test for harmony-2689
     public void test_getOffsetsNullLength()
     {



Mime
View raw message