[jboss-cvs] JBossAS SVN: r76017 - projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Jul 19 17:18:57 EDT 2008


Author: alesj
Date: 2008-07-19 17:18:57 -0400 (Sat, 19 Jul 2008)
New Revision: 76017

Modified:
   projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSDeploymentClassLoaderPolicyModule.java
Log:
Fixing [JBDEPLOY-59], adding recursion in case parent is not yet determined, version #2.

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSDeploymentClassLoaderPolicyModule.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSDeploymentClassLoaderPolicyModule.java	2008-07-19 21:12:32 UTC (rev 76016)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSDeploymentClassLoaderPolicyModule.java	2008-07-19 21:18:57 UTC (rev 76017)
@@ -138,6 +138,10 @@
    @SuppressWarnings("unchecked")
    protected static Set<VirtualFile> determineClassPath(DeploymentUnit unit, Module module)
    {
+      Set<VirtualFile> classPath = unit.getAttachment(VFS_CLASS_PATH, Set.class);
+      if (classPath != null)
+         return classPath;
+
       ClassPathVisitor visitor = new ClassPathVisitor(unit);
       try
       {
@@ -147,17 +151,15 @@
       {
          throw new RuntimeException("Error visiting deployment: " + e);
       }
-      Set<VirtualFile> classPath = visitor.getClassPath();
+      classPath = visitor.getClassPath();
+
       // Weed out parent classpaths
       if (module != null && module.getParentDomainName() == null)
       {
          DeploymentUnit parent = unit.getParent();
          while (parent != null)
          {
-            Set<VirtualFile> parentClassPath = parent.getAttachment(VFS_CLASS_PATH, Set.class);
-            if (parentClassPath == null)
-               parentClassPath = determineClassPath(parent, parent.getAttachment(Module.class));
-
+            Set<VirtualFile> parentClassPath = determineClassPath(parent, parent.getAttachment(Module.class));
             if (parentClassPath != null && parentClassPath.isEmpty() == false)
             {
                if (log.isTraceEnabled())




More information about the jboss-cvs-commits mailing list