harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r554541 - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/SimpleBeanInfo.java test/java/org/apache/harmony/beans/tests/java/beans/SimpleBeanInfoTest.java
Date Mon, 09 Jul 2007 06:49:58 GMT
Author: pyang
Date: Sun Jul  8 23:49:57 2007
New Revision: 554541

URL: http://svn.apache.org/viewvc?view=rev&rev=554541
Log:
SimpleBeanInfo.loadImage(String) should return null on given null parameter

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SimpleBeanInfo.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/SimpleBeanInfoTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SimpleBeanInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SimpleBeanInfo.java?view=diff&rev=554541&r1=554540&r2=554541
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SimpleBeanInfo.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SimpleBeanInfo.java
Sun Jul  8 23:49:57 2007
@@ -26,6 +26,10 @@
     public SimpleBeanInfo() {}
 
     public Image loadImage(String resourceName) {
+        if (null == resourceName) {
+            return null;
+        }
+        
         URL file = getClass().getResource(resourceName);
         
         if (file != null) {

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/SimpleBeanInfoTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/SimpleBeanInfoTest.java?view=diff&rev=554541&r1=554540&r2=554541
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/SimpleBeanInfoTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/SimpleBeanInfoTest.java
Sun Jul  8 23:49:57 2007
@@ -91,6 +91,10 @@
         info = new SimpleBeanInfo() {};
         image = info.loadImage("testB.jpg");
         assertNotNull(image);
+        
+        info = new SimpleBeanInfo();
+        image = info.loadImage(null);
+        assertNull(image);
     }
 
 }



Mime
View raw message