]> source.dussan.org Git - aspectj.git/commitdiff
better errors for circularities
authorjhugunin <jhugunin>
Mon, 30 Dec 2002 20:30:48 +0000 (20:30 +0000)
committerjhugunin <jhugunin>
Mon, 30 Dec 2002 20:30:48 +0000 (20:30 +0000)
weaver/src/org/aspectj/weaver/patterns/DeclareDominates.java

index 23b0a45f2f6b592245c401c487dd16d21339bd2d..87eed741dc157e33233b762fde9dd6b9aba59d2d 100644 (file)
@@ -16,6 +16,7 @@ package org.aspectj.weaver.patterns;
 import java.io.*;
 import java.util.List;
 
+import org.aspectj.bridge.IMessage;
 import org.aspectj.weaver.*;
 import org.aspectj.weaver.ResolvedTypeX;
 
@@ -77,9 +78,12 @@ public class DeclareDominates extends Declare {
                        TypePattern p = patterns.get(i);
                        if (p.isStar()) {
                                starMatch = i;
-                       } else if (p.matchesExactly(a)) {
+                       } else if (p.matchesStatically(a)) {
                                if (knownMatch != -1) {
-                                       throw new BCException("multiple matches: " + this + " with " + a);
+                                       a.getWorld().showMessage(IMessage.ERROR, "multiple matches for " + a + 
+                                                       ", matches both " + patterns.get(knownMatch) + " and " + p,
+                                                       patterns.get(knownMatch).getSourceLocation(), p.getSourceLocation());
+                                       return -1;
                                } else {
                                        knownMatch = i;
                                }