[jboss-cvs] JBossAS SVN: r82528 - in projects/aop/trunk: asintegration-mc/src/main/org/jboss/aop/classpool/jbosscl and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 23 09:23:13 EST 2008
Author: kabir.khan at jboss.com
Date: 2008-12-23 09:23:13 -0500 (Tue, 23 Dec 2008)
New Revision: 82528
Modified:
projects/aop/trunk/asintegration-core/src/main/org/jboss/aop/classpool/AbstractClassPoolDomain.java
projects/aop/trunk/asintegration-mc/src/main/org/jboss/aop/classpool/jbosscl/JBossClClassPoolFactory.java
projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassPoolWithRepositoryTestCase.java
Log:
[JBAOP-666] Tidyup
Modified: projects/aop/trunk/asintegration-core/src/main/org/jboss/aop/classpool/AbstractClassPoolDomain.java
===================================================================
--- projects/aop/trunk/asintegration-core/src/main/org/jboss/aop/classpool/AbstractClassPoolDomain.java 2008-12-23 14:17:50 UTC (rev 82527)
+++ projects/aop/trunk/asintegration-core/src/main/org/jboss/aop/classpool/AbstractClassPoolDomain.java 2008-12-23 14:23:13 UTC (rev 82528)
@@ -55,6 +55,33 @@
return getCachedOrCreate(parentPool, classname, create);
}
}
+
+ protected CtClass getCachedOrCreate(BaseClassPool parentPool, String classname, boolean create)
+ {
+ if (parentPool == null)
+ {
+ return null;
+ }
+
+ CtClass clazz = null;
+ if (!parentPool.childFirstLookup)
+ {
+ clazz = getCachedOrCreateFromPoolParent(parentPool, classname, create);
+ }
+
+ //We can use the exposed methods directly to avoid the overhead of NotFoundException
+ clazz = parentPool.getCached(classname);
+ if (clazz == null && create)
+ {
+ clazz = parentPool.createCtClass(classname, true);
+ }
+
+ if (clazz == null && !parentPool.childFirstLookup)
+ {
+ clazz = getCachedOrCreateFromPoolParent(parentPool, classname, create);
+ }
+ return clazz;
+ }
protected CtClass getCachedOrCreate(ClassPool parentPool, String classname, boolean create)
{
@@ -68,4 +95,5 @@
return null;
}
}
+
}
Modified: projects/aop/trunk/asintegration-mc/src/main/org/jboss/aop/classpool/jbosscl/JBossClClassPoolFactory.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/main/org/jboss/aop/classpool/jbosscl/JBossClClassPoolFactory.java 2008-12-23 14:17:50 UTC (rev 82527)
+++ projects/aop/trunk/asintegration-mc/src/main/org/jboss/aop/classpool/jbosscl/JBossClClassPoolFactory.java 2008-12-23 14:23:13 UTC (rev 82528)
@@ -21,8 +21,6 @@
*/
package org.jboss.aop.classpool.jbosscl;
-import java.net.URL;
-
import javassist.ClassPool;
import javassist.scopedpool.ScopedClassPool;
import javassist.scopedpool.ScopedClassPoolFactory;
@@ -106,15 +104,6 @@
return poolDomain;
}
-
- private URL getTempURL(Module module)
- {
- if (module == null)
- return null;
-
- return module.getDynamicClassRoot();
- }
-
@Override
protected ClassPool getCreateParentClassPools(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository)
{
Modified: projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassPoolWithRepositoryTestCase.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassPoolWithRepositoryTestCase.java 2008-12-23 14:17:50 UTC (rev 82527)
+++ projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassPoolWithRepositoryTestCase.java 2008-12-23 14:23:13 UTC (rev 82528)
@@ -734,7 +734,5 @@
assertSame(strB.getClassPool(), strA.getClassPool());
assertNotSame(poolA, strA.getClassPool());
assertNotSame(poolB, strB.getClassPool());
- ClassPool def = ClassPool.getDefault();
- int i = 4;
}
}
More information about the jboss-cvs-commits
mailing list