From e77c9cc472fd0506c1c11b518a648cd59a1d3bba Mon Sep 17 00:00:00 2001 From: jhugunin Date: Wed, 18 Dec 2002 05:48:33 +0000 Subject: [PATCH] better errors for bad arguments --- .../src/org/aspectj/weaver/patterns/ReferencePointcut.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } } -- 2.39.5