harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r556590 - in /harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/image/BufferedImage.java test/api/java/common/java/awt/image/BufferedImageTest.java
Date Mon, 16 Jul 2007 11:18:15 GMT
Author: apetrenko
Date: Mon Jul 16 04:18:14 2007
New Revision: 556590

URL: http://svn.apache.org/viewvc?view=rev&rev=556590
Log:
Patch for HARMONY-1658 "[class][awt] BufferedImage.isTileWritable(int,int) throws IllegalArgumentException
while Harmony throws ArrayIndexOutOfBoundsException"

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

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/BufferedImage.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/BufferedImage.java?view=diff&rev=556590&r1=556589&r2=556590
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/BufferedImage.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/BufferedImage.java
Mon Jul 16 04:18:14 2007
@@ -596,7 +596,7 @@
             return true;
         }
         // awt.226=Both tileX and tileY are not equal to 0
-        throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.226")); //$NON-NLS-1$
+        throw new IllegalArgumentException(Messages.getString("awt.226")); //$NON-NLS-1$
     }
 
     public void releaseWritableTile(int tileX, int tileY) {

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java?view=diff&rev=556590&r1=556589&r2=556590
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java
Mon Jul 16 04:18:14 2007
@@ -28,12 +28,14 @@
     
     public final void testGetWritableTile(){
         BufferedImage bi = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
-        WritableRaster tile = null;
-        try{
-            tile = bi.getWritableTile(1, 1);
-            assertTrue(true);
-        }catch(ArrayIndexOutOfBoundsException e){
-            fail("Unexpected ArrayIndexOutOfBoundsException was thrown");
+        bi.getWritableTile(1, 1);
+        
+        //Regression test for HARMONY-1658
+        BufferedImage img = new BufferedImage(10, 16, BufferedImage.TYPE_4BYTE_ABGR);
+        try {
+            img.isTileWritable(1,1);
+            fail("IllegalArgumentException is expected");
+        } catch (IllegalArgumentException iae) {
         }
     }
 



Mime
View raw message