harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r954563 - in /harmony/enhanced/java/trunk/classlib/modules/luni/src: main/java/java/net/URLClassLoader.java test/api/common/org/apache/harmony/luni/tests/java/net/URLClassLoaderTest.java
Date Mon, 14 Jun 2010 17:30:30 GMT
Author: tellison
Date: Mon Jun 14 17:30:29 2010
New Revision: 954563

URL: http://svn.apache.org/viewvc?rev=954563&view=rev
Log:
Apply patch for HARMONY-6510 ([classlib][luni] URLClassLoader.findResources(null) returns
null instead of an empty Enumeration)

Modified:
    harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/URLClassLoader.java
    harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLClassLoaderTest.java

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/URLClassLoader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/URLClassLoader.java?rev=954563&r1=954562&r2=954563&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/URLClassLoader.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/URLClassLoader.java
Mon Jun 14 17:30:29 2010
@@ -664,9 +664,6 @@ public class URLClassLoader extends Secu
      */
     @Override
     public Enumeration<URL> findResources(final String name) throws IOException {
-        if (name == null) {
-            return null;
-        }
         ArrayList<URL> result = AccessController.doPrivileged(
                 new PrivilegedAction<ArrayList<URL>>() {
                     public ArrayList<URL> run() {
@@ -694,6 +691,9 @@ public class URLClassLoader extends Secu
     }
 
     void findResourcesImpl(String name, ArrayList<URL> result) {
+        if (name == null) {
+            return;
+        }
         int n = 0;
         while (true) {
             URLHandler handler = getHandler(n++);

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLClassLoaderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLClassLoaderTest.java?rev=954563&r1=954562&r2=954563&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLClassLoaderTest.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLClassLoaderTest.java
Mon Jun 14 17:30:29 2010
@@ -138,6 +138,11 @@ public class URLClassLoaderTest extends 
                     resValues[i++], sb.toString());
         }
         assertEquals("Incorrect number of resources returned: " + i, 2, i);
+        
+        // Regression for HARMONY-6510
+        res = ucl.findResources(null);
+        assertNotNull(res);
+        assertFalse(res.hasMoreElements());
     }
 
     /**



Mime
View raw message