continue;
}
//TODO - do we care about non bounded pointcut ?
for (Iterator iterator2 = aspectDefinition.getAdviceDefinitions().iterator(); iterator2.hasNext();) {
AdviceDefinition adviceDefinition = (AdviceDefinition) iterator2.next();
final ExpressionInfo expressionInfo = adviceDefinition.getExpressionInfo();
if (expressionInfo == null) {
continue;
}
if (expressionInfo.getExpression().match(expressionContext)) {
// compute the target method to advice method arguments map, and grab information about this
// and target bindings
expressionContext.resetRuntimeState();
ArgsIndexVisitor.updateContextForRuntimeInformation(
expressionInfo,
expressionContext,
loader
);
// Note that the expressionContext dynamic information updated here should only be used
// in the scope of this code block, since at the next iteration, the data will be
// updated for another advice binding
// [hence see setMethodArgumentIndexes below]
// create a lightweight representation of the bounded advices to pass to the compiler
final MethodInfo adviceMethodInfo = adviceDefinition.getMethodInfo();
final AdviceInfo adviceInfo = new AdviceInfo(
aspectDefinition.getQualifiedName(),
aspectDefinition.getClassName(),
aspectDefinition.getDeploymentModel(),
adviceMethodInfo.getName(),
AsmHelper.getMethodDescriptor(adviceMethodInfo),
AsmHelper.getArgumentTypes(adviceMethodInfo),
adviceDefinition.getType(),
adviceDefinition.getSpecialArgumentType(),
adviceDefinition.getName(),
expressionContext.m_targetWithRuntimeCheck,
expressionInfo,
expressionContext,
adviceDefinition
);
setMethodArgumentIndexes(expressionInfo, expressionContext, adviceInfo, loader);
if (AdviceType.BEFORE.equals(adviceDefinition.getType())) {
beforeAdvices.add(adviceInfo);
} else if (AdviceType.AROUND.equals(adviceDefinition.getType())) {
aroundAdvices.add(adviceInfo);
} else if (AdviceType.AFTER_FINALLY.equals(adviceDefinition.getType())) {
afterFinallyAdvices.add(adviceInfo);
} else if (AdviceType.AFTER_RETURNING.equals(adviceDefinition.getType())) {
afterReturningAdvices.add(adviceInfo);
} else if (AdviceType.AFTER_THROWING.equals(adviceDefinition.getType())) {
afterThrowingAdvices.add(adviceInfo);
} else if (AdviceType.AFTER.equals(adviceDefinition.getType())) {
afterFinallyAdvices.add(adviceInfo);//special case for "after only"
}
}
}
}