aboutsummaryrefslogtreecommitdiffstats
path: root/weaver/src
diff options
context:
space:
mode:
authoraclement <aclement>2004-05-14 09:26:03 +0000
committeraclement <aclement>2004-05-14 09:26:03 +0000
commit66818c77ef60abcd8562e0482fe44541ad185c0a (patch)
tree268f52b41dbd77f78cc3735c47ead84227d10070 /weaver/src
parenta4afa08a96f66c4de0edc676f9c4723cf0819f9e (diff)
downloadaspectj-66818c77ef60abcd8562e0482fe44541ad185c0a.tar.gz
aspectj-66818c77ef60abcd8562e0482fe44541ad185c0a.zip
Fix for Bugzilla Bug 62073
false ambigous binding error (introduced in 1.2rc2)
Diffstat (limited to 'weaver/src')
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java13
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/NameBindingPointcut.java8
2 files changed, 14 insertions, 7 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java b/weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java
index 86c55b920..a8c6b0bb3 100644
--- a/weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java
+++ b/weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java
@@ -18,6 +18,8 @@ import java.io.DataOutputStream;
import java.io.IOException;
import org.aspectj.bridge.IMessage;
+import org.aspectj.bridge.ISourceLocation;
+import org.aspectj.bridge.Message;
import org.aspectj.util.FuzzyBoolean;
import org.aspectj.weaver.BetaException;
import org.aspectj.weaver.ISourceContext;
@@ -118,6 +120,17 @@ public class ArgsPointcut extends NameBindingPointcut {
if (type.matchesInstanceof(shadow.getIWorld().resolve(argType)).alwaysTrue()) {
continue;
}
+ } else {
+ BindingTypePattern btp = (BindingTypePattern)type;
+ // Check if we have already bound something to this formal
+ if (state.get(btp.getFormalIndex())!=null) {
+ ISourceLocation isl = getSourceLocation();
+ Message errorMessage = new Message(
+ "Ambiguous binding of type "+type.getExactType().toString()+
+ " using args(..) at this line. Use one args(..) per matched join point,"+"" + " see secondary source location for location of extraneous args(..)",
+ shadow.getSourceLocation(),true,new ISourceLocation[]{getSourceLocation()});
+ shadow.getIWorld().getMessageHandler().handleMessage(errorMessage);
+ }
}
ret = Test.makeAnd(ret,
exposeStateForVar(shadow.getArgVar(i), type, state,shadow.getIWorld()));
diff --git a/weaver/src/org/aspectj/weaver/patterns/NameBindingPointcut.java b/weaver/src/org/aspectj/weaver/patterns/NameBindingPointcut.java
index 593555d9f..5bef982af 100644
--- a/weaver/src/org/aspectj/weaver/patterns/NameBindingPointcut.java
+++ b/weaver/src/org/aspectj/weaver/patterns/NameBindingPointcut.java
@@ -34,13 +34,7 @@ public abstract class NameBindingPointcut extends Pointcut {
protected Test exposeStateForVar(Var var,TypePattern type, ExposedState state, World world) {
if (type instanceof BindingTypePattern) {
BindingTypePattern b = (BindingTypePattern)type;
- if (state.get(b.getFormalIndex())!=null) {
- world.getMessageHandler().handleMessage(MessageUtil.error(
- "Ambiguous binding of type "+type.getExactType().toString()+". Use one args(..) per matched join point",
- getSourceLocation()));
- } else {
- state.set(b.getFormalIndex(), var);
- }
+ state.set(b.getFormalIndex(), var);
}
TypeX myType = type.getExactType(); //should have failed earlier