Example usage for org.objectweb.asm.tree AnnotationNode visitAnnotation

List of usage examples for org.objectweb.asm.tree AnnotationNode visitAnnotation

Introduction

In this page you can find the example usage for org.objectweb.asm.tree AnnotationNode visitAnnotation.

Prototype

@Override
    public AnnotationVisitor visitAnnotation(final String name, final String descriptor) 

Source Link

Usage

From source file:com.android.build.gradle.internal.incremental.InstantRunVerifierTest.java

License:Apache License

@Test
public void testDiffListOnAnnotationNodesWithAnnotationNodeValue() throws Exception {
    AnnotationNode original = new AnnotationNode("Ltest/SomeAnnotation;");
    AnnotationVisitor newAnnotation = original.visitAnnotation("InnerAnnotation", "LTest;");
    newAnnotation.visit("innerEntry", "innerValue");
    newAnnotation.visitEnd();//w  w  w .ja v  a  2  s.com

    AnnotationNode updated = new AnnotationNode("Ltest/SomeAnnotation;");
    newAnnotation = updated.visitAnnotation("InnerAnnotation", "LTest;");
    newAnnotation.visit("innerEntry", "innerValue");
    newAnnotation.visitEnd();

    assertEquals(InstantRunVerifier.Diff.NONE, InstantRunVerifier.diffList(Lists.newArrayList(original),
            Lists.newArrayList(updated), InstantRunVerifier.ANNOTATION_COMPARATOR));
}