707708709710711712713714715716717
} } public void testIllegalMethodInsnNullName() { MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor()); mv.visitCode(); try { mv.visitMethodInsn(INVOKEVIRTUAL, "C", null, "()V"); fail(); } catch (Exception e) { }
717718719720721722723724725726727
} } public void testIllegalMethodInsnName() { MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor()); mv.visitCode(); try { mv.visitMethodInsn(INVOKEVIRTUAL, "C", "-", "()V"); fail(); } catch (Exception e) { }
6869707172737475767778
mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); mv = cw.visitMethod(ACC_PUBLIC, "wideLocals", "(I)I", null, null); mv.visitCode(); Label l0 = new Label(); Label l1 = new Label(); mv.visitJumpInsn(GOTO, l1); // will give GOTO_W mv.visitLabel(l0);
727728729730731732733734735736737
} } public void testIllegalMethodInsnName2() { MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor()); mv.visitCode(); try { mv.visitMethodInsn(INVOKEVIRTUAL, "C", "a-", "()V"); fail(); } catch (Exception e) { }
737738739740741742743744745746747
} } public void testIllegalMethodInsnNullDesc() { MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor()); mv.visitCode(); try { mv.visitMethodInsn(INVOKEVIRTUAL, "C", "m", null); fail(); } catch (Exception e) { }
747748749750751752753754755756757
} } public void testIllegalMethodInsnDesc() { MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor()); mv.visitCode(); try { mv.visitMethodInsn(INVOKEVIRTUAL, "C", "m", "I"); fail(); } catch (Exception e) { }
757758759760761762763764765766767
} } public void testIllegalMethodInsnParameterDesc() { MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor()); mv.visitCode(); try { mv.visitMethodInsn(INVOKEVIRTUAL, "C", "m", "(V)V"); fail(); } catch (Exception e) { }
767768769770771772773774775776777
} } public void testIllegalMethodInsnReturnDesc() { MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor()); mv.visitCode(); try { mv.visitMethodInsn(INVOKEVIRTUAL, "C", "m", "()VV"); fail(); } catch (Exception e) { }
777778779780781782783784785786787
} } public void testIllegalLdcInsnOperand() { MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor()); mv.visitCode(); try { mv.visitLdcInsn(new Object()); fail(); } catch (Exception e) { }
787788789790791792793794795796797
} } public void testIllegalMultiANewArrayDesc() { MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor()); mv.visitCode(); try { mv.visitMultiANewArrayInsn("I", 1); fail(); } catch (Exception e) { }