]> source.dussan.org Git - aspectj.git/commitdiff
better errors for bad arguments
authorjhugunin <jhugunin>
Wed, 18 Dec 2002 05:48:33 +0000 (05:48 +0000)
committerjhugunin <jhugunin>
Wed, 18 Dec 2002 05:48:33 +0000 (05:48 +0000)
weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java

index b774ebdf054cd614542bda1850d58afda28f6ec5..d3b9d1badde8955550fd2b37fa9255d40500a196 100644 (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;
                        }
                }