geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r562112 - /geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
Date Thu, 02 Aug 2007 14:05:48 GMT
Author: kevan
Date: Thu Aug  2 07:05:47 2007
New Revision: 562112

URL: http://svn.apache.org/viewvc?view=rev&rev=562112
Log:
GERONIMO-3369 Check for hidden resources before checking parent ClassLoaders

Modified:
    geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java

Modified: geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java?view=diff&rev=562112&r1=562111&r2=562112
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
Thu Aug  2 07:05:47 2007
@@ -586,51 +586,6 @@
         recursiveFind(knownClassloaders, enumerations, name);
 
         return new UnionEnumeration<URL>(enumerations);
-        /*
-             List<URL> resources = new ArrayList<URL>();
-             Set<URL> found = new HashSet<URL>();
-
-             //
-             // if we are using inverse class loading, add the resources from local urls
first
-             //
-             if (inverseClassLoading && !isDestroyed()) {
-                 for (Enumeration myResources = super.findResources(name); myResources.hasMoreElements();)
{
-                     URL url = (URL) myResources.nextElement();
-                     if (!found.contains(url)) {
-                         found.add(url);
-                         resources.add(url);
-                     }
-                 }
-             }
-
-             //
-             // Add parent resources
-             //
-             for (ClassLoader parent : parents) {
-                 for (Enumeration parentResources = parent.getResources(name); parentResources.hasMoreElements();)
{
-                     URL url = (URL) parentResources.nextElement();
-                     if (!found.contains(url)) {
-                         found.add(url);
-                         resources.add(url);
-                     }
-                 }
-             }
-
-             //
-             // if we are not using inverse class loading, add the resources from local urls
now
-             //
-             if (!inverseClassLoading && !isDestroyed()) {
-                 for (Enumeration myResources = super.findResources(name); myResources.hasMoreElements();)
{
-                     URL url = (URL) myResources.nextElement();
-                     if (!found.contains(url)) {
-                         found.add(url);
-                         resources.add(url);
-                     }
-                 }
-             }
-
-             return Collections.enumeration(resources);
-        */
     }
 
     protected void recursiveFind(Set<ClassLoader> knownClassloaders, List<Enumeration<URL>>
enumerations, String name) throws IOException {
@@ -638,16 +593,18 @@
             return;
         }
         knownClassloaders.add(this);
-        if (inverseClassLoading) {
+        if (inverseClassLoading && !isNonOverridableResource(name)) {
             enumerations.add(internalfindResources(name));
         }
-        for (ClassLoader parent : parents) {
-            if (parent instanceof MultiParentClassLoader) {
-                ((MultiParentClassLoader) parent).recursiveFind(knownClassloaders, enumerations,
name);
-            } else {
-                if (!knownClassloaders.contains(parent)) {
-                    enumerations.add(parent.getResources(name));
-                    knownClassloaders.add(parent);
+        if (!isHiddenResource(name)) {
+            for (ClassLoader parent : parents) {
+                if (parent instanceof MultiParentClassLoader) {
+                    ((MultiParentClassLoader) parent).recursiveFind(knownClassloaders, enumerations,
name);
+                } else {
+                    if (!knownClassloaders.contains(parent)) {
+                        enumerations.add(parent.getResources(name));
+                        knownClassloaders.add(parent);
+                    }
                 }
             }
         }



Mime
View raw message