--- a/langtools/test/tools/javac/T6403466.java Mon Feb 15 16:09:50 2010 -0800
+++ b/langtools/test/tools/javac/T6403466.java Mon Feb 15 18:20:57 2010 -0800
@@ -41,7 +41,6 @@
@Wrap
@SupportedAnnotationTypes("Wrap")
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
public class T6403466 extends AbstractProcessor {
static final String testSrcDir = System.getProperty("test.src");
@@ -73,24 +72,31 @@
}
public boolean process(Set<? extends TypeElement> annos, RoundEnvironment rEnv) {
- Filer filer = processingEnv.getFiler();
- for (TypeElement anno: annos) {
- Set<? extends Element> elts = rEnv.getElementsAnnotatedWith(anno);
- System.err.println("anno: " + anno);
- System.err.println("elts: " + elts);
- for (TypeElement te: ElementFilter.typesIn(elts)) {
- try {
- Writer out = filer.createSourceFile(te.getSimpleName() + "Wrapper").openWriter();
- out.write("class " + te.getSimpleName() + "Wrapper { }");
- out.close();
- } catch (IOException ex) {
- ex.printStackTrace();
+ if (!rEnv.processingOver()) {
+ Filer filer = processingEnv.getFiler();
+ for (TypeElement anno: annos) {
+ Set<? extends Element> elts = rEnv.getElementsAnnotatedWith(anno);
+ System.err.println("anno: " + anno);
+ System.err.println("elts: " + elts);
+ for (TypeElement te: ElementFilter.typesIn(elts)) {
+ try {
+ Writer out = filer.createSourceFile(te.getSimpleName() + "Wrapper").openWriter();
+ out.write("class " + te.getSimpleName() + "Wrapper { }");
+ out.close();
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
}
+
}
-
}
return true;
}
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
}
@Retention(RetentionPolicy.SOURCE)