summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2006-06-05 08:45:33 +0000
committeraclement <aclement>2006-06-05 08:45:33 +0000
commitd1dbf827ea64012890fd2de97d684722f81f3226 (patch)
tree7625b5947128e54fa209be978a54e9588a54f71e
parentf821ca3dae5681758d23a2a0531d0d42f017152e (diff)
downloadaspectj-d1dbf827ea64012890fd2de97d684722f81f3226.tar.gz
aspectj-d1dbf827ea64012890fd2de97d684722f81f3226.zip
use a loader that can find the reflection delegate.
-rw-r--r--weaver/src/org/aspectj/weaver/ltw/LTWWorld.java2
-rw-r--r--weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateFactory.java5
2 files changed, 3 insertions, 4 deletions
diff --git a/weaver/src/org/aspectj/weaver/ltw/LTWWorld.java b/weaver/src/org/aspectj/weaver/ltw/LTWWorld.java
index 2a9db1024..901c9e4ba 100644
--- a/weaver/src/org/aspectj/weaver/ltw/LTWWorld.java
+++ b/weaver/src/org/aspectj/weaver/ltw/LTWWorld.java
@@ -105,7 +105,7 @@ public class LTWWorld extends BcelWorld implements IReflectionWorld {
if (fc=='j' || fc=='c' || fc=='o' || fc=='s') { // cheaper than imminent string startsWith tests
if (name.startsWith("java") || name.startsWith("com.sun.") || name.startsWith("org.w3c") ||
name.startsWith("sun.") || name.startsWith("org.omg")) {
- ReferenceTypeDelegate bootstrapLoaderDelegate = resolveReflectionTypeDelegate(ty, null);
+ ReferenceTypeDelegate bootstrapLoaderDelegate = resolveReflectionTypeDelegate(ty, loader);
if (bootstrapLoaderDelegate != null) {
// it's always fine to load these bytes: there's no weaving into them
// and since the class isn't initialized, all we are doing at this point is loading the bytes
diff --git a/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateFactory.java b/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateFactory.java
index ab0c2eb6a..55bbab823 100644
--- a/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateFactory.java
+++ b/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateFactory.java
@@ -51,13 +51,12 @@ public class ReflectionBasedReferenceTypeDelegateFactory {
// can return 'null' if we can't find the class
private static ReflectionBasedReferenceTypeDelegate create15Delegate(ReferenceType forReferenceType, Class forClass, ClassLoader usingClassLoader, World inWorld) {
try {
- Class delegateClass = Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate");//,false,usingClassLoader);//ReflectionBasedReferenceTypeDelegate.class.getClassLoader());
+ Class delegateClass = Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate",true,usingClassLoader);//,false,usingClassLoader);//ReflectionBasedReferenceTypeDelegate.class.getClassLoader());
ReflectionBasedReferenceTypeDelegate ret = (ReflectionBasedReferenceTypeDelegate) delegateClass.newInstance();
ret.initialize(forReferenceType,forClass,usingClassLoader,inWorld);
return ret;
} catch (ClassNotFoundException cnfEx) {
- return null;
- //throw new IllegalStateException("Attempted to create Java 1.5 reflection based delegate but org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate was not found on classpath");
+ throw new IllegalStateException("Attempted to create Java 1.5 reflection based delegate but org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate was not found on classpath");
} catch (InstantiationException insEx) {
throw new IllegalStateException("Attempted to create Java 1.5 reflection based delegate but InstantiationException: " + insEx + " occured");
} catch (IllegalAccessException illAccEx) {