|
|
@@ -49,17 +49,16 @@ public class ReflectionBasedReferenceTypeDelegateFactory { |
|
|
|
|
|
|
|
private static ReflectionBasedReferenceTypeDelegate create15Delegate(ReferenceType forReferenceType, Class forClass, ClassLoader usingClassLoader, World inWorld) { |
|
|
|
try { |
|
|
|
// important that we use *our own* classloader for the next call... |
|
|
|
Class delegateClass = Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate",false,ReflectionBasedReferenceTypeDelegate.class.getClassLoader()); |
|
|
|
Class delegateClass = Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate",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"); |
|
|
|
} catch (InstantiationException insEx) { |
|
|
|
return null; |
|
|
|
throw new IllegalStateException("Attempted to create Java 1.5 reflection based delegate but InstantiationException: " + insEx + " occured"); |
|
|
|
} catch (IllegalAccessException illAccEx) { |
|
|
|
return null; |
|
|
|
throw new IllegalStateException("Attempted to create Java 1.5 reflection based delegate but IllegalAccessException: " + illAccEx + " occured"); |
|
|
|
} |
|
|
|
} |
|
|
|
|