From: jhugunin Date: Wed, 18 Dec 2002 05:48:33 +0000 (+0000) Subject: better errors for bad arguments X-Git-Tag: V_1_1_b2~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e77c9cc472fd0506c1c11b518a648cd59a1d3bba;p=aspectj.git better errors for bad arguments --- diff --git a/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java b/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java index b774ebdf0..d3b9d1bad 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java +++ b/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; } }