List of usage examples for org.objectweb.asm.tree AnnotationNode visitArray
@Override
public AnnotationVisitor visitArray(final String name)
From source file:com.android.build.gradle.internal.incremental.InstantRunVerifierTest.java
License:Apache License
@Test public void testDiffListOnAnnotationNodesWithAnnotationArrayValue() throws Exception { AnnotationNode original = new AnnotationNode("Ltest/SomeAnnotation;"); AnnotationVisitor arrayVisitor = original.visitArray("test"); AnnotationVisitor newAnnotation = arrayVisitor.visitAnnotation("InnerAnnotation", "LTest;"); newAnnotation.visit("innerEntry", "innerValue"); newAnnotation.visitEnd();/*from ww w. j av a2 s . c o m*/ newAnnotation = arrayVisitor.visitAnnotation("InnerAnnotation", "LTest;"); newAnnotation.visit("innerEntry", "innerValue"); newAnnotation.visitEnd(); arrayVisitor.visitEnd(); AnnotationNode updated = new AnnotationNode("Ltest/SomeAnnotation;"); arrayVisitor = updated.visitArray("test"); newAnnotation = arrayVisitor.visitAnnotation("InnerAnnotation", "LTest;"); newAnnotation.visit("innerEntry", "innerValue"); newAnnotation.visitEnd(); newAnnotation = arrayVisitor.visitAnnotation("InnerAnnotation", "LTest;"); newAnnotation.visit("innerEntry", "innerValue"); newAnnotation.visitEnd(); arrayVisitor.visitEnd(); assertEquals(InstantRunVerifier.Diff.NONE, InstantRunVerifier.diffList(Lists.newArrayList(original), Lists.newArrayList(updated), InstantRunVerifier.ANNOTATION_COMPARATOR)); }
From source file:com.android.build.gradle.internal.incremental.InstantRunVerifierTest.java
License:Apache License
@Test public void testDiffListOnAnnotationNodesWithIntArrayValue() throws Exception { AnnotationNode original = new AnnotationNode("Ltest/SomeAnnotation;"); AnnotationVisitor test = original.visitArray("test"); test.visit("stub", 1); test.visit("stub", 2); test.visit("stub", 3); test.visitEnd();//from ww w . ja v a2 s . c o m AnnotationNode updated = new AnnotationNode("Ltest/SomeAnnotation;"); test = updated.visitArray("test"); test.visit("stub", 1); test.visit("stub", 2); test.visit("stub", 3); test.visitEnd(); assertEquals(InstantRunVerifier.Diff.NONE, InstantRunVerifier.diffList(Lists.newArrayList(original), Lists.newArrayList(updated), InstantRunVerifier.ANNOTATION_COMPARATOR)); }