6926699: Annotation processing regression tests should typically return SourceVersion.latest

Mon, 15 Feb 2010 20:06:11 -0800

author
darcy
date
Mon, 15 Feb 2010 20:06:11 -0800
changeset 495
fe17a9dbef03
parent 494
af18e3956985
child 496
631a273dac0f

6926699: Annotation processing regression tests should typically return SourceVersion.latest
Reviewed-by: jjg

test/tools/javac/6341866/Anno.java file | annotate | diff | comparison | revisions
test/tools/javac/T6406771.java file | annotate | diff | comparison | revisions
test/tools/javac/T6411379.java file | annotate | diff | comparison | revisions
test/tools/javac/T6423583.java file | annotate | diff | comparison | revisions
test/tools/javac/T6855236.java file | annotate | diff | comparison | revisions
test/tools/javac/api/6421111/T6421111.java file | annotate | diff | comparison | revisions
test/tools/javac/api/6468404/T6468404.java file | annotate | diff | comparison | revisions
test/tools/javac/api/T6412669.java file | annotate | diff | comparison | revisions
test/tools/javac/enum/6424358/T6424358.java file | annotate | diff | comparison | revisions
test/tools/javac/processing/6348499/A.java file | annotate | diff | comparison | revisions
test/tools/javac/processing/6414633/A.java file | annotate | diff | comparison | revisions
test/tools/javac/processing/6430209/T6430209.java file | annotate | diff | comparison | revisions
test/tools/javac/processing/6430209/b6341534.java file | annotate | diff | comparison | revisions
test/tools/javac/processing/T6439826.java file | annotate | diff | comparison | revisions
test/tools/javac/processing/model/element/TypeParamBounds.java file | annotate | diff | comparison | revisions
test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java file | annotate | diff | comparison | revisions
test/tools/javac/processing/model/type/NoTypes.java file | annotate | diff | comparison | revisions
test/tools/javac/processing/model/util/GetTypeElemBadArg.java file | annotate | diff | comparison | revisions
test/tools/javac/processing/model/util/OverridesSpecEx.java file | annotate | diff | comparison | revisions
     1.1 --- a/test/tools/javac/6341866/Anno.java	Mon Feb 15 18:20:57 2010 -0800
     1.2 +++ b/test/tools/javac/6341866/Anno.java	Mon Feb 15 20:06:11 2010 -0800
     1.3 @@ -27,7 +27,6 @@
     1.4  import javax.lang.model.element.*;
     1.5  
     1.6  @SupportedAnnotationTypes("*")
     1.7 -    @SupportedSourceVersion(SourceVersion.RELEASE_7)
     1.8  public class Anno extends AbstractProcessor {
     1.9      public boolean process(Set<? extends TypeElement> annotations,
    1.10                                      RoundEnvironment roundEnv) {
    1.11 @@ -35,4 +34,9 @@
    1.12          //    System.err.println("annotation processing");
    1.13          return true;
    1.14      }
    1.15 +
    1.16 +    @Override
    1.17 +    public SourceVersion getSupportedSourceVersion() {
    1.18 +        return SourceVersion.latest();
    1.19 +    }
    1.20  }
     2.1 --- a/test/tools/javac/T6406771.java	Mon Feb 15 18:20:57 2010 -0800
     2.2 +++ b/test/tools/javac/T6406771.java	Mon Feb 15 20:06:11 2010 -0800
     2.3 @@ -17,7 +17,7 @@
     2.4  import com.sun.source.util.*;
     2.5  import com.sun.tools.javac.tree.JCTree;
     2.6  
     2.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
     2.8 +
     2.9  @SupportedAnnotationTypes("*")
    2.10  public class T6406771 extends AbstractProcessor {
    2.11      String[] tests = {
    2.12 @@ -95,4 +95,8 @@
    2.13          return true;
    2.14      }
    2.15  
    2.16 +    @Override
    2.17 +    public SourceVersion getSupportedSourceVersion() {
    2.18 +        return SourceVersion.latest();
    2.19 +    }
    2.20  }
     3.1 --- a/test/tools/javac/T6411379.java	Mon Feb 15 18:20:57 2010 -0800
     3.2 +++ b/test/tools/javac/T6411379.java	Mon Feb 15 20:06:11 2010 -0800
     3.3 @@ -37,7 +37,6 @@
     3.4  import com.sun.source.util.*;
     3.5  
     3.6  @SupportedAnnotationTypes("*")
     3.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
     3.8  public class T6411379 extends AbstractProcessor {
     3.9  
    3.10      public boolean process(Set<? extends TypeElement> annoElems,
    3.11 @@ -58,6 +57,11 @@
    3.12          return true;
    3.13      }
    3.14  
    3.15 +    @Override
    3.16 +    public SourceVersion getSupportedSourceVersion() {
    3.17 +        return SourceVersion.latest();
    3.18 +    }
    3.19 +
    3.20      public void checkNull(Object o) {
    3.21          if (o != null)
    3.22              throw new AssertionError("expected null");
     4.1 --- a/test/tools/javac/T6423583.java	Mon Feb 15 18:20:57 2010 -0800
     4.2 +++ b/test/tools/javac/T6423583.java	Mon Feb 15 20:06:11 2010 -0800
     4.3 @@ -37,7 +37,6 @@
     4.4  import com.sun.source.util.*;
     4.5  
     4.6  @SupportedAnnotationTypes("*")
     4.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
     4.8  public class T6423583 extends AbstractProcessor {
     4.9      boolean b1 = true;
    4.10      boolean b2 = false;
    4.11 @@ -59,6 +58,10 @@
    4.12          return true;
    4.13      }
    4.14  
    4.15 +    @Override
    4.16 +    public SourceVersion getSupportedSourceVersion() {
    4.17 +        return SourceVersion.latest();
    4.18 +    }
    4.19  
    4.20      private static class Test extends TreeScanner<Void,Void> {
    4.21  
     5.1 --- a/test/tools/javac/T6855236.java	Mon Feb 15 18:20:57 2010 -0800
     5.2 +++ b/test/tools/javac/T6855236.java	Mon Feb 15 20:06:11 2010 -0800
     5.3 @@ -38,7 +38,6 @@
     5.4  import com.sun.source.tree.*;
     5.5  import com.sun.source.util.*;
     5.6  
     5.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
     5.8  @SupportedAnnotationTypes("*")
     5.9  public class T6855236 extends AbstractProcessor {
    5.10  
    5.11 @@ -63,6 +62,11 @@
    5.12          return true;
    5.13      }
    5.14  
    5.15 +    @Override
    5.16 +    public SourceVersion getSupportedSourceVersion() {
    5.17 +        return SourceVersion.latest();
    5.18 +    }
    5.19 +
    5.20      class CodeVisitor extends TreePathScanner<Object, Trees> {
    5.21  
    5.22          @Override
     6.1 --- a/test/tools/javac/api/6421111/T6421111.java	Mon Feb 15 18:20:57 2010 -0800
     6.2 +++ b/test/tools/javac/api/6421111/T6421111.java	Mon Feb 15 20:06:11 2010 -0800
     6.3 @@ -76,7 +76,6 @@
     6.4              throw new AssertionError("Annotation processor failed");
     6.5      }
     6.6      @SupportedAnnotationTypes("*")
     6.7 -    @SupportedSourceVersion(SourceVersion.RELEASE_6)
     6.8      static class MyProcessor extends AbstractProcessor {
     6.9          void test(TypeElement element, boolean fbound) {
    6.10              TypeParameterElement tpe = element.getTypeParameters().iterator().next();
    6.11 @@ -96,6 +95,10 @@
    6.12              test(processingEnv.getElementUtils().getTypeElement("Test2"), true);
    6.13              return false;
    6.14          }
    6.15 +        @Override
    6.16 +        public SourceVersion getSupportedSourceVersion() {
    6.17 +            return SourceVersion.latest();
    6.18 +        }
    6.19      }
    6.20      public static void main(String... args) {
    6.21          new T6421111().test(args);
     7.1 --- a/test/tools/javac/api/6468404/T6468404.java	Mon Feb 15 18:20:57 2010 -0800
     7.2 +++ b/test/tools/javac/api/6468404/T6468404.java	Mon Feb 15 20:06:11 2010 -0800
     7.3 @@ -105,7 +105,6 @@
     7.4  }
     7.5  
     7.6  @SupportedAnnotationTypes("*")
     7.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
     7.8  class P extends AbstractProcessor {
     7.9      boolean ran = false;
    7.10  
    7.11 @@ -145,4 +144,9 @@
    7.12          }
    7.13          return true;
    7.14      }
    7.15 +
    7.16 +    @Override
    7.17 +    public SourceVersion getSupportedSourceVersion() {
    7.18 +        return SourceVersion.latest();
    7.19 +    }
    7.20  }
     8.1 --- a/test/tools/javac/api/T6412669.java	Mon Feb 15 18:20:57 2010 -0800
     8.2 +++ b/test/tools/javac/api/T6412669.java	Mon Feb 15 20:06:11 2010 -0800
     8.3 @@ -38,7 +38,6 @@
     8.4  import com.sun.tools.javac.api.*;
     8.5  
     8.6  @SupportedAnnotationTypes("*")
     8.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
     8.8  public class T6412669 extends AbstractProcessor {
     8.9      public static void main(String... args) throws IOException {
    8.10          String testSrc = System.getProperty("test.src", ".");
    8.11 @@ -72,4 +71,9 @@
    8.12          }
    8.13          return true;
    8.14      }
    8.15 +
    8.16 +    @Override
    8.17 +    public SourceVersion getSupportedSourceVersion() {
    8.18 +        return SourceVersion.latest();
    8.19 +    }
    8.20  }
     9.1 --- a/test/tools/javac/enum/6424358/T6424358.java	Mon Feb 15 18:20:57 2010 -0800
     9.2 +++ b/test/tools/javac/enum/6424358/T6424358.java	Mon Feb 15 20:06:11 2010 -0800
     9.3 @@ -34,13 +34,12 @@
     9.4  import javax.annotation.processing.*;
     9.5  import javax.lang.model.element.*;
     9.6  import javax.lang.model.util.*;
     9.7 +import javax.lang.model.SourceVersion;
     9.8  import static javax.tools.Diagnostic.Kind.*;
     9.9 -import static javax.lang.model.SourceVersion.RELEASE_6;
    9.10  
    9.11  @interface TestMe {}
    9.12  
    9.13  @SupportedAnnotationTypes("*")
    9.14 -@SupportedSourceVersion(RELEASE_6)
    9.15  public class T6424358 extends AbstractProcessor {
    9.16      @TestMe enum Test { FOO; }
    9.17  
    9.18 @@ -66,4 +65,9 @@
    9.19              scan.scan(e);
    9.20          return true;
    9.21      }
    9.22 +
    9.23 +    @Override
    9.24 +    public SourceVersion getSupportedSourceVersion() {
    9.25 +        return SourceVersion.latest();
    9.26 +    }
    9.27  }
    10.1 --- a/test/tools/javac/processing/6348499/A.java	Mon Feb 15 18:20:57 2010 -0800
    10.2 +++ b/test/tools/javac/processing/6348499/A.java	Mon Feb 15 20:06:11 2010 -0800
    10.3 @@ -28,7 +28,6 @@
    10.4  import javax.lang.model.element.*;
    10.5  
    10.6  @SupportedAnnotationTypes("*")
    10.7 -@SupportedSourceVersion(SourceVersion.RELEASE_7)
    10.8  public class A extends AbstractProcessor {
    10.9      public boolean process(Set<? extends TypeElement> tes, RoundEnvironment renv) {
   10.10          Filer filer = processingEnv.getFiler();
   10.11 @@ -40,4 +39,8 @@
   10.12          }
   10.13          return true;
   10.14      }
   10.15 +    @Override
   10.16 +    public SourceVersion getSupportedSourceVersion() {
   10.17 +        return SourceVersion.latest();
   10.18 +    }
   10.19  }
    11.1 --- a/test/tools/javac/processing/6414633/A.java	Mon Feb 15 18:20:57 2010 -0800
    11.2 +++ b/test/tools/javac/processing/6414633/A.java	Mon Feb 15 20:06:11 2010 -0800
    11.3 @@ -30,7 +30,6 @@
    11.4  import javax.tools.*;
    11.5  
    11.6  @SupportedAnnotationTypes("*")
    11.7 -@SupportedSourceVersion(SourceVersion.RELEASE_7)
    11.8  public class A extends AbstractProcessor {
    11.9  
   11.10      public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
   11.11 @@ -42,4 +41,9 @@
   11.12          }
   11.13          return true;
   11.14      }
   11.15 +
   11.16 +    @Override
   11.17 +    public SourceVersion getSupportedSourceVersion() {
   11.18 +        return SourceVersion.latest();
   11.19 +    }
   11.20  }
    12.1 --- a/test/tools/javac/processing/6430209/T6430209.java	Mon Feb 15 18:20:57 2010 -0800
    12.2 +++ b/test/tools/javac/processing/6430209/T6430209.java	Mon Feb 15 20:06:11 2010 -0800
    12.3 @@ -63,7 +63,6 @@
    12.4              new File(testSrc, "test0.java"), new File(testSrc, "test1.java")));
    12.5          Iterable<String> opts = Arrays.asList("-proc:only",
    12.6                                                "-processor", "b6341534",
    12.7 -                                              "-source", "1.6",
    12.8                                                "-processorpath", testClasses);
    12.9          StringWriter out = new StringWriter();
   12.10          JavacTask task = tool.getTask(out, fm, dl, opts, null, files);
    13.1 --- a/test/tools/javac/processing/6430209/b6341534.java	Mon Feb 15 18:20:57 2010 -0800
    13.2 +++ b/test/tools/javac/processing/6430209/b6341534.java	Mon Feb 15 20:06:11 2010 -0800
    13.3 @@ -22,6 +22,7 @@
    13.4   */
    13.5  
    13.6  import javax.annotation.processing.*;
    13.7 +import javax.lang.model.SourceVersion;
    13.8  import javax.lang.model.element.*;
    13.9  import javax.lang.model.util.*;
   13.10  import static javax.lang.model.util.ElementFilter.*;
   13.11 @@ -30,7 +31,6 @@
   13.12  import java.util.Set;
   13.13  
   13.14  @SupportedAnnotationTypes({"*"})
   13.15 -@SupportedSourceVersion(javax.lang.model.SourceVersion.RELEASE_7)
   13.16  public class b6341534 extends AbstractProcessor {
   13.17      static int r = 0;
   13.18      static Elements E = null;
   13.19 @@ -62,4 +62,9 @@
   13.20          if( renv.errorRaised() ) {      msgr.printMessage(ERROR, "FAILED");}
   13.21          return true;
   13.22      }
   13.23 +
   13.24 +    @Override
   13.25 +    public SourceVersion getSupportedSourceVersion() {
   13.26 +        return SourceVersion.latest();
   13.27 +    }
   13.28  }
    14.1 --- a/test/tools/javac/processing/T6439826.java	Mon Feb 15 18:20:57 2010 -0800
    14.2 +++ b/test/tools/javac/processing/T6439826.java	Mon Feb 15 20:06:11 2010 -0800
    14.3 @@ -39,7 +39,6 @@
    14.4  
    14.5  
    14.6  @SupportedAnnotationTypes("*")
    14.7 -@SupportedSourceVersion(SourceVersion.RELEASE_7 )
    14.8  public class T6439826 extends AbstractProcessor {
    14.9      public static void main(String... args) {
   14.10          String testSrc = System.getProperty("test.src", ".");
   14.11 @@ -76,6 +75,11 @@
   14.12          return false;
   14.13      }
   14.14  
   14.15 +    @Override
   14.16 +    public SourceVersion getSupportedSourceVersion() {
   14.17 +        return SourceVersion.latest();
   14.18 +    }
   14.19 +
   14.20      private void writeBadFile() {
   14.21          Filer filer = processingEnv.getFiler();
   14.22          Messager messager = processingEnv.getMessager();
    15.1 --- a/test/tools/javac/processing/model/element/TypeParamBounds.java	Mon Feb 15 18:20:57 2010 -0800
    15.2 +++ b/test/tools/javac/processing/model/element/TypeParamBounds.java	Mon Feb 15 20:06:11 2010 -0800
    15.3 @@ -40,7 +40,6 @@
    15.4  import javax.lang.model.type.*;
    15.5  import javax.lang.model.util.*;
    15.6  
    15.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
    15.8  @SupportedAnnotationTypes("*")
    15.9  public class TypeParamBounds extends AbstractProcessor {
   15.10  
   15.11 @@ -60,6 +59,11 @@
   15.12          return true;
   15.13      }
   15.14  
   15.15 +    @Override
   15.16 +    public SourceVersion getSupportedSourceVersion() {
   15.17 +        return SourceVersion.latest();
   15.18 +    }
   15.19 +
   15.20      private void doit(Set<? extends TypeElement> annoTypes,
   15.21                        RoundEnvironment round) {
   15.22          TypeElement gen = elements.getTypeElement("TypeParamBounds.Gen");
    16.1 --- a/test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java	Mon Feb 15 18:20:57 2010 -0800
    16.2 +++ b/test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java	Mon Feb 15 20:06:11 2010 -0800
    16.3 @@ -38,7 +38,6 @@
    16.4  import javax.lang.model.util.*;
    16.5  import static javax.lang.model.util.ElementFilter.*;
    16.6  
    16.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
    16.8  @SupportedAnnotationTypes("IAm")
    16.9  @IAm(OverEager.class)
   16.10  public class OverEager extends AbstractProcessor {
   16.11 @@ -59,6 +58,11 @@
   16.12          return true;
   16.13      }
   16.14  
   16.15 +    @Override
   16.16 +    public SourceVersion getSupportedSourceVersion() {
   16.17 +        return SourceVersion.latest();
   16.18 +    }
   16.19 +
   16.20      private void doit(Set<? extends TypeElement> annoTypes,
   16.21                        RoundEnvironment round) {
   16.22          for (TypeElement t : typesIn(round.getRootElements())) {
    17.1 --- a/test/tools/javac/processing/model/type/NoTypes.java	Mon Feb 15 18:20:57 2010 -0800
    17.2 +++ b/test/tools/javac/processing/model/type/NoTypes.java	Mon Feb 15 20:06:11 2010 -0800
    17.3 @@ -39,8 +39,6 @@
    17.4  
    17.5  import static javax.lang.model.type.TypeKind.*;
    17.6  
    17.7 -
    17.8 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
    17.9  @SupportedAnnotationTypes("*")
   17.10  public class NoTypes extends AbstractProcessor {
   17.11  
   17.12 @@ -60,6 +58,11 @@
   17.13          return true;
   17.14      }
   17.15  
   17.16 +    @Override
   17.17 +    public SourceVersion getSupportedSourceVersion() {
   17.18 +        return SourceVersion.latest();
   17.19 +    }
   17.20 +
   17.21      private void doit(Set<? extends TypeElement> annoTypes,
   17.22                        RoundEnvironment round) {
   17.23  
    18.1 --- a/test/tools/javac/processing/model/util/GetTypeElemBadArg.java	Mon Feb 15 18:20:57 2010 -0800
    18.2 +++ b/test/tools/javac/processing/model/util/GetTypeElemBadArg.java	Mon Feb 15 20:06:11 2010 -0800
    18.3 @@ -37,7 +37,6 @@
    18.4  import javax.lang.model.type.*;
    18.5  import javax.lang.model.util.*;
    18.6  
    18.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
    18.8  @SupportedAnnotationTypes("*")
    18.9  public class GetTypeElemBadArg extends AbstractProcessor {
   18.10  
   18.11 @@ -64,6 +63,12 @@
   18.12          return true;
   18.13      }
   18.14  
   18.15 +
   18.16 +    @Override
   18.17 +    public SourceVersion getSupportedSourceVersion() {
   18.18 +        return SourceVersion.latest();
   18.19 +    }
   18.20 +
   18.21      private static void tellAbout(TypeElement t) {
   18.22          System.out.println(t);
   18.23          System.out.println(t.getClass());
    19.1 --- a/test/tools/javac/processing/model/util/OverridesSpecEx.java	Mon Feb 15 18:20:57 2010 -0800
    19.2 +++ b/test/tools/javac/processing/model/util/OverridesSpecEx.java	Mon Feb 15 20:06:11 2010 -0800
    19.3 @@ -40,7 +40,6 @@
    19.4  import static javax.lang.model.util.ElementFilter.*;
    19.5  
    19.6  
    19.7 -@SupportedSourceVersion(SourceVersion.RELEASE_6)
    19.8  @SupportedAnnotationTypes("*")
    19.9  public class OverridesSpecEx extends AbstractProcessor {
   19.10  
   19.11 @@ -60,6 +59,11 @@
   19.12          return true;
   19.13      }
   19.14  
   19.15 +    @Override
   19.16 +    public SourceVersion getSupportedSourceVersion() {
   19.17 +        return SourceVersion.latest();
   19.18 +    }
   19.19 +
   19.20      private void doit(Set<? extends TypeElement> annoTypes,
   19.21                        RoundEnvironment round) {
   19.22          TypeElement string = elements.getTypeElement("java.lang.String");

mercurial