]> source.dussan.org Git - aspectj.git/commitdiff
314695
authoraclement <aclement>
Mon, 31 May 2010 17:38:07 +0000 (17:38 +0000)
committeraclement <aclement>
Mon, 31 May 2010 17:38:07 +0000 (17:38 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
org.aspectj.matcher/src/org/aspectj/weaver/patterns/WildTypePattern.java

index bc3d6712f6999f3f62eccb60e617f921451207d6..023a259de8eb28f2b1f769d29f0948ba3717245a 100644 (file)
@@ -351,6 +351,10 @@ public abstract class TypePattern extends PatternNode {
                return false;
        }
 
+       public boolean hasFailedResolution() {
+               return false;
+       }
+
 }
 
 class EllipsisTypePattern extends TypePattern {
index f988ed500513479861f6b199f4430e5e41c40f21..8934a7512a946d09c1bd335dfc4e8678c12ca324 100644 (file)
@@ -201,7 +201,7 @@ public class WildAnnotationTypePattern extends AnnotationTypePattern {
                if (!resolved) {
                        throw new IllegalStateException("Can't match on an unresolved annotation type pattern");
                }
-               if (annotationValues != null) {
+               if (annotationValues != null && !typePattern.hasFailedResolution()) {
                        // PVAL improve this restriction, would allow '*(value=Color.RED)'
                        throw new IllegalStateException("Cannot use annotationvalues with a wild annotation pattern");
                }
index 7cdfd0c23ee80c397c70d65c7bd187ffa51a7e56..0bedfcb65821d133e9a76a4fff5c4c4b96d268b4 100644 (file)
@@ -76,6 +76,7 @@ public class WildTypePattern extends TypePattern {
        private static final String GENERIC_WILDCARD_CHARACTER = "?"; // signature of ? is *
        private static final String GENERIC_WILDCARD_SIGNATURE_CHARACTER = "*"; // signature of ? is *
        private NamePattern[] namePatterns;
+       private boolean failedResolution = false;
        int ellipsisCount;
        String[] importedPrefixes;
        String[] knownMatches;
@@ -915,6 +916,7 @@ public class WildTypePattern extends TypePattern {
                        // Only put the lint warning out if we can't find it in the world
                        if (typeFoundInWholeWorldSearch.isMissing()) {
                                scope.getWorld().getLint().invalidAbsoluteTypeName.signal(nameWeLookedFor, getSourceLocation());
+                               this.failedResolution = true;
                        }
                }
                importedPrefixes = scope.getImportedPrefixes();
@@ -1396,4 +1398,8 @@ public class WildTypePattern extends TypePattern {
                return visitor.visit(this, data);
        }
 
+       public boolean hasFailedResolution() {
+               return failedResolution;
+       }
+
 }