瀏覽代碼

better errors for bad arguments

tags/V_1_1_b2
jhugunin 21 年之前
父節點
當前提交
e77c9cc472
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6
    1
      weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java

+ 6
- 1
weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java 查看文件

@@ -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…
取消
儲存