// in the call to residueSource.findResidue) to not be set (be null)
// in an Or pointcut with if expressions in both branches, and where
// one branch is known statically to not match. In this situation we
// simply return Test.
for (int i = 0; i < baseArgsCount; i++) {
Var v = myState.get(i);
if (v == null) {
continue; // pr118149
}
args.add(v);
ret = Test.makeAnd(ret, Test.makeInstanceof(v, pTypes[i].resolve(shadow.getIWorld())));
}
}
// handle thisJoinPoint parameters
if ((extraParameterFlags & Advice.ThisJoinPoint) != 0) {
args.add(shadow.getThisJoinPointVar());
}
if ((extraParameterFlags & Advice.ThisJoinPointStaticPart) != 0) {
args.add(shadow.getThisJoinPointStaticPartVar());
}
if ((extraParameterFlags & Advice.ThisEnclosingJoinPointStaticPart) != 0) {
args.add(shadow.getThisEnclosingJoinPointStaticPartVar());
}
if ((extraParameterFlags & Advice.ThisAspectInstance) != 0) {
args.add(shadow.getThisAspectInstanceVar(state.getConcreteAspect()));
}
} else {
// @style is slightly different
int currentStateIndex = 0;
// FIXME AV - "args(jp)" test(jp, thejp) will fail here
for (int i = 0; i < testMethod.getParameterTypes().length; i++) {
String argSignature = testMethod.getParameterTypes()[i].getSignature();
if (AjcMemberMaker.TYPEX_JOINPOINT.getSignature().equals(argSignature)) {
args.add(shadow.getThisJoinPointVar());
} else if (AjcMemberMaker.TYPEX_PROCEEDINGJOINPOINT.getSignature().equals(argSignature)) {
args.add(shadow.getThisJoinPointVar());
} else if (AjcMemberMaker.TYPEX_STATICJOINPOINT.getSignature().equals(argSignature)) {
args.add(shadow.getThisJoinPointStaticPartVar());
} else if (AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT.getSignature().equals(argSignature)) {
args.add(shadow.getThisEnclosingJoinPointStaticPartVar());
} else {
if (state.size() == 0 || currentStateIndex > state.size()) {
String[] paramNames = testMethod.getParameterNames();
StringBuffer errorParameter = new StringBuffer();
if (paramNames != null) {
errorParameter.append(testMethod.getParameterTypes()[i].getName()).append(" ");
errorParameter.append(paramNames[i]);
shadow.getIWorld()
.getMessageHandler()
.handleMessage(
MessageUtil.error("Missing binding for if() pointcut method. Parameter " + (i + 1)
+ "(" + errorParameter.toString()
+ ") must be bound - even in reference pointcuts (compiler limitation)",
testMethod.getSourceLocation()));
} else {
shadow.getIWorld()
.getMessageHandler()
.handleMessage(
MessageUtil.error("Missing binding for if() pointcut method. Parameter " + (i + 1)
+ " must be bound - even in reference pointcuts (compiler limitation)",
testMethod.getSourceLocation()));
}
return Literal.TRUE; // exit quickly
}
// we don't use i as JoinPoint.* can be anywhere in the signature in @style
Var v = state.get(currentStateIndex++);
while (v == null && currentStateIndex < state.size()) { // pr162135
v = state.get(currentStateIndex++);
}
args.add(v);