Переглянути джерело

better errors for bad arguments

tags/V_1_1_b2
jhugunin 21 роки тому
джерело
коміт
e77c9cc472

+ 6
- 1
weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java Переглянути файл

for (int i=0,len=arguments.size(); i < len; i++) { for (int i=0,len=arguments.size(); i < len; i++) {
TypePattern p = arguments.get(i); TypePattern p = arguments.get(i);
//we are allowed to bind to pointcuts which use subtypes as this is type safe //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])) { if (!p.matchesSubtypes(parameterTypes[i])) {
scope.message(IMessage.ERROR, p, "incompatible type, expected " + scope.message(IMessage.ERROR, p, "incompatible type, expected " +
parameterTypes[i] + " found " + p);
parameterTypes[i].getName() + " found " + p);
return; return;
} }
} }

Завантаження…
Відмінити
Зберегти