test/tools/javac/enum/6424358/T6424358.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -21,36 +21,37 @@
  * questions.
  */
 
 /*
  * @test
- * @bug     6424358
+ * @bug     6424358 7025809
  * @summary Synthesized static enum method values() is final
  * @author  Peter von der Ah\u00e9
- * @compile T6424358.java
+ * @library ../../lib
+ * @build   JavacTestingAbstractProcessor T6424358
  * @compile -processor T6424358 -proc:only T6424358.java
  */
 
 import java.util.Set;
 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 JavacTestingAbstractProcessor.*;
 
 @interface TestMe {}
 
-@SupportedAnnotationTypes("*")
-public class T6424358 extends AbstractProcessor {
+public class T6424358 extends JavacTestingAbstractProcessor {
     @TestMe enum Test { FOO; }
 
     public boolean process(Set<? extends TypeElement> annotations,
                            RoundEnvironment roundEnvironment) {
         final Messager log = processingEnv.getMessager();
         final Elements elements = processingEnv.getElementUtils();
         final TypeElement testMe = elements.getTypeElement("TestMe");
-        class Scan extends ElementScanner7<Void,Void> {
+        class Scan extends ElementScanner<Void,Void> {
             @Override
             public Void visitExecutable(ExecutableElement e, Void p) {
                 System.err.println("Looking at " + e);
                 if ("values".contentEquals(e.getSimpleName()) &&
                     e.getModifiers().contains(Modifier.FINAL)) {

@@ -63,11 +64,6 @@
         Scan scan = new Scan();
         for (Element e : roundEnvironment.getElementsAnnotatedWith(testMe))
             scan.scan(e);
         return true;
     }
-
-    @Override
-    public SourceVersion getSupportedSourceVersion() {
-        return SourceVersion.latest();
-    }
 }