Browse Source

better errors for bad arguments

tags/V_1_1_b2
jhugunin 21 years ago
parent
commit
e77c9cc472
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java

+ 6
- 1
weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java View File

@@ -169,9 +169,14 @@ public class ReferencePointcut extends Pointcut {
for (int i=0,len=arguments.size(); i < len; i++) {
TypePattern p = arguments.get(i);
//we are allowed to bind to pointcuts which use subtypes as this is type safe
if (p == TypePattern.NO) {
scope.message(IMessage.ERROR, this,
"bad parameter to pointcut reference");
return;
}
if (!p.matchesSubtypes(parameterTypes[i])) {
scope.message(IMessage.ERROR, p, "incompatible type, expected " +
parameterTypes[i] + " found " + p);
parameterTypes[i].getName() + " found " + p);
return;
}
}

Loading…
Cancel
Save