Browse Source

fix for pr153572 LTWWorld with Annotation finding and boot classes

tags/post_pr_153572
acolyer 17 years ago
parent
commit
135173acd2

+ 11
- 2
bcel-builder/src/org/aspectj/apache/bcel/util/ClassLoaderRepository.java View File

@@ -59,6 +59,7 @@ import java.io.InputStream;
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Map;
import java.util.WeakHashMap;
@@ -75,11 +76,12 @@ import org.aspectj.apache.bcel.classfile.JavaClass;
*
* @see org.aspectj.apache.bcel.Repository
*
* @version $Id: ClassLoaderRepository.java,v 1.6 2006/08/08 11:26:28 aclement Exp $
* @version $Id: ClassLoaderRepository.java,v 1.7 2006/08/18 14:51:00 acolyer Exp $
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
* @author David Dixon-Peugh
*/
public class ClassLoaderRepository implements Repository {
private static java.lang.ClassLoader bootClassLoader = null;
private java.lang.ClassLoader loader;
private WeakHashMap /*<String classname,JavaClass>*/loadedClassesLocalCache = new WeakHashMap();
private static Map /*<URL,JavaClass>*/loadedUrlsSharedCache = new HashMap();
@@ -99,7 +101,14 @@ public class ClassLoaderRepository implements Repository {
}
public ClassLoaderRepository( java.lang.ClassLoader loader ) {
this.loader = loader;
this.loader = (loader != null) ? loader : getBootClassLoader();
}
private static synchronized java.lang.ClassLoader getBootClassLoader() {
if (bootClassLoader == null) {
bootClassLoader = new URLClassLoader(new URL[0]);
}
return bootClassLoader;
}

/**

BIN
lib/bcel/bcel-src.zip View File


BIN
lib/bcel/bcel.jar View File


+ 5
- 1
weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegate.java View File

@@ -15,6 +15,8 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Collection;
import java.util.Collections;

@@ -40,6 +42,8 @@ import org.aspectj.weaver.patterns.PerClause;
*/
public class ReflectionBasedReferenceTypeDelegate implements ReferenceTypeDelegate {

private static final ClassLoader BootClassLoader = new URLClassLoader(new URL[0]);
protected Class myClass = null;
protected ClassLoader classLoader = null;
private World world;
@@ -59,7 +63,7 @@ public class ReflectionBasedReferenceTypeDelegate implements ReferenceTypeDelega
this.myClass = aClass;
this.resolvedType = aType;
this.world = aWorld;
this.classLoader = aClassLoader;
this.classLoader = (aClassLoader != null) ? aClassLoader : BootClassLoader;
}
protected Class getBaseClass() {

+ 1
- 1
weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java View File

@@ -63,7 +63,7 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends
myType = AjTypeSystem.getAjType(aClass);
annotationFinder = new Java15AnnotationFinder();
argNameFinder = annotationFinder;
annotationFinder.setClassLoader(classLoader);
annotationFinder.setClassLoader(this.classLoader);
this.typeConverter = new JavaLangTypeToResolvedTypeConverter(aWorld);
}

Loading…
Cancel
Save