struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musa...@apache.org
Subject svn commit: r766104 - /struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
Date Fri, 17 Apr 2009 18:03:05 GMT
Author: musachy
Date: Fri Apr 17 18:03:05 2009
New Revision: 766104

URL: http://svn.apache.org/viewvc?rev=766104&view=rev
Log:
WW-308 PackageBasedActionConfigBuilder.buildUrlSet() does not find actions when ReloadingClassLoader
is used

Patch from Lukasz Racon

Modified:
    struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java

Modified: struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java?rev=766104&r1=766103&r2=766104&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
(original)
+++ struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
Fri Apr 17 18:03:05 2009
@@ -357,8 +357,14 @@
         UrlSet urlSet = new UrlSet(classLoaderInterface);
 
         //exclude parent of classloaders
-        if (classLoaderInterface.getParent() != null)
-            urlSet = urlSet.exclude(classLoaderInterface.getParent());
+        ClassLoaderInterface parent = classLoaderInterface.getParent();
+        //if reload is enabled, we need to step up one level, otherwise the UrlSet will be
empty
+        //this happens because the parent of the realoding class loader is the web app classloader
+        if (parent != null && isReloadEnabled())
+            parent = parent.getParent();
+        
+        if (parent != null)
+            urlSet = urlSet.exclude(parent);
 
         urlSet = urlSet.exclude(new ClassLoaderInterfaceDelegate(ClassLoader.getSystemClassLoader().getParent()));
         urlSet = urlSet.excludeJavaExtDirs();



Mime
View raw message