mv.visitMaxs(0, 0);
mv.visitEnd();
cw.visitEnd();
byte[] b = cw.toByteArray();
ClassReader cr = new ClassReader(b);
cr.accept(new EmptyVisitor() {
@Override
public MethodVisitor visitMethod(
final int access,
final String name,
final String desc,
final String signature,
final String[] exceptions)
{
if (name.equals("m")) {
return new EmptyVisitor() {
@Override
public void visitMaxs(
final int realMaxStack,
final int realMaxLocals)
{
assertEquals("maxStack", maxStack, realMaxStack);
assertEquals("maxLocals", maxLocals, realMaxLocals);
}
};
} else {
return new EmptyVisitor();
}
}
},
0);