]> source.dussan.org Git - aspectj.git/commitdiff
fix for Bugzilla Bug 29689
authorjhugunin <jhugunin>
Tue, 21 Jan 2003 19:01:43 +0000 (19:01 +0000)
committerjhugunin <jhugunin>
Tue, 21 Jan 2003 19:01:43 +0000 (19:01 +0000)
   Declare precedence should not allow multiple * patterns

weaver/src/org/aspectj/weaver/patterns/DeclarePrecedence.java

index 837bbc7ce04a7c2a7c00dd693aa14b0e784f94cc..cf0ff8d1a43f2086e3975ea345179f510ea94005 100644 (file)
@@ -65,10 +65,19 @@ public class DeclarePrecedence extends Declare {
        
     public void resolve(IScope scope) {
        patterns = patterns.resolveBindings(scope, Bindings.NONE, false, false); 
+       boolean seenStar = false;
        
        for (int i=0; i < patterns.size(); i++) {
                TypePattern pi = patterns.get(i);
-               if (pi.isStar()) continue;
+               if (pi.isStar()) {
+                       if (seenStar) {
+                               scope.getWorld().showMessage(IMessage.ERROR,
+                                       "circularity in declare dominates, '*' occurs more than once",
+                                       pi.getSourceLocation(), null);                                  
+                       }
+                       seenStar = true;
+                       continue;
+               }
                ResolvedTypeX exactType = pi.getExactType().resolve(scope.getWorld());
                if (exactType == ResolvedTypeX.MISSING) continue;
                for (int j=0; j < patterns.size(); j++) {