From: aclement Date: Tue, 10 Jun 2008 20:48:36 +0000 (+0000) Subject: guard 155347 X-Git-Tag: V1_6_1rc1~75 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=248962b92ffa409d11122d2504e84567c7c34354;p=aspectj.git guard 155347 --- diff --git a/weaver/src/org/aspectj/weaver/patterns/IfPointcut.java b/weaver/src/org/aspectj/weaver/patterns/IfPointcut.java index 304c26056..0e61b5eda 100644 --- a/weaver/src/org/aspectj/weaver/patterns/IfPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/IfPointcut.java @@ -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()))); } }