Hi, the decompile method in Decompiler class is generating an error when processing classes with java reflection mechanism.
Below is the code to reproduce the error:
public class Reflection {
public static void staticInvokeReflection() throws NoSuchMethodException {
// Invoking static method using reflection
Method method = A.class.getMethod("staticFoo");
try {
method.invoke(null);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
The A.java file:
public class A {
public static void staticFoo() {
System.out.println("foo");
}
}
Error message:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running lang.jimple.internal.TestDecompiler
java.lang.ClassCastException: lang.jimple.internal.generated.Immediate$c_iValue cannot be cast to lang.jimple.internal.generated.Immediate$c_local
at lang.jimple.internal.Decompiler$InstructionSetVisitor.invokeMethodIns(Decompiler.java:698)
at lang.jimple.internal.Decompiler$InstructionSetVisitor.visitMethodInsn(Decompiler.java:555)
at org.objectweb.asm.tree.MethodInsnNode.accept(Unknown Source)
at org.objectweb.asm.tree.InsnList.accept(Unknown Source)
at lang.jimple.internal.Decompiler$GenerateJimpleClassVisitor.visitMethod(Decompiler.java:210)
at lang.jimple.internal.Decompiler$GenerateJimpleClassVisitor.visitEnd(Decompiler.java:162)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
Hi, the decompile method in Decompiler class is generating an error when processing classes with java reflection mechanism.
Below is the code to reproduce the error:
The A.java file:
Error message: