test/tools/javac/processing/model/element/TestResourceVariable.java

changeset 699
d2aaaec153e8
parent 697
28b021bb889f
child 851
cad51b6eb7a6
equal deleted inserted replaced
698:f94af0667151 699:d2aaaec153e8
24 /* 24 /*
25 * @test 25 * @test
26 * @bug 6911256 6964740 6967842 26 * @bug 6911256 6964740 6967842
27 * @summary Test that the resource variable kind is appropriately set 27 * @summary Test that the resource variable kind is appropriately set
28 * @author Joseph D. Darcy 28 * @author Joseph D. Darcy
29 * @build TestResourceVariable 29 * @library ../../../lib
30 * @build JavacTestingAbstractProcessor TestResourceVariable
30 * @compile -processor TestResourceVariable -proc:only TestResourceVariable.java 31 * @compile -processor TestResourceVariable -proc:only TestResourceVariable.java
31 */ 32 */
32 33
33 // Bug should be filed for this misbehavior 34 // Bug should be filed for this misbehavior
34 35
46 /** 47 /**
47 * Using the tree API, retrieve element representations of the 48 * Using the tree API, retrieve element representations of the
48 * resource of an ARM block and verify their kind tags are set 49 * resource of an ARM block and verify their kind tags are set
49 * appropriately. 50 * appropriately.
50 */ 51 */
51 @SupportedAnnotationTypes("*") 52 public class TestResourceVariable extends JavacTestingAbstractProcessor implements AutoCloseable {
52 public class TestResourceVariable extends AbstractProcessor implements AutoCloseable {
53 int resourceVariableCount = 0; 53 int resourceVariableCount = 0;
54 54
55 public boolean process(Set<? extends TypeElement> annotations, 55 public boolean process(Set<? extends TypeElement> annotations,
56 RoundEnvironment roundEnv) { 56 RoundEnvironment roundEnv) {
57 if (!roundEnv.processingOver()) { 57 if (!roundEnv.processingOver()) {
103 resourceVariableCount++; 103 resourceVariableCount++;
104 } 104 }
105 return super.visitVariable(node, cu); 105 return super.visitVariable(node, cu);
106 } 106 }
107 } 107 }
108
109 @Override
110 public SourceVersion getSupportedSourceVersion() {
111 return SourceVersion.latest();
112 }
113 } 108 }

mercurial