diff options
author | jhugunin <jhugunin> | 2003-01-01 01:32:00 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-01-01 01:32:00 +0000 |
commit | 768fe44deed3fe6ed56d90bbee8393e06761d265 (patch) | |
tree | b2b7ca85019105e9f0dbf21222e7df1737c2c3b5 /weaver | |
parent | 4a5b6f6bbfb7b22f627d87a0fda34f600989f7ea (diff) | |
download | aspectj-768fe44deed3fe6ed56d90bbee8393e06761d265.tar.gz aspectj-768fe44deed3fe6ed56d90bbee8393e06761d265.zip |
better errors for dominates circularities
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/DeclareDominates.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclareDominates.java b/weaver/src/org/aspectj/weaver/patterns/DeclareDominates.java index 87eed741d..35d9e071c 100644 --- a/weaver/src/org/aspectj/weaver/patterns/DeclareDominates.java +++ b/weaver/src/org/aspectj/weaver/patterns/DeclareDominates.java @@ -64,7 +64,24 @@ public class DeclareDominates extends Declare { } public void resolve(IScope scope) { - patterns = patterns.resolveBindings(scope, Bindings.NONE, false, false); + patterns = patterns.resolveBindings(scope, Bindings.NONE, false, false); + + for (int i=0; i < patterns.size(); i++) { + TypePattern pi = patterns.get(i); + if (pi.isStar()) continue; + ResolvedTypeX exactType = pi.getExactType().resolve(scope.getWorld()); + if (exactType == ResolvedTypeX.MISSING) continue; + for (int j=0; j < patterns.size(); j++) { + if (j == i) continue; + TypePattern pj = patterns.get(j); + if (pj.isStar()) continue; + if (pj.matchesStatically(exactType)) { + scope.getWorld().showMessage(IMessage.ERROR, + "circularity in declare dominates, '" + exactType.getName() + + "' matches two patterns", pi.getSourceLocation(), pj.getSourceLocation()); + } + } + } } public TypePatternList getPatterns() { |