harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r550798 - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/beancontext/BeanContextSupport.java test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
Date Tue, 26 Jun 2007 13:07:28 GMT
Author: leoli
Date: Tue Jun 26 06:07:27 2007
New Revision: 550798

URL: http://svn.apache.org/viewvc?view=rev&rev=550798
Log:
Apply patch and unit test from HARMONY-4285([classlib][beans]java.beans.beancontext.BeanContextSupport.getResource
throws NullPointerException)

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java?view=diff&rev=550798&r1=550797&r2=550798
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
Tue Jun 26 06:07:27 2007
@@ -699,7 +699,7 @@
             throw new IllegalArgumentException("Not a child of this context");
         }
 
-        return getClass().getClassLoader().getResource(resourceName);
+        return ClassLoader.getSystemResource(resourceName);
     }
 
     /* (non-Javadoc)
@@ -714,7 +714,7 @@
             throw new IllegalArgumentException("Not a child of this context");
         }
 
-        return getClass().getClassLoader().getResourceAsStream(resourceName);
+        return ClassLoader.getSystemResourceAsStream(resourceName);
     }
 
     /**

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java?view=diff&rev=550798&r1=550797&r2=550798
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
Tue Jun 26 06:07:27 2007
@@ -1165,6 +1165,11 @@
         final String RESOURCE_NAME = "org/apache/harmony/beans/tests/support/beancontext/mock/mockdata.txt";
         URL url = support.getResource(RESOURCE_NAME, child);
         assertTrue(url.toString().endsWith(RESOURCE_NAME));
+        
+        BeanContextSupport beanContextSupport = new BeanContextSupport();
+        beanContextSupport.add(child);
+        url = beanContextSupport.getResource(RESOURCE_NAME, child);
+        assertTrue(url.toString().endsWith(RESOURCE_NAME));
     }
 
     public void testGetResourceAsStream_NullParam() {



Mime
View raw message