harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496242 - in /harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/image/ColorModel.java test/api/java/common/java/awt/image/ColorModelTest.java
Date Mon, 15 Jan 2007 06:51:42 GMT
Author: hindessm
Date: Sun Jan 14 22:51:41 2007
New Revision: 496242

URL: http://svn.apache.org/viewvc?view=rev&rev=496242
Log:
Applying patches from "[#HARMONY-2794]
[classlib][awt]java.awt.image.IndexColorModel.getNormalizedComponents
throws ArrayIndexOutOfBoundsException on Harmony while it does not on RI".

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

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ColorModel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ColorModel.java?view=diff&rev=496242&r1=496241&r2=496242
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ColorModel.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ColorModel.java
Sun Jan 14 22:51:41 2007
@@ -265,7 +265,7 @@
         }
 
         if (normComponents == null) {
-            normComponents = new float[numComponents + offset];
+            normComponents = new float[numComponents + normOffset];
         }
 
         if (hasAlpha && isAlphaPremultiplied) {

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/ColorModelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/ColorModelTest.java?view=diff&rev=496242&r1=496241&r2=496242
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/ColorModelTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/ColorModelTest.java
Sun Jan 14 22:51:41 2007
@@ -36,4 +36,12 @@
             // expected
         }
     }
+
+    // Regression test for JIRA HARMONY-2794
+    public void testNormOffset() {
+        IndexColorModel obj = new IndexColorModel(1, 1, new byte[] { 1, 1, 1 },
+                0, false);
+        obj.getNormalizedComponents(new int[] { 1, -23, 5, 67, 89, 0 }, 1,
+                null, 1002);
+    }
 }



Mime
View raw message