[jboss-cvs] JBossAS SVN: r93739 - projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Sep 18 11:00:59 EDT 2009


Author: alesj
Date: 2009-09-18 11:00:58 -0400 (Fri, 18 Sep 2009)
New Revision: 93739

Modified:
   projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/Module.java
Log:
Match the latest 2.0.x version.

Modified: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/Module.java
===================================================================
--- projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/Module.java	2009-09-18 14:43:47 UTC (rev 93738)
+++ projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/Module.java	2009-09-18 15:00:58 UTC (rev 93739)
@@ -371,7 +371,7 @@
     * @return the module or null if the classloader does not correspond to a registered module classloader
     * @throws SecurityException if the caller doesn't have <code>new RuntimePermision("getClassLoader")</code>
     */
-   public static Module getModuleForClassLoader(ClassLoader cl)
+   static Module getModuleForClassLoader(ClassLoader cl)
    {
       SecurityManager sm = System.getSecurityManager();
       if (sm != null)
@@ -953,23 +953,29 @@
          // TODO - we need a better way to cleanup
          Module otherModule = domain.getModule(iDependOn.toString());
          if (otherModule != null)
-         {
-            ControllerContext otherContext = otherModule.getControllerContext();
-            if (otherContext != null)
-            {
-               DependencyInfo otherDependencyInfo = otherContext.getDependencyInfo();
-               if (otherDependencyInfo != null)
-                  otherDependencyInfo.removeDependsOnMe(item);
-            }
-         }
+            otherModule.removeDependsOnMe(item);
       }
       
       // Remove the IDependOn part of this item
       DependencyInfo dependencyInfo = context.getDependencyInfo();
       dependencyInfo.removeIDependOn(item);
    }
-   
+
    /**
+    * Remove a dependency.
+    *
+    * @param item the dependency item.
+    */
+   protected void removeDependsOnMe(RequirementDependencyItem item)
+   {
+      if (context == null)
+         return;
+
+      DependencyInfo dependencyInfo = context.getDependencyInfo();
+      dependencyInfo.removeDependsOnMe(item);
+   }
+
+   /**
     * Resolve a requirement
     * 
     * @param dependency the dependency the dependency




More information about the jboss-cvs-commits mailing list