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

changeset 699
d2aaaec153e8
parent 672
ea54372637a5
child 722
4851ff2ffc10
equal deleted inserted replaced
698:f94af0667151 699:d2aaaec153e8
24 /* 24 /*
25 * @test 25 * @test
26 * @bug 6449781 26 * @bug 6449781
27 * @summary Test that reported names of anonymous classes are non-null. 27 * @summary Test that reported names of anonymous classes are non-null.
28 * @author Joseph D. Darcy 28 * @author Joseph D. Darcy
29 * @build TestAnonSourceNames 29 * @library ../../../lib
30 * @build JavacTestingAbstractProcessor TestAnonSourceNames
30 * @compile -processor TestAnonSourceNames TestAnonClassNames.java 31 * @compile -processor TestAnonSourceNames TestAnonClassNames.java
31 * @run main TestAnonClassNames 32 * @run main TestAnonClassNames
32 */ 33 */
33 34
34 /* 35 /*
139 } 140 }
140 141
141 /** 142 /**
142 * Probe at the various kinds of names of a type element. 143 * Probe at the various kinds of names of a type element.
143 */ 144 */
144 @SupportedAnnotationTypes("*") 145 class ClassNameProber extends JavacTestingAbstractProcessor {
145 class ClassNameProber extends AbstractProcessor {
146 public ClassNameProber(){super();} 146 public ClassNameProber(){super();}
147 147
148 private boolean classesFound=false; 148 private boolean classesFound=false;
149 149
150 public boolean process(Set<? extends TypeElement> annotations, 150 public boolean process(Set<? extends TypeElement> annotations,
172 if (!classesFound) { 172 if (!classesFound) {
173 throw new RuntimeException("Error: no classes processed."); 173 throw new RuntimeException("Error: no classes processed.");
174 } 174 }
175 return true; 175 return true;
176 } 176 }
177
178 public SourceVersion getSupportedSourceVersion() {
179 return SourceVersion.latest();
180 }
181 } 177 }

mercurial