I'm receiving this error:
java.lang.VerifyError: Bad <init> method call in method FooBar.<init>(I)V at offset 2
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
at java.lang.Class.getConstructor0(Class.java:2714)
at java.lang.Class.getDeclaredConstructor(Class.java:2002)
when attempting to access the constructor of a class that I have modified with ASM 4.0 (using jdk7).
I have checked the bytecode for the initialization method of the class and it is as follows:
aload_0
iload_1
invokespecial com/foo/F/<init>(I)V
return
Decompiling the bytecode produces:
import com.foo.Foo;
public class FooBar extends Foo
{
public FooBar(int i)
{
super(i);
}
}
I'm completely stumped as to why I am receiving this error. I don't know if I've given enough information; please let me know if I can add any more information.
EDIT: Here is the code that is accessing the constructor:
Class fooBarClass = /* define class from class file bytes */;
Constructor fooBarConstructor = fooBarClass.getDeclaredConstructor(int.class);
EDIT2: Here is the code for the class Foo:
public class Foo extends F {
public Foo(int i) {
super(i);
}
}