[jboss-cvs] JBossAS SVN: r67759 - trunk/jmx/src/main/org/jboss/mx/loading.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 3 01:42:22 EST 2007


Author: scott.stark at jboss.org
Date: 2007-12-03 01:42:22 -0500 (Mon, 03 Dec 2007)
New Revision: 67759

Modified:
   trunk/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java
Log:
Correct removal of dynamic class loader

Modified: trunk/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java
===================================================================
--- trunk/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java	2007-12-03 05:54:54 UTC (rev 67758)
+++ trunk/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java	2007-12-03 06:42:22 UTC (rev 67759)
@@ -26,6 +26,7 @@
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -958,12 +959,19 @@
             {
                Map.Entry entry = (Map.Entry) i.next();
                Set pkgSet = (Set) entry.getValue();
-               if(pkgSet.contains(cl) && pkgSet.size() > 1)
+               if(pkgSet.contains(cl))
                {
-                  Set<RepositoryClassLoader> newSet = ClassLoaderUtils.newPackageSet();
-                  newSet.addAll(pkgSet);
-                  newSet.remove(cl);
-                  packagesMap.put(entry.getKey(), newSet);
+                  if(pkgSet.size() > 1)
+                  {
+                     Set<RepositoryClassLoader> newSet = ClassLoaderUtils.newPackageSet();
+                     newSet.addAll(pkgSet);
+                     newSet.remove(cl);
+                     packagesMap.put(entry.getKey(), newSet);
+                  }
+                  else
+                  {
+                     pkgSet = Collections.emptySet();
+                  }
                }
                if (pkgSet.isEmpty())
                   i.remove();




More information about the jboss-cvs-commits mailing list