return;
}
ctClass.instrument(new ExprEditor() {
public void edit(MethodCall methodCall) throws CannotCompileException {
try {
CtBehavior where = null;
try {
where = methodCall.where();
} catch (RuntimeException e) {
// <clinit> access leads to a bug in Javassist
where = ctClass.getClassInitializer();
}
// filter caller methods
if (methodFilterCaller(where)) {
return;
}
// get the callee method name, signature and class name
CtMethod calleeMethod = methodCall.getMethod();
String calleeClassName = methodCall.getClassName();
if (!(calleeMethod.getName().equals("proceedWithCallJoinPoint") && calleeClassName
.equals("org.codehaus.aspectwerkz.joinpoint.management.JoinPointManager"))) {
return;
}
System.out.println("found smtg to REMOVE");
System.out.println("calleeMethod = " + calleeMethod.getName());
System.out.println("calleeClassName = " + calleeClassName);
System.out.println("methodCall = " + methodCall.indexOfBytecode());
methodCall.replace("{java.lang.System.out.println($args[0]); $_=null;}");
try {
CodeIterator it = where.getMethodInfo().getCodeAttribute().iterator();
it.move(methodCall.indexOfBytecode() - 5);
System.out.println("it.get() = " + it.get());
it.next();
System.out.println("it.get() = " + it.get());
it.next();