[jboss-cvs] JBossAS SVN: r104808 - projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 14 13:45:53 EDT 2010


Author: kabir.khan at jboss.com
Date: 2010-05-14 13:45:53 -0400 (Fri, 14 May 2010)
New Revision: 104808

Modified:
   projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/NonDelegatingClassPool.java
Log:
[CLASSPOOL-9] Optimize plainParentGet() to avoid NotFoundExceptions

Modified: projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/NonDelegatingClassPool.java
===================================================================
--- projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/NonDelegatingClassPool.java	2010-05-14 17:39:43 UTC (rev 104807)
+++ projects/jboss-classpool/trunk/classpool/src/main/java/org/jboss/classpool/plugins/NonDelegatingClassPool.java	2010-05-14 17:45:53 UTC (rev 104808)
@@ -26,7 +26,6 @@
 import javassist.ClassPool;
 import javassist.CtClass;
 import javassist.NotFoundException;
-import javassist.bytecode.Descriptor;
 
 import org.jboss.classpool.base.BaseClassPool;
 import org.jboss.classpool.scoped.ScopedClassPoolRepository;
@@ -105,8 +104,6 @@
    
    private CtClass plainParentGet(String classname)
    {
-      String real = classname;
-
       try
       {
          if (parentWhitelist.contains(classname))
@@ -122,33 +119,17 @@
       if (parentBlacklist.contains(classname))
          return null;
 
-      // accept "[L<class name>;" as a class name.
-      if (classname.charAt(0) == '[')
-          real = Descriptor.toClassName(real);
-      if (real.endsWith("[]"))
-          real = classname.substring(0, real.indexOf('['));
-
       try
       {
-         if (parent.find(classname) != null)
-         {
-            CtClass clazz = parent.get(real);
-            parentWhitelist.add(real);
-            if (real != classname)
-               parentWhitelist.add(real);
-            return clazz;
-         }
+         CtClass clazz = parent.get(classname);
+         parentWhitelist.add(classname);
+         return clazz;
       }
       catch (NotFoundException e)
       {
-         //This should not happen
-         logger.warn(classname + " not loaded from parent despite having been found");
+         parentBlacklist.add(classname);
       }
       
-      parentBlacklist.add(real);
-      if (real != classname)
-         parentBlacklist.add(classname);
-
       return null;
    }
 




More information about the jboss-cvs-commits mailing list