User: mnf999
Date: 02/02/27 10:56:11
Modified: src/main/org/jboss/system ServiceLibraries.java
Log:
Simple speed fix
Revision Changes Path
1.2 +25 -15 jboss-system/src/main/org/jboss/system/ServiceLibraries.java
Index: ServiceLibraries.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-system/src/main/org/jboss/system/ServiceLibraries.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ServiceLibraries.java 24 Feb 2002 10:24:34 -0000 1.1
+++ ServiceLibraries.java 27 Feb 2002 18:56:10 -0000 1.2
@@ -30,7 +30,7 @@
* @see <related>
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Ole Husgaard</a>
- * @version $Revision: 1.1 $ <p>
+ * @version $Revision: 1.2 $ <p>
*
* <p><b>20010830 marc fleury:</b>
* <ul>
@@ -48,6 +48,13 @@
* java.lang.Classloader implementation. Kudos to Dr. Christoph Jung
* and Sacha Labourey for identifying this problem.
* </ul>
+ * <p><b>20020227 marc fleury:</b>
+ * <ul>
+ * <li>Fixed bug in loadClass implementation that would iterate through CL
+ * even if local CL found the class
+ * </ul>
+ *
+ * @todo: track automate dependencies through UCL loading
*/
public class ServiceLibraries
implements ServiceLibrariesMBean, MBeanRegistration
@@ -357,24 +364,27 @@
}
}
- Iterator allLoaders = classLoaders2.iterator();
- while (allLoaders.hasNext() && (foundClass == null))
+ if (foundClass == null)
{
- // next!
- cl = (UnifiedClassLoader)allLoaders.next();
-
- if (!scl.equals(cl))
+ Iterator allLoaders = classLoaders2.iterator();
+ while (allLoaders.hasNext() && (foundClass == null))
{
- try
- {
- foundClass = cl.loadClassLocally(name, resolve);
- }
- catch (ClassNotFoundException ignored2)
+ // next!
+ cl = (UnifiedClassLoader)allLoaders.next();
+
+ if (!scl.equals(cl))
{
- //try next loader
+ try
+ {
+ foundClass = cl.loadClassLocally(name, resolve);
+ }
+ catch (ClassNotFoundException ignored2)
+ {
+ //try next loader
+ }
}
- }
- } //allLoaders
+ } //allLoaders
+ }
if (foundClass != null)
{
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development