6926699: Annotation processing regression tests should typically return SourceVersion.latest
Reviewed-by: jjg
--- a/langtools/test/tools/javac/6341866/Anno.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/6341866/Anno.java Mon Feb 15 20:06:11 2010 -0800
@@ -27,7 +27,6 @@
import javax.lang.model.element.*;
@SupportedAnnotationTypes("*")
- @SupportedSourceVersion(SourceVersion.RELEASE_7)
public class Anno extends AbstractProcessor {
public boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) {
@@ -35,4 +34,9 @@
// System.err.println("annotation processing");
return true;
}
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
}
--- a/langtools/test/tools/javac/T6406771.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/T6406771.java Mon Feb 15 20:06:11 2010 -0800
@@ -17,7 +17,7 @@
import com.sun.source.util.*;
import com.sun.tools.javac.tree.JCTree;
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
+
@SupportedAnnotationTypes("*")
public class T6406771 extends AbstractProcessor {
String[] tests = {
@@ -95,4 +95,8 @@
return true;
}
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
}
--- a/langtools/test/tools/javac/T6411379.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/T6411379.java Mon Feb 15 20:06:11 2010 -0800
@@ -37,7 +37,6 @@
import com.sun.source.util.*;
@SupportedAnnotationTypes("*")
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
public class T6411379 extends AbstractProcessor {
public boolean process(Set<? extends TypeElement> annoElems,
@@ -58,6 +57,11 @@
return true;
}
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
+
public void checkNull(Object o) {
if (o != null)
throw new AssertionError("expected null");
--- a/langtools/test/tools/javac/T6423583.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/T6423583.java Mon Feb 15 20:06:11 2010 -0800
@@ -37,7 +37,6 @@
import com.sun.source.util.*;
@SupportedAnnotationTypes("*")
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
public class T6423583 extends AbstractProcessor {
boolean b1 = true;
boolean b2 = false;
@@ -59,6 +58,10 @@
return true;
}
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
private static class Test extends TreeScanner<Void,Void> {
--- a/langtools/test/tools/javac/T6855236.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/T6855236.java Mon Feb 15 20:06:11 2010 -0800
@@ -38,7 +38,6 @@
import com.sun.source.tree.*;
import com.sun.source.util.*;
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedAnnotationTypes("*")
public class T6855236 extends AbstractProcessor {
@@ -63,6 +62,11 @@
return true;
}
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
+
class CodeVisitor extends TreePathScanner<Object, Trees> {
@Override
--- a/langtools/test/tools/javac/api/6421111/T6421111.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/api/6421111/T6421111.java Mon Feb 15 20:06:11 2010 -0800
@@ -76,7 +76,6 @@
throw new AssertionError("Annotation processor failed");
}
@SupportedAnnotationTypes("*")
- @SupportedSourceVersion(SourceVersion.RELEASE_6)
static class MyProcessor extends AbstractProcessor {
void test(TypeElement element, boolean fbound) {
TypeParameterElement tpe = element.getTypeParameters().iterator().next();
@@ -96,6 +95,10 @@
test(processingEnv.getElementUtils().getTypeElement("Test2"), true);
return false;
}
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
}
public static void main(String... args) {
new T6421111().test(args);
--- a/langtools/test/tools/javac/api/6468404/T6468404.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/api/6468404/T6468404.java Mon Feb 15 20:06:11 2010 -0800
@@ -105,7 +105,6 @@
}
@SupportedAnnotationTypes("*")
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
class P extends AbstractProcessor {
boolean ran = false;
@@ -145,4 +144,9 @@
}
return true;
}
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
}
--- a/langtools/test/tools/javac/api/T6412669.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/api/T6412669.java Mon Feb 15 20:06:11 2010 -0800
@@ -38,7 +38,6 @@
import com.sun.tools.javac.api.*;
@SupportedAnnotationTypes("*")
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
public class T6412669 extends AbstractProcessor {
public static void main(String... args) throws IOException {
String testSrc = System.getProperty("test.src", ".");
@@ -72,4 +71,9 @@
}
return true;
}
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
}
--- a/langtools/test/tools/javac/enum/6424358/T6424358.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/enum/6424358/T6424358.java Mon Feb 15 20:06:11 2010 -0800
@@ -34,13 +34,12 @@
import javax.annotation.processing.*;
import javax.lang.model.element.*;
import javax.lang.model.util.*;
+import javax.lang.model.SourceVersion;
import static javax.tools.Diagnostic.Kind.*;
-import static javax.lang.model.SourceVersion.RELEASE_6;
@interface TestMe {}
@SupportedAnnotationTypes("*")
-@SupportedSourceVersion(RELEASE_6)
public class T6424358 extends AbstractProcessor {
@TestMe enum Test { FOO; }
@@ -66,4 +65,9 @@
scan.scan(e);
return true;
}
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
}
--- a/langtools/test/tools/javac/processing/6348499/A.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/processing/6348499/A.java Mon Feb 15 20:06:11 2010 -0800
@@ -28,7 +28,6 @@
import javax.lang.model.element.*;
@SupportedAnnotationTypes("*")
-@SupportedSourceVersion(SourceVersion.RELEASE_7)
public class A extends AbstractProcessor {
public boolean process(Set<? extends TypeElement> tes, RoundEnvironment renv) {
Filer filer = processingEnv.getFiler();
@@ -40,4 +39,8 @@
}
return true;
}
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
}
--- a/langtools/test/tools/javac/processing/6414633/A.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/processing/6414633/A.java Mon Feb 15 20:06:11 2010 -0800
@@ -30,7 +30,6 @@
import javax.tools.*;
@SupportedAnnotationTypes("*")
-@SupportedSourceVersion(SourceVersion.RELEASE_7)
public class A extends AbstractProcessor {
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
@@ -42,4 +41,9 @@
}
return true;
}
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
}
--- a/langtools/test/tools/javac/processing/6430209/T6430209.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/processing/6430209/T6430209.java Mon Feb 15 20:06:11 2010 -0800
@@ -63,7 +63,6 @@
new File(testSrc, "test0.java"), new File(testSrc, "test1.java")));
Iterable<String> opts = Arrays.asList("-proc:only",
"-processor", "b6341534",
- "-source", "1.6",
"-processorpath", testClasses);
StringWriter out = new StringWriter();
JavacTask task = tool.getTask(out, fm, dl, opts, null, files);
--- a/langtools/test/tools/javac/processing/6430209/b6341534.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/processing/6430209/b6341534.java Mon Feb 15 20:06:11 2010 -0800
@@ -22,6 +22,7 @@
*/
import javax.annotation.processing.*;
+import javax.lang.model.SourceVersion;
import javax.lang.model.element.*;
import javax.lang.model.util.*;
import static javax.lang.model.util.ElementFilter.*;
@@ -30,7 +31,6 @@
import java.util.Set;
@SupportedAnnotationTypes({"*"})
-@SupportedSourceVersion(javax.lang.model.SourceVersion.RELEASE_7)
public class b6341534 extends AbstractProcessor {
static int r = 0;
static Elements E = null;
@@ -62,4 +62,9 @@
if( renv.errorRaised() ) { msgr.printMessage(ERROR, "FAILED");}
return true;
}
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
}
--- a/langtools/test/tools/javac/processing/T6439826.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/processing/T6439826.java Mon Feb 15 20:06:11 2010 -0800
@@ -39,7 +39,6 @@
@SupportedAnnotationTypes("*")
-@SupportedSourceVersion(SourceVersion.RELEASE_7 )
public class T6439826 extends AbstractProcessor {
public static void main(String... args) {
String testSrc = System.getProperty("test.src", ".");
@@ -76,6 +75,11 @@
return false;
}
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
+
private void writeBadFile() {
Filer filer = processingEnv.getFiler();
Messager messager = processingEnv.getMessager();
--- a/langtools/test/tools/javac/processing/model/element/TypeParamBounds.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/processing/model/element/TypeParamBounds.java Mon Feb 15 20:06:11 2010 -0800
@@ -40,7 +40,6 @@
import javax.lang.model.type.*;
import javax.lang.model.util.*;
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedAnnotationTypes("*")
public class TypeParamBounds extends AbstractProcessor {
@@ -60,6 +59,11 @@
return true;
}
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
+
private void doit(Set<? extends TypeElement> annoTypes,
RoundEnvironment round) {
TypeElement gen = elements.getTypeElement("TypeParamBounds.Gen");
--- a/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java Mon Feb 15 20:06:11 2010 -0800
@@ -38,7 +38,6 @@
import javax.lang.model.util.*;
import static javax.lang.model.util.ElementFilter.*;
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedAnnotationTypes("IAm")
@IAm(OverEager.class)
public class OverEager extends AbstractProcessor {
@@ -59,6 +58,11 @@
return true;
}
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
+
private void doit(Set<? extends TypeElement> annoTypes,
RoundEnvironment round) {
for (TypeElement t : typesIn(round.getRootElements())) {
--- a/langtools/test/tools/javac/processing/model/type/NoTypes.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/processing/model/type/NoTypes.java Mon Feb 15 20:06:11 2010 -0800
@@ -39,8 +39,6 @@
import static javax.lang.model.type.TypeKind.*;
-
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedAnnotationTypes("*")
public class NoTypes extends AbstractProcessor {
@@ -60,6 +58,11 @@
return true;
}
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
+
private void doit(Set<? extends TypeElement> annoTypes,
RoundEnvironment round) {
--- a/langtools/test/tools/javac/processing/model/util/GetTypeElemBadArg.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/processing/model/util/GetTypeElemBadArg.java Mon Feb 15 20:06:11 2010 -0800
@@ -37,7 +37,6 @@
import javax.lang.model.type.*;
import javax.lang.model.util.*;
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedAnnotationTypes("*")
public class GetTypeElemBadArg extends AbstractProcessor {
@@ -64,6 +63,12 @@
return true;
}
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
+
private static void tellAbout(TypeElement t) {
System.out.println(t);
System.out.println(t.getClass());
--- a/langtools/test/tools/javac/processing/model/util/OverridesSpecEx.java Mon Feb 15 18:20:57 2010 -0800
+++ b/langtools/test/tools/javac/processing/model/util/OverridesSpecEx.java Mon Feb 15 20:06:11 2010 -0800
@@ -40,7 +40,6 @@
import static javax.lang.model.util.ElementFilter.*;
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedAnnotationTypes("*")
public class OverridesSpecEx extends AbstractProcessor {
@@ -60,6 +59,11 @@
return true;
}
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
+
private void doit(Set<? extends TypeElement> annoTypes,
RoundEnvironment round) {
TypeElement string = elements.getTypeElement("java.lang.String");