[jboss-cvs] JBossAS SVN: r94873 - projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 14 11:16:26 EDT 2009
Author: flavia.rainone at jboss.com
Date: 2009-10-14 11:16:25 -0400 (Wed, 14 Oct 2009)
New Revision: 94873
Modified:
projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfo.java
projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfoFactoryImpl.java
Log:
[JBREFLECT-58] Corrected a few calls to ClassPoolFactory.getClassPoolForLoader, by adding a non-null classloader parameter.
Modified: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfo.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfo.java 2009-10-14 15:15:14 UTC (rev 94872)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfo.java 2009-10-14 15:16:25 UTC (rev 94873)
@@ -252,8 +252,7 @@
TypeInfo[] typeParams = new TypeInfo[parameters.length];
for(int i=0; i<parameters.length;i++)
{
- typeParams[i] = factory.getTypeInfo(parameters[i],
- JavassistTypeInfoFactoryImpl.getPoolFactory().getPoolForLoader(null).getClassLoader());
+ typeParams[i] = factory.getTypeInfo(parameters[i], ctClass.getClassPool().getClassLoader());
}
return getDeclaredConstructor(typeParams);
}
@@ -330,8 +329,7 @@
TypeInfo[] typeParams = new TypeInfo[parameters.length];
for(int i=0; i<parameters.length;i++)
{
- typeParams[i] = factory.getTypeInfo(parameters[i],
- JavassistTypeInfoFactoryImpl.getPoolFactory().getPoolForLoader(null).getClassLoader());
+ typeParams[i] = factory.getTypeInfo(parameters[i], ctClass.getClassPool().getClassLoader());
}
return getDeclaredMethod(methodName, typeParams);
}
Modified: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfoFactoryImpl.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfoFactoryImpl.java 2009-10-14 15:15:14 UTC (rev 94872)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfoFactoryImpl.java 2009-10-14 15:16:25 UTC (rev 94873)
@@ -141,7 +141,7 @@
{
try
{
- CtClass ctClass = getCtClass(clazz.getName());
+ CtClass ctClass = getCtClass(clazz.getName(), clazz.getClassLoader());
if (clazz.isArray())
{
@@ -414,22 +414,34 @@
}
/**
- * Get the CtClass
+ * Gets the CtClass corresponding to {@code name}.
*
- * @param name the name
+ * @param name the name of the CtClass to be retrieved
+ * @param classLoader the classLoader that loaded the corresponding Class<?> object
* @return the CtClass
*/
- protected CtClass getCtClass(String name)
+ protected CtClass getCtClass(String name, ClassLoader classLoader)
{
try
{
- return poolFactory.getPoolForLoader(null).get(name);
+ return poolFactory.getPoolForLoader(classLoader).get(name);
}
catch (NotFoundException e)
{
throw raiseClassNotFound(name, e);
}
}
+
+ /**
+ * Gets the CtClass corresponding to {@code name} by using the bootstrap class pool.
+ *
+ * @param name the name of the CtClass to be retrieved
+ * @return the CtClass
+ */
+ protected CtClass getCtClass(String name)
+ {
+ return getCtClass(name, null);
+ }
@Override
@SuppressWarnings("unchecked")
More information about the jboss-cvs-commits
mailing list