i have a test method:
public List<User> getUsers(){
List list = new ArrayList();
return list;
}
so,I want insert two for-loop code to the method, to new list before and after, asm code same is :
final int returnValueStackNum = adapter.newLocal(Type.INT_TYPE);
mv.visitInsn(Opcodes.ICONST_0);
mv.visitVarInsn(Opcodes.ISTORE, returnValueStackNum);
final Label l0 = new Label();
mv.visitJumpInsn(Opcodes.GOTO, l0);
final Label l1 = new Label();
mv.visitLabel(l1);
mv.visitIincInsn(returnValueStackNum, 1);
mv.visitLabel(l0);
mv.visitVarInsn(Opcodes.ILOAD, returnValueStackNum);
mv.visitIntInsn(Opcodes.BIPUSH, 10);
mv.visitJumpInsn(Opcodes.IF_ICMPLT, l1);
first for-loop is right in new class file, but second for-loop is wrong and return is lost, code same:
List list = new ArrayList();
for (int i = 0; i < 10; i++);
int j = 0;
tmpTernaryOp = localArrayList;
while (j < 10)
j++;
Where has the problem, thank you very much