diff options
Diffstat (limited to 'aspectj5rt')
-rw-r--r-- | aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/DeclareSoftImpl.java | 5 | ||||
-rw-r--r-- | aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/StringToType.java | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/DeclareSoftImpl.java b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/DeclareSoftImpl.java index c980cdf8f..4c8ea4ead 100644 --- a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/DeclareSoftImpl.java +++ b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/DeclareSoftImpl.java @@ -28,11 +28,12 @@ public class DeclareSoftImpl implements DeclareSoft { private String missingTypeName; - public DeclareSoftImpl(AjType declaringType, String pcut, String exceptionTypeName) { + public DeclareSoftImpl(AjType<?> declaringType, String pcut, String exceptionTypeName) { this.declaringType = declaringType; this.pointcut = new PointcutExpressionImpl(pcut); try { - this.exceptionType = AjTypeSystem.getAjType(Class.forName(exceptionTypeName)); + ClassLoader cl = declaringType.getJavaClass().getClassLoader(); + this.exceptionType = AjTypeSystem.getAjType(Class.forName(exceptionTypeName,false,cl)); } catch (ClassNotFoundException ex) { this.missingTypeName = exceptionTypeName; } diff --git a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/StringToType.java b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/StringToType.java index 7cf35ffb7..06201c559 100644 --- a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/StringToType.java +++ b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/StringToType.java @@ -40,7 +40,7 @@ public class StringToType { throws ClassNotFoundException { try { if (typeName.indexOf("<") == -1) { - return AjTypeSystem.getAjType(Class.forName(typeName)); + return AjTypeSystem.getAjType(Class.forName(typeName,false,classScope.getClassLoader())); } else { return makeParameterizedType(typeName,classScope); } @@ -60,7 +60,7 @@ public class StringToType { throws ClassNotFoundException { int paramStart = typeName.indexOf('<'); String baseName = typeName.substring(0, paramStart); - final Class baseClass = Class.forName(baseName); + final Class baseClass = Class.forName(baseName,false,classScope.getClassLoader()); int paramEnd = typeName.lastIndexOf('>'); String params = typeName.substring(paramStart+1,paramEnd); final Type[] typeParams = commaSeparatedListToTypeArray(params,classScope); |