You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ap...@apache.org on 2006/12/21 12:34:56 UTC

svn commit: r489332 - 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: apetrenko
Date: Thu Dec 21 03:34:53 2006
New Revision: 489332

URL: http://svn.apache.org/viewvc?view=rev&rev=489332
Log:
Patch for HARMONY-1656 "[classlib][awt] BufferedImage.getProperty("XXX") returns null while RI returns Image.UndefinedProperty"

Added:
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java   (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/BufferedImage.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=489332&r1=489331&r2=489332
==============================================================================
--- 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 Thu Dec 21 03:34:53 2006
@@ -367,7 +367,7 @@
             throw new NullPointerException(Messages.getString("awt.225")); //$NON-NLS-1$
         }
         if (properties == null) {
-            return null;
+            return Image.UndefinedProperty;
         }
         Object property = properties.get(name);
         if (property == null) {

Added: 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=auto&rev=489332
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java (added)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java Thu Dec 21 03:34:53 2006
@@ -0,0 +1,33 @@
+/*
+ *  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;
+import java.awt.image.BufferedImage;
+
+import junit.framework.TestCase;
+
+public class BufferedImageTest extends TestCase {
+    
+    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"));
+    }
+    
+}
+

Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/image/BufferedImageTest.java
------------------------------------------------------------------------------
    svn:eol-style = native