You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2007/01/12 21:51:23 UTC

svn commit: r495734 - 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

Author: hindessm
Date: Fri Jan 12 12:51:22 2007
New Revision: 495734

URL: http://svn.apache.org/viewvc?view=rev&rev=495734
Log:
Applied patches from "[#HARMONY-2194] [classlib][awt] Harmony
BuffredImage.getWritableTile(int tileX, int tileY) throws unexpected
ArrayIndexOutOfBoundsException, but RI doesn't".

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=495734&r1=495733&r2=495734
==============================================================================
--- 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 Fri Jan 12 12:51:22 2007
@@ -446,11 +446,7 @@
     }
 
     public WritableRaster getWritableTile(int tileX, int tileY) {
-        if (tileX == 0 && tileY == 0) {
-            return raster;
-        }
-        // awt.226=Both tileX and tileY are not equal to 0
-        throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.226")); //$NON-NLS-1$
+        return raster;
     }
 
     public WritableRaster getRaster() {

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=495734&r1=495733&r2=495734
==============================================================================
--- 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 Fri Jan 12 12:51:22 2007
@@ -1,19 +1,3 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
 package java.awt.image;
 
 import java.awt.Image;
@@ -22,12 +6,42 @@
 import junit.framework.TestCase;
 
 public class BufferedImageTest extends TestCase {
+
+    public static void main(String[] args) {
+        junit.textui.TestRunner.run(BufferedImageTest.class);
+    }
+    /*
+     * @see TestCase#setUp()
+     */
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+    }
+
+    /**
+     * Constructor for BufferedImageTest.
+     * @param name
+     */
+    public BufferedImageTest(String name) {
+        super(name);
+    }
     
+    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");
+        }
+    }
+
     public void testGetProperty() {
         // Regression test HARMONY-1656
         BufferedImage img = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
-        assertEquals("Image.UndefinedProperty", Image.UndefinedProperty, img.getProperty("XXX"));
+        assertEquals("Image.UndefinedProperty",
+                     Image.UndefinedProperty, img.getProperty("XXX"));
     }
-    
-}
 
+}