diff options
author | Andy Clement <andrew.clement@gmail.com> | 2013-04-25 13:45:39 -0700 |
---|---|---|
committer | Andy Clement <andrew.clement@gmail.com> | 2013-04-25 13:45:39 -0700 |
commit | 6afb281ef0a0f0afcfcf0c77d6b6ebcead15c363 (patch) | |
tree | 6cb45d6a764b362497e21ae885e9c3109112b4e0 /org.aspectj.matcher/src | |
parent | 4855f74db6aa5b9ebf4c0e19bb36614929ab3175 (diff) | |
download | aspectj-6afb281ef0a0f0afcfcf0c77d6b6ebcead15c363.tar.gz aspectj-6afb281ef0a0f0afcfcf0c77d6b6ebcead15c363.zip |
405016: class literals in annotation matching
Diffstat (limited to 'org.aspectj.matcher/src')
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java index c08073580..984b4ee4c 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java @@ -201,7 +201,7 @@ public class WildAnnotationTypePattern extends AnnotationTypePattern { } } else if (t.equals(ResolvedType.JL_STRING)) { // nothing to do, it will be OK - } else if (t.equals(ResolvedType.JL_CLASS)) { + } else if (t.equals(ResolvedType.JL_CLASS) || (t.isParameterizedOrGenericType() && t.getRawType().equals(ResolvedType.JL_CLASS))) { String typename = v.substring(0, v.lastIndexOf('.')); // strip off '.class' ResolvedType rt = scope.lookupType(typename, this).resolve(scope.getWorld()); if (rt.isMissing()) { @@ -227,6 +227,17 @@ public class WildAnnotationTypePattern extends AnnotationTypePattern { } replacementValues.put(k, rt.getSignature()); break; +// } else if (t.isArray()) { + // Looks like {} aren't pseudotokens in the parser so they don't get through for our pointcut parser +// // @Foo(value=[Foo.class]) +// String typename = v.substring(0, v.lastIndexOf('.')); // strip off '.class' +// ResolvedType rt = scope.lookupType(typename, this).resolve(scope.getWorld()); +// if (rt.isMissing()) { +// IMessage m = MessageUtil.error("Unable to resolve type '" + v + "' specified for value '" + k + "'", +// getSourceLocation()); +// scope.getWorld().getMessageHandler().handleMessage(m); +// } +// replacementValues.put(k, rt.getSignature()); } else { scope.message(MessageUtil.error(WeaverMessages.format(WeaverMessages.UNSUPPORTED_ANNOTATION_VALUE_TYPE,t), getSourceLocation())); replacementValues.put(k,""); |