aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-10-28 08:25:47 +0000
committeracolyer <acolyer>2005-10-28 08:25:47 +0000
commit8d479b227be4f8228265f37589b565b78f84d523 (patch)
treebd75c9fbaf132c9958206f81a8ffe29b19fdec6a /weaver
parent3ad7a2ca28b78973741db19ba78c60f6feb81f43 (diff)
downloadaspectj-8d479b227be4f8228265f37589b565b78f84d523.tar.gz
aspectj-8d479b227be4f8228265f37589b565b78f84d523.zip
hopefully the last of the array gremlins in the reflection based world...
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateFactory.java24
-rw-r--r--weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java4
2 files changed, 16 insertions, 12 deletions
diff --git a/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateFactory.java b/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateFactory.java
index 619e5099a..a59d4796e 100644
--- a/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateFactory.java
+++ b/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateFactory.java
@@ -80,9 +80,9 @@ public class ReflectionBasedReferenceTypeDelegateFactory {
public static ResolvedMember createResolvedMethod(Method aMethod, World inWorld) {
ReflectionBasedResolvedMemberImpl ret = new ReflectionBasedResolvedMemberImpl(org.aspectj.weaver.Member.METHOD,
- inWorld.resolve(aMethod.getDeclaringClass().getName()),
+ toResolvedType(aMethod.getDeclaringClass(),(ReflectionWorld)inWorld),
aMethod.getModifiers(),
- inWorld.resolve(aMethod.getReturnType().getName()),
+ toResolvedType(aMethod.getReturnType(),(ReflectionWorld)inWorld),
aMethod.getName(),
toResolvedTypeArray(aMethod.getParameterTypes(),inWorld),
toResolvedTypeArray(aMethod.getExceptionTypes(),inWorld),
@@ -93,9 +93,9 @@ public class ReflectionBasedReferenceTypeDelegateFactory {
public static ResolvedMember createResolvedAdviceMember(Method aMethod, World inWorld) {
return new ReflectionBasedResolvedMemberImpl(org.aspectj.weaver.Member.ADVICE,
- inWorld.resolve(aMethod.getDeclaringClass().getName()),
+ toResolvedType(aMethod.getDeclaringClass(),(ReflectionWorld)inWorld),
aMethod.getModifiers(),
- inWorld.resolve(aMethod.getReturnType().getName()),
+ toResolvedType(aMethod.getReturnType(),(ReflectionWorld)inWorld),
aMethod.getName(),
toResolvedTypeArray(aMethod.getParameterTypes(),inWorld),
toResolvedTypeArray(aMethod.getExceptionTypes(),inWorld),
@@ -105,7 +105,7 @@ public class ReflectionBasedReferenceTypeDelegateFactory {
public static ResolvedMember createStaticInitMember(Class forType, World inWorld) {
return new ResolvedMemberImpl(org.aspectj.weaver.Member.STATIC_INITIALIZATION,
- inWorld.resolve(forType.getName()),
+ toResolvedType(forType,(ReflectionWorld)inWorld),
Modifier.STATIC,
ResolvedType.VOID,
"<clinit>",
@@ -116,9 +116,9 @@ public class ReflectionBasedReferenceTypeDelegateFactory {
public static ResolvedMember createResolvedConstructor(Constructor aConstructor, World inWorld) {
return new ReflectionBasedResolvedMemberImpl(org.aspectj.weaver.Member.CONSTRUCTOR,
- inWorld.resolve(aConstructor.getDeclaringClass().getName()),
+ toResolvedType(aConstructor.getDeclaringClass(),(ReflectionWorld)inWorld),
aConstructor.getModifiers(),
- inWorld.resolve(aConstructor.getDeclaringClass().getName()),
+ toResolvedType(aConstructor.getDeclaringClass(),(ReflectionWorld)inWorld),
"init",
toResolvedTypeArray(aConstructor.getParameterTypes(),inWorld),
toResolvedTypeArray(aConstructor.getExceptionTypes(),inWorld),
@@ -128,9 +128,9 @@ public class ReflectionBasedReferenceTypeDelegateFactory {
public static ResolvedMember createResolvedField(Field aField, World inWorld) {
return new ReflectionBasedResolvedMemberImpl(org.aspectj.weaver.Member.FIELD,
- inWorld.resolve(aField.getDeclaringClass().getName()),
+ toResolvedType(aField.getDeclaringClass(),(ReflectionWorld)inWorld),
aField.getModifiers(),
- inWorld.resolve(aField.getType().getName()),
+ toResolvedType(aField.getType(),(ReflectionWorld)inWorld),
aField.getName(),
new UnresolvedType[0],
aField);
@@ -139,11 +139,15 @@ public class ReflectionBasedReferenceTypeDelegateFactory {
public static ResolvedMember createHandlerMember(Class exceptionType, Class inType,World inWorld) {
return new ResolvedMemberImpl(
org.aspectj.weaver.Member.HANDLER,
- inWorld.resolve(inType.getName()),
+ toResolvedType(inType,(ReflectionWorld)inWorld),
Modifier.STATIC,
"<catch>",
"(" + inWorld.resolve(exceptionType.getName()).getSignature() + ")V");
}
+
+ private static ResolvedType toResolvedType(Class aClass, ReflectionWorld aWorld) {
+ return aWorld.resolve(aClass);
+ }
private static ResolvedType[] toResolvedTypeArray(Class[] classes, World inWorld) {
ResolvedType[] ret = new ResolvedType[classes.length];
diff --git a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java
index 662d9beb2..ba7f9441d 100644
--- a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java
+++ b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionWorldTest.java
@@ -27,9 +27,9 @@ public class ReflectionWorldTest extends TestCase {
}
public void testArrayTypes() {
- World world = new ReflectionWorld();
+ ReflectionWorld world = new ReflectionWorld();
String[] strArray = new String[1];
- ResolvedType rt = world.resolve(UnresolvedType.forSignature(strArray.getClass().getName()));
+ ResolvedType rt = world.resolve(strArray.getClass());
assertTrue(rt.isArray());
}