Example usage for org.objectweb.asm.tree MethodNode visitLineNumber

List of usage examples for org.objectweb.asm.tree MethodNode visitLineNumber

Introduction

In this page you can find the example usage for org.objectweb.asm.tree MethodNode visitLineNumber.

Prototype

@Override
    public void visitLineNumber(final int line, final Label start) 

Source Link

Usage

From source file:org.jacoco.core.internal.analysis.filter.KotlinGeneratedFilterTest.java

License:Open Source License

@Test
public void testWithLinesForKotlinWithDebug() {
    final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION, 0, "hashCode", "()I", null, null);
    m.visitAnnotation("Lother/Annotation;", false);
    m.visitLineNumber(12, new Label());
    m.visitInsn(Opcodes.ICONST_0);/*from   ww w .  ja  va  2 s  . c om*/
    m.visitInsn(Opcodes.IRETURN);
    context.classAnnotations.add(KotlinGeneratedFilter.KOTLIN_METADATA_DESC);

    filter.filter(m, context, output);

    assertIgnored();
}

From source file:org.jacoco.core.internal.analysis.filter.KotlinGeneratedFilterTest.java

License:Open Source License

@Test
public void testWithLinesForKotlinNoDebug() {
    final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION, 0, "hashCode", "()I", null, null);
    m.visitInsn(Opcodes.ICONST_0);/*from  w  w  w  .  ja v a 2 s .  c o m*/
    m.visitInsn(Opcodes.IRETURN);
    m.visitLineNumber(12, new Label());
    context.classAnnotations.add(KotlinGeneratedFilter.KOTLIN_METADATA_DESC);
    context.sourceFileName = null;

    filter.filter(m, context, output);

    assertIgnored();
}