Allow using anonymous classes as interceptors

This commit is contained in:
Andrey Breslav
2013-05-13 19:15:07 +04:00
parent 39c9cbcd9e
commit bb12685004
@@ -220,7 +220,7 @@ public class InterceptionInstrumenter {
dumpTasks.add(new DumpAction() {
@Override
public void dump(PrintStream out) {
out.println("<<< " + instrumenter + ": " + interceptor.getClass().getCanonicalName() + " says:");
out.println("<<< " + instrumenter + ": " + interceptor.getClass().getName() + " says:");
try {
if (method.getParameterTypes().length == 0) {
method.invoke(interceptor);
@@ -462,7 +462,7 @@ public class InterceptionInstrumenter {
) {
FieldData field = methodData.getOwnerField();
ia.getstatic(field.getDeclaringClass(), field.getName(), field.getDesc());
ia.checkcast(field.getRuntimeType());
ia.checkcast(Type.getObjectType(methodData.getDeclaringClass()));
org.jetbrains.asm4.commons.Method asmMethod = getAsmMethod(methodData);