}
int joinPointHash = AsmHelper.calculateMethodHash(calleeMethodName, calleeMethodDesc);
ClassInfo classInfo = AsmClassInfo.getClassInfo(calleeClassName, m_loader);
MethodInfo calleeMethodInfo = classInfo.getMethod(joinPointHash);
if (calleeMethodInfo == null) {
System.err.println(
"AW::WARNING " +
"metadata structure could not be build for method ["
+ classInfo.getName().replace('/', '.')
+ '.' + calleeMethodName + ':' + calleeMethodDesc
+ "] when parsing method ["
+ m_callerClassInfo.getName() + '.' + m_callerMethodName + "(..)]"
);
// bail out
super.visitMethodInsn(opcode, calleeClassName, calleeMethodName, calleeMethodDesc);
return;
}
ExpressionContext ctx = new ExpressionContext(PointcutType.CALL, calleeMethodInfo, m_callerMemberInfo);
if (methodFilter(m_ctx.getDefinitions(), ctx, calleeMethodInfo)) {
super.visitMethodInsn(opcode, calleeClassName, calleeMethodName, calleeMethodDesc);
} else {
m_ctx.markAsAdvised();
String joinPointClassName = TransformationUtil.getJoinPointClassName(
m_callerClassName,
m_callerMethodName,
m_callerMethodDesc,
calleeClassName,
JoinPointType.METHOD_CALL_INT,
joinPointHash
);
// load the caller instance (this), or null if in a static context
// note that callee instance [optional] and args are already on the stack
if (Modifier.isStatic(m_callerMemberInfo.getModifiers())) {
visitInsn(ACONST_NULL);
} else {
visitVarInsn(ALOAD, 0);
}
// add the call to the join point
super.visitMethodInsn(
INVOKESTATIC,
joinPointClassName,
INVOKE_METHOD_NAME,
TransformationUtil.getInvokeSignatureForCodeJoinPoints(
calleeMethodInfo.getModifiers(), calleeMethodDesc,
m_callerClassName, calleeClassName
)
);
// emit the joinpoint
//See AW-253 - we remember if we had an INVOKE INTERFACE opcode
int modifiers = calleeMethodInfo.getModifiers();
if (opcode == INVOKEINTERFACE) {
modifiers = modifiers | MODIFIER_INVOKEINTERFACE;
}
m_ctx.addEmittedJoinPoint(
new EmittedJoinPoint(