]> source.dussan.org Git - aspectj.git/commitdiff
guard 155347
authoraclement <aclement>
Tue, 10 Jun 2008 20:48:36 +0000 (20:48 +0000)
committeraclement <aclement>
Tue, 10 Jun 2008 20:48:36 +0000 (20:48 +0000)
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java

index 304c26056a8873273b6558ce983589a593541582..0e61b5edaa5bac8b28d378f24b3c1e5f0223e1a7 100644 (file)
@@ -24,6 +24,7 @@ import org.aspectj.lang.JoinPoint;
 import org.aspectj.util.FuzzyBoolean;
 import org.aspectj.weaver.Advice;
 import org.aspectj.weaver.AjcMemberMaker;
+import org.aspectj.weaver.BCException;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.IntMap;
 import org.aspectj.weaver.ResolvedMember;
@@ -173,7 +174,10 @@ public class IfPointcut extends Pointcut {
                     //    is bindings for the arguments
                     residueSource.findResidue(shadow, myState);
 
-
+                                       UnresolvedType[] pTypes = (testMethod==null?null:testMethod.getParameterTypes());
+                    if (pTypes!=null && baseArgsCount>pTypes.length) { //pr155347
+                       throw new BCException("Unexpected problem with testMethod "+testMethod+": expecting "+baseArgsCount+" arguments");
+                    }
                     // pr118149
                     // It is possible for vars in myState (which would normally be set
                     // in the call to residueSource.findResidue) to not be set (be null)
@@ -186,7 +190,7 @@ public class IfPointcut extends Pointcut {
                         args.add(v);
                         ret = Test.makeAnd(ret,
                             Test.makeInstanceof(v,
-                                testMethod.getParameterTypes()[i].resolve(shadow.getIWorld())));
+                                pTypes[i].resolve(shadow.getIWorld())));
                     }
                 }