diff options
author | aclement <aclement> | 2005-11-23 16:30:16 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-11-23 16:30:16 +0000 |
commit | 5cba2054c0bbfb4bdf2f00f044e841741055282c (patch) | |
tree | b27497f6572f0c84572fd4d6f124d683ab523825 /weaver5/java5-src | |
parent | a4caeb95261431c81f7beb0cddbff3b0865e614d (diff) | |
download | aspectj-5cba2054c0bbfb4bdf2f00f044e841741055282c.tar.gz aspectj-5cba2054c0bbfb4bdf2f00f044e841741055282c.zip |
some fixes for 117622
Diffstat (limited to 'weaver5/java5-src')
-rw-r--r-- | weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java b/weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java index c1f3c9fd4..47f4918cc 100644 --- a/weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java +++ b/weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java @@ -79,8 +79,9 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends public AnnotationX[] getAnnotations() { // AMC - we seem not to need to implement this method... - throw new UnsupportedOperationException("getAnnotations on Java15ReflectionBasedReferenceTypeDelegate is not implemented yet"); - //return super.getAnnotations(); + //throw new UnsupportedOperationException("getAnnotations on Java15ReflectionBasedReferenceTypeDelegate is not implemented yet"); + // FIXME is this the right implementation in the reflective case? + return super.getAnnotations(); } public ResolvedType[] getAnnotationTypes() { @@ -127,7 +128,7 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends } public ResolvedType getSuperclass() { - if (superclass == null) + if (superclass == null && getBaseClass()!=Object.class) // superclass of Object is null superclass = fromType(this.getBaseClass().getGenericSuperclass()); return superclass; } @@ -267,7 +268,24 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends private ResolvedType fromType(Type aType) { if (aType instanceof Class) { - return getWorld().resolve(((Class)aType).getName()); + Class clazz = (Class)aType; + String name = clazz.getName(); + /** + * getName() can return: + * + * 1. If this class object represents a reference type that is not an array type + * then the binary name of the class is returned + * 2. If this class object represents a primitive type or void, then the + * name returned is a String equal to the Java language keyword corresponding to the primitive type or void. + * 3. If this class object represents a class of arrays, then the internal form + * of the name consists of the name of the element type preceded by one or more '[' characters representing the depth of the array nesting. + */ + if (clazz.isArray()) { + UnresolvedType ut = UnresolvedType.forSignature(name); + return getWorld().resolve(ut); + } else { + return getWorld().resolve(name); + } } else if (aType instanceof ParameterizedType) { ParameterizedType pt = (ParameterizedType) aType; ResolvedType baseType = fromType(pt.getRawType()); |