--- old/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java 2010-06-02 18:10:58.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java 2010-06-02 18:10:58.000000000 -0700 @@ -745,7 +745,7 @@ * Leave class public for external testing purposes. */ public static class ComputeAnnotationSet extends - ElementScanner6, Set> { + ElementScanner7, Set> { final Elements elements; public ComputeAnnotationSet(Elements elements) { --- old/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java 2010-06-02 18:10:59.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java 2010-06-02 18:10:58.000000000 -0700 @@ -125,7 +125,7 @@ else throw new AssertionError("Bad implementation type for " + tm); - ElementScanner6, DeclaredType> scanner = + ElementScanner7, DeclaredType> scanner = new AnnotationSetScanner(result, typeUtil); for (Element element : rootElements) @@ -136,7 +136,7 @@ // Could be written as a local class inside getElementsAnnotatedWith private class AnnotationSetScanner extends - ElementScanner6, DeclaredType> { + ElementScanner7, DeclaredType> { // Insertion-order preserving set Set annotatedElements = new LinkedHashSet(); Types typeUtil; --- old/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java 2010-06-02 18:10:59.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java 2010-06-02 18:10:59.000000000 -0700 @@ -83,7 +83,7 @@ * Used for the -Xprint option and called by Elements.printElements */ public static class PrintingElementVisitor - extends SimpleElementVisitor6 { + extends SimpleElementVisitor7 { int indentation; // Indentation level; final PrintWriter writer; final Elements elementUtils; @@ -117,7 +117,7 @@ enclosing != null && NestingKind.ANONYMOUS == // Use an anonymous class to determine anonymity! - (new SimpleElementVisitor6() { + (new SimpleElementVisitor7() { @Override public NestingKind visitType(TypeElement e, Void p) { return e.getNestingKind(); --- old/src/share/classes/com/sun/tools/javah/JavahTask.java 2010-06-02 18:11:00.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javah/JavahTask.java 2010-06-02 18:11:00.000000000 -0700 @@ -59,7 +59,7 @@ import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVisitor; import javax.lang.model.util.ElementFilter; -import javax.lang.model.util.SimpleTypeVisitor6; +import javax.lang.model.util.SimpleTypeVisitor7; import javax.lang.model.util.Types; import javax.tools.Diagnostic; @@ -705,7 +705,7 @@ } private TypeVisitor checkMethodParametersVisitor = - new SimpleTypeVisitor6() { + new SimpleTypeVisitor7() { @Override public Void visitArray(ArrayType t, Types types) { visit(t.getComponentType(), types); --- old/src/share/classes/com/sun/tools/javah/LLNI.java 2010-06-02 18:11:01.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javah/LLNI.java 2010-06-02 18:11:01.000000000 -0700 @@ -45,7 +45,7 @@ import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVisitor; import javax.lang.model.util.ElementFilter; -import javax.lang.model.util.SimpleTypeVisitor6; +import javax.lang.model.util.SimpleTypeVisitor7; /* *

This is NOT part of any API supported by Sun Microsystems. @@ -620,7 +620,7 @@ } protected final boolean isLongOrDouble(TypeMirror t) { - TypeVisitor v = new SimpleTypeVisitor6() { + TypeVisitor v = new SimpleTypeVisitor7() { public Boolean defaultAction(TypeMirror t, Void p){ return false; } --- old/src/share/classes/com/sun/tools/javah/TypeSignature.java 2010-06-02 18:11:02.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javah/TypeSignature.java 2010-06-02 18:11:02.000000000 -0700 @@ -38,7 +38,7 @@ import javax.lang.model.type.TypeVariable; import javax.lang.model.type.TypeVisitor; import javax.lang.model.util.Elements; -import javax.lang.model.util.SimpleTypeVisitor6; +import javax.lang.model.util.SimpleTypeVisitor7; /** * Returns internal type signature. @@ -239,7 +239,7 @@ String qualifiedTypeName(TypeMirror type) { - TypeVisitor v = new SimpleTypeVisitor6() { + TypeVisitor v = new SimpleTypeVisitor7() { @Override public Name visitArray(ArrayType t, Void p) { return t.getComponentType().accept(this, p); --- old/src/share/classes/javax/lang/model/element/ElementVisitor.java 2010-06-02 18:11:03.000000000 -0700 +++ new/src/share/classes/javax/lang/model/element/ElementVisitor.java 2010-06-02 18:11:03.000000000 -0700 @@ -62,6 +62,7 @@ * @author Scott Seligman * @author Peter von der Ahé * @see AbstractElementVisitor6 + * @see AbstractElementVisitor7 * @since 1.6 */ public interface ElementVisitor { --- old/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java 2010-06-02 18:11:04.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java 2010-06-02 18:11:03.000000000 -0700 @@ -62,6 +62,8 @@ * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ahé + * + * @see AbstractAnnotationValueVisitor7 * @since 1.6 */ @SupportedSourceVersion(RELEASE_6) --- old/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java 2010-06-02 18:11:04.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java 2010-06-02 18:11:04.000000000 -0700 @@ -65,6 +65,8 @@ * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ahé + * + * @see AbstractElementVisitor7 * @since 1.6 */ @SupportedSourceVersion(RELEASE_6) --- old/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java 2010-06-02 18:11:05.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java 2010-06-02 18:11:05.000000000 -0700 @@ -57,6 +57,8 @@ * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ahé + * + * @see AbstractTypeVisitor7 * @since 1.6 */ public abstract class AbstractTypeVisitor6 implements TypeVisitor { --- old/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java 2010-06-02 18:11:06.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java 2010-06-02 18:11:06.000000000 -0700 @@ -76,6 +76,8 @@ * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ahé + * + * @see ElementKindVisitor7 * @since 1.6 */ @SupportedSourceVersion(RELEASE_6) --- old/src/share/classes/javax/lang/model/util/ElementScanner6.java 2010-06-02 18:11:06.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/ElementScanner6.java 2010-06-02 18:11:06.000000000 -0700 @@ -88,6 +88,8 @@ * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ahé + * + * @see ElementScanner7 * @since 1.6 */ @SupportedSourceVersion(RELEASE_6) --- old/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java 2010-06-02 18:11:07.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java 2010-06-02 18:11:07.000000000 -0700 @@ -69,6 +69,8 @@ * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ahé + * + * @see SimpleAnnotationValueVisitor7 * @since 1.6 */ @SupportedSourceVersion(RELEASE_6) --- old/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java 2010-06-02 18:11:08.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java 2010-06-02 18:11:08.000000000 -0700 @@ -71,6 +71,8 @@ * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ahé + * + * @see SimpleElementVisitor7 * @since 1.6 */ @SupportedSourceVersion(RELEASE_6) --- old/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java 2010-06-02 18:11:09.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java 2010-06-02 18:11:09.000000000 -0700 @@ -70,6 +70,8 @@ * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ahé + * + * @see SimpleTypeVisitor7 * @since 1.6 */ @SupportedSourceVersion(RELEASE_6) --- old/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java 2010-06-02 18:11:09.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java 2010-06-02 18:11:09.000000000 -0700 @@ -74,6 +74,8 @@ * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ahé + * + * @see TypeKindVisitor7 * @since 1.6 */ @SupportedSourceVersion(RELEASE_6) --- old/src/share/sample/javac/processing/src/CheckNamesProcessor.java 2010-06-02 18:11:10.000000000 -0700 +++ new/src/share/sample/javac/processing/src/CheckNamesProcessor.java 2010-06-02 18:11:10.000000000 -0700 @@ -138,7 +138,7 @@ public SourceVersion getSupportedSourceVersion() { /* * Return latest source version instead of a fixed version - * like RELEASE_6. To return a fixed version, this class + * like RELEASE_7. To return a fixed version, this class * could be annotated with a SupportedSourceVersion * annotation. * @@ -190,7 +190,7 @@ /** * Visitor to implement name checks. */ - private class NameCheckScanner extends ElementScanner6 { + private class NameCheckScanner extends ElementScanner7 { // The visitor could be enhanced to return true/false if // there were warnings reported or a count of the number // of warnings. This could be facilitated by using @@ -312,7 +312,7 @@ @Override public Void visitUnknown(Element e, Void p) { // This method will be called if a kind of element - // added after JDK 6 is visited. Since as of this + // added after JDK 7 is visited. Since as of this // writing the conventions for such constructs aren't // known, issue a warning. messager.printMessage(WARNING, --- old/test/tools/javac/6402516/CheckLocalElements.java 2010-06-02 18:11:11.000000000 -0700 +++ new/test/tools/javac/6402516/CheckLocalElements.java 2010-06-02 18:11:11.000000000 -0700 @@ -95,7 +95,7 @@ return encl == null ? "" : encl.accept(qualNameVisitor, null); } - private ElementVisitor qualNameVisitor = new SimpleElementVisitor6() { + private ElementVisitor qualNameVisitor = new SimpleElementVisitor7() { protected String defaultAction(Element e, Void ignore) { return ""; } --- old/test/tools/javac/api/TestOperators.java 2010-06-02 18:11:12.000000000 -0700 +++ new/test/tools/javac/api/TestOperators.java 2010-06-02 18:11:11.000000000 -0700 @@ -299,7 +299,7 @@ final Trees trees = Trees.instance(processingEnv); final Messager log = processingEnv.getMessager(); final Elements elements = processingEnv.getElementUtils(); - class Scan extends ElementScanner6 { + class Scan extends ElementScanner7 { @Override public Void visitExecutable(ExecutableElement e, Void p) { Object debug = e; // info for exception handler --- old/test/tools/javac/enum/6424358/T6424358.java 2010-06-02 18:11:13.000000000 -0700 +++ new/test/tools/javac/enum/6424358/T6424358.java 2010-06-02 18:11:12.000000000 -0700 @@ -48,7 +48,7 @@ final Messager log = processingEnv.getMessager(); final Elements elements = processingEnv.getElementUtils(); final TypeElement testMe = elements.getTypeElement("TestMe"); - class Scan extends ElementScanner6 { + class Scan extends ElementScanner7 { @Override public Void visitExecutable(ExecutableElement e, Void p) { System.err.println("Looking at " + e); --- old/test/tools/javac/processing/model/6194785/T6194785.java 2010-06-02 18:11:13.000000000 -0700 +++ new/test/tools/javac/processing/model/6194785/T6194785.java 2010-06-02 18:11:13.000000000 -0700 @@ -43,7 +43,7 @@ { final Messager log = processingEnv.getMessager(); final Elements elements = processingEnv.getElementUtils(); - class Scan extends ElementScanner6 { + class Scan extends ElementScanner7 { @Override public Void visitExecutable(ExecutableElement e, Void ignored) { for (VariableElement p : e.getParameters()) --- old/test/tools/javac/processing/model/type/NoTypes.java 2010-06-02 18:11:14.000000000 -0700 +++ new/test/tools/javac/processing/model/type/NoTypes.java 2010-06-02 18:11:14.000000000 -0700 @@ -89,7 +89,7 @@ verifyKind(NONE, types.getNoType(NONE)); // The return type of a constructor or void method is VOID. - class Scanner extends ElementScanner6 { + class Scanner extends ElementScanner7 { @Override public Void visitExecutable(ExecutableElement e, Void p) { verifyKind(VOID, e.getReturnType()); @@ -104,10 +104,10 @@ /** * Verify that a NoType instance is of a particular kind, - * and that TypeKindVisitor6 properly dispatches on it. + * and that TypeKindVisitor7 properly dispatches on it. */ private void verifyKind(TypeKind kind, TypeMirror type) { - class Vis extends TypeKindVisitor6 { + class Vis extends TypeKindVisitor7 { @Override public TypeKind visitNoTypeAsVoid(NoType t, Void p) { return VOID; --- old/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java 2010-06-02 18:11:15.000000000 -0700 +++ new/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java 2010-06-02 18:11:15.000000000 -0700 @@ -67,7 +67,7 @@ return true; } - private class DeprecationChecker extends ElementScanner6 { + private class DeprecationChecker extends ElementScanner7 { private Elements elementUtils; private boolean failure; DeprecationChecker() { --- /dev/null 2009-08-12 17:12:33.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java 2010-06-02 18:11:16.000000000 -0700 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.lang.model.util; + +import java.util.List; +import javax.lang.model.element.*; + +import javax.lang.model.type.TypeMirror; +import static javax.lang.model.SourceVersion.*; +import javax.lang.model.SourceVersion; +import javax.annotation.processing.SupportedSourceVersion; + +/** + * A skeletal visitor for annotation values with default behavior + * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7} + * source version. + * + *

WARNING: The {@code AnnotationValueVisitor} interface + * implemented by this class may have methods added to it in the + * future to accommodate new, currently unknown, language structures + * added to future versions of the Java™ programming language. + * Therefore, methods whose names begin with {@code "visit"} may be + * added to this class in the future; to avoid incompatibilities, + * classes which extend this class should not declare any instance + * methods with names beginning with {@code "visit"}. + * + *

When such a new visit method is added, the default + * implementation in this class will be to call the {@link + * #visitUnknown visitUnknown} method. A new abstract annotation + * value visitor class will also be introduced to correspond to the + * new language level; this visitor will have different default + * behavior for the visit method in question. When the new visitor is + * introduced, all or portions of this visitor may be deprecated. + * + * @param the return type of this visitor's methods + * @param

the type of the additional parameter to this visitor's methods. + * + * @see AbstractAnnotationValueVisitor6 + * @since 1.7 + */ +@SupportedSourceVersion(RELEASE_7) +public abstract class AbstractAnnotationValueVisitor7 extends AbstractAnnotationValueVisitor6 { + + /** + * Constructor for concrete subclasses to call. + */ + protected AbstractAnnotationValueVisitor7() { + super(); + } +} --- /dev/null 2009-08-12 17:12:33.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/AbstractElementVisitor7.java 2010-06-02 18:11:16.000000000 -0700 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.lang.model.util; + +import javax.lang.model.element.*; +import javax.annotation.processing.SupportedSourceVersion; +import javax.lang.model.element.*; +import static javax.lang.model.element.ElementKind.*; +import static javax.lang.model.SourceVersion.*; +import javax.lang.model.SourceVersion; + + +/** + * A skeletal visitor of program elements with default behavior + * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7} + * source version. + * + *

WARNING: The {@code ElementVisitor} interface + * implemented by this class may have methods added to it in the + * future to accommodate new, currently unknown, language structures + * added to future versions of the Java™ programming language. + * Therefore, methods whose names begin with {@code "visit"} may be + * added to this class in the future; to avoid incompatibilities, + * classes which extend this class should not declare any instance + * methods with names beginning with {@code "visit"}. + * + *

When such a new visit method is added, the default + * implementation in this class will be to call the {@link + * #visitUnknown visitUnknown} method. A new abstract element visitor + * class will also be introduced to correspond to the new language + * level; this visitor will have different default behavior for the + * visit method in question. When the new visitor is introduced, all + * or portions of this visitor may be deprecated. + * + * @param the return type of this visitor's methods. Use {@link + * Void} for visitors that do not need to return results. + * @param

the type of the additional parameter to this visitor's + * methods. Use {@code Void} for visitors that do not need an + * additional parameter. + * + * @see AbstractElementVisitor6 + * @since 1.7 + */ +@SupportedSourceVersion(RELEASE_7) +public abstract class AbstractElementVisitor7 extends AbstractElementVisitor6 { + /** + * Constructor for concrete subclasses to call. + */ + protected AbstractElementVisitor7(){ + super(); + } +} --- /dev/null 2009-08-12 17:12:33.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java 2010-06-02 18:11:17.000000000 -0700 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.lang.model.util; + +import javax.lang.model.type.*; + +/** + * A skeletal visitor of types with default behavior appropriate for + * the version 7 language level. + * + *

WARNING: The {@code TypeVisitor} interface implemented + * by this class may have methods added to it in the future to + * accommodate new, currently unknown, language structures added to + * future versions of the Java™ programming language. + * Therefore, methods whose names begin with {@code "visit"} may be + * added to this class in the future; to avoid incompatibilities, + * classes which extend this class should not declare any instance + * methods with names beginning with {@code "visit"}. + * + *

When such a new visit method is added, the default + * implementation in this class will be to call the {@link + * #visitUnknown visitUnknown} method. A new abstract type visitor + * class will also be introduced to correspond to the new language + * level; this visitor will have different default behavior for the + * visit method in question. When the new visitor is introduced, all + * or portions of this visitor may be deprecated. + * + * @param the return type of this visitor's methods. Use {@link + * Void} for visitors that do not need to return results. + * @param

the type of the additional parameter to this visitor's + * methods. Use {@code Void} for visitors that do not need an + * additional parameter. + * + * @see AbstractTypeVisitor6 + * @since 1.7 + */ +public abstract class AbstractTypeVisitor7 extends AbstractTypeVisitor6 { + /** + * Constructor for concrete subclasses to call. + */ + protected AbstractTypeVisitor7() { + super(); + } +} --- /dev/null 2009-08-12 17:12:33.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java 2010-06-02 18:11:18.000000000 -0700 @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2010, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.lang.model.util; + +import javax.lang.model.element.*; +import static javax.lang.model.element.ElementKind.*; +import javax.annotation.processing.SupportedSourceVersion; +import static javax.lang.model.SourceVersion.*; +import javax.lang.model.SourceVersion; + +/** + * A visitor of program elements based on their {@linkplain + * ElementKind kind} with default behavior appropriate for the {@link + * SourceVersion#RELEASE_6 RELEASE_6} source version. For {@linkplain + * Element elements} XYZ that may have more than one + * kind, the visitXYZ methods in this class delegate + * to the visitXYZKind method corresponding to the + * first argument's kind. The visitXYZKind methods + * call {@link #defaultAction defaultAction}, passing their arguments + * to {@code defaultAction}'s corresponding parameters. + * + *

Methods in this class may be overridden subject to their + * general contract. Note that annotating methods in concrete + * subclasses with {@link java.lang.Override @Override} will help + * ensure that methods are overridden as intended. + * + *

WARNING: The {@code ElementVisitor} interface + * implemented by this class may have methods added to it or the + * {@code ElementKind} {@code enum} used in this case may have + * constants added to it in the future to accommodate new, currently + * unknown, language structures added to future versions of the + * Java™ programming language. Therefore, methods whose names + * begin with {@code "visit"} may be added to this class in the + * future; to avoid incompatibilities, classes which extend this class + * should not declare any instance methods with names beginning with + * {@code "visit"}. + * + *

When such a new visit method is added, the default + * implementation in this class will be to call the {@link + * #visitUnknown visitUnknown} method. A new abstract element kind + * visitor class will also be introduced to correspond to the new + * language level; this visitor will have different default behavior + * for the visit method in question. When the new visitor is + * introduced, all or portions of this visitor may be deprecated. + * + * @param the return type of this visitor's methods. Use {@link + * Void} for visitors that do not need to return results. + * @param

the type of the additional parameter to this visitor's + * methods. Use {@code Void} for visitors that do not need an + * additional parameter. + * + * @see ElementKindVisitor6 + * @since 1.7 + */ +@SupportedSourceVersion(RELEASE_7) +public class ElementKindVisitor7 extends ElementKindVisitor6 { + /** + * Constructor for concrete subclasses; uses {@code null} for the + * default value. + */ + protected ElementKindVisitor7() { + super(null); + } + + /** + * Constructor for concrete subclasses; uses the argument for the + * default value. + * + * @param defaultValue the value to assign to {@link #DEFAULT_VALUE} + */ + protected ElementKindVisitor7(R defaultValue) { + super(defaultValue); + } +} --- /dev/null 2009-08-12 17:12:33.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/ElementScanner7.java 2010-06-02 18:11:18.000000000 -0700 @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2010, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.lang.model.util; + +import javax.lang.model.element.*; +import javax.annotation.processing.SupportedSourceVersion; +import static javax.lang.model.element.ElementKind.*; +import javax.lang.model.SourceVersion; +import static javax.lang.model.SourceVersion.*; + + +/** + * A scanning visitor of program elements with default behavior + * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7} + * source version. The visitXYZ methods in this + * class scan their component elements by calling {@code scan} on + * their {@linkplain Element#getEnclosedElements enclosed elements}, + * {@linkplain ExecutableElement#getParameters parameters}, etc., as + * indicated in the individual method specifications. A subclass can + * control the order elements are visited by overriding the + * visitXYZ methods. Note that clients of a scanner + * may get the desired behavior be invoking {@code v.scan(e, p)} rather + * than {@code v.visit(e, p)} on the root objects of interest. + * + *

When a subclass overrides a visitXYZ method, the + * new method can cause the enclosed elements to be scanned in the + * default way by calling super.visitXYZ. In this + * fashion, the concrete visitor can control the ordering of traversal + * over the component elements with respect to the additional + * processing; for example, consistently calling + * super.visitXYZ at the start of the overridden + * methods will yield a preorder traversal, etc. If the component + * elements should be traversed in some other order, instead of + * calling super.visitXYZ, an overriding visit method + * should call {@code scan} with the elements in the desired order. + * + *

Methods in this class may be overridden subject to their + * general contract. Note that annotating methods in concrete + * subclasses with {@link java.lang.Override @Override} will help + * ensure that methods are overridden as intended. + * + *

WARNING: The {@code ElementVisitor} interface + * implemented by this class may have methods added to it in the + * future to accommodate new, currently unknown, language structures + * added to future versions of the Java™ programming language. + * Therefore, methods whose names begin with {@code "visit"} may be + * added to this class in the future; to avoid incompatibilities, + * classes which extend this class should not declare any instance + * methods with names beginning with {@code "visit"}. + * + *

When such a new visit method is added, the default + * implementation in this class will be to call the {@link + * #visitUnknown visitUnknown} method. A new element scanner visitor + * class will also be introduced to correspond to the new language + * level; this visitor will have different default behavior for the + * visit method in question. When the new visitor is introduced, all + * or portions of this visitor may be deprecated. + * + * @param the return type of this visitor's methods. Use {@link + * Void} for visitors that do not need to return results. + * @param

the type of the additional parameter to this visitor's + * methods. Use {@code Void} for visitors that do not need an + * additional parameter. + * + * @see ElementScanner6 + * @since 1.7 + */ +@SupportedSourceVersion(RELEASE_7) +public class ElementScanner7 extends ElementScanner6 { + /** + * Constructor for concrete subclasses; uses {@code null} for the + * default value. + */ + protected ElementScanner7(){ + super(null); + } + + /** + * Constructor for concrete subclasses; uses the argument for the + * default value. + */ + protected ElementScanner7(R defaultValue){ + super(defaultValue); + } +} --- /dev/null 2009-08-12 17:12:33.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java 2010-06-02 18:11:19.000000000 -0700 @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2010, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.lang.model.util; + +import java.util.List; +import javax.lang.model.element.*; + +import javax.lang.model.type.TypeMirror; +import static javax.lang.model.SourceVersion.*; +import javax.lang.model.SourceVersion; +import javax.annotation.processing.SupportedSourceVersion; + +/** + * A simple visitor for annotation values with default behavior + * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7} + * source version. Visit methods call {@link + * #defaultAction} passing their arguments to {@code defaultAction}'s + * corresponding parameters. + * + *

Methods in this class may be overridden subject to their + * general contract. Note that annotating methods in concrete + * subclasses with {@link java.lang.Override @Override} will help + * ensure that methods are overridden as intended. + * + *

WARNING: The {@code AnnotationValueVisitor} interface + * implemented by this class may have methods added to it in the + * future to accommodate new, currently unknown, language structures + * added to future versions of the Java™ programming language. + * Therefore, methods whose names begin with {@code "visit"} may be + * added to this class in the future; to avoid incompatibilities, + * classes which extend this class should not declare any instance + * methods with names beginning with {@code "visit"}. + * + *

When such a new visit method is added, the default + * implementation in this class will be to call the {@link + * #visitUnknown visitUnknown} method. A new simple annotation + * value visitor class will also be introduced to correspond to the + * new language level; this visitor will have different default + * behavior for the visit method in question. When the new visitor is + * introduced, all or portions of this visitor may be deprecated. + * + * @param the return type of this visitor's methods + * @param

the type of the additional parameter to this visitor's methods. + * + * @see SimpleAnnotationValueVisitor6 + * @since 1.7 + */ +@SupportedSourceVersion(RELEASE_7) +public class SimpleAnnotationValueVisitor7 extends SimpleAnnotationValueVisitor6 { + /** + * Constructor for concrete subclasses; uses {@code null} for the + * default value. + */ + protected SimpleAnnotationValueVisitor7() { + super(null); + } + + /** + * Constructor for concrete subclasses; uses the argument for the + * default value. + * + * @param defaultValue the value to assign to {@link #DEFAULT_VALUE} + */ + protected SimpleAnnotationValueVisitor7(R defaultValue) { + super(defaultValue); + } +} --- /dev/null 2009-08-12 17:12:33.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/SimpleElementVisitor7.java 2010-06-02 18:11:20.000000000 -0700 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2010, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.lang.model.util; + +import javax.lang.model.element.*; +import javax.annotation.processing.SupportedSourceVersion; +import static javax.lang.model.element.ElementKind.*; +import javax.lang.model.SourceVersion; +import static javax.lang.model.SourceVersion.*; + +/** + * A simple visitor of program elements with default behavior + * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7} + * source version. + * + * Visit methods corresponding to {@code RELEASE_7} language + * constructs call {@link #defaultAction}, passing their arguments to + * {@code defaultAction}'s corresponding parameters. + * + *

Methods in this class may be overridden subject to their + * general contract. Note that annotating methods in concrete + * subclasses with {@link java.lang.Override @Override} will help + * ensure that methods are overridden as intended. + * + *

WARNING: The {@code ElementVisitor} interface + * implemented by this class may have methods added to it in the + * future to accommodate new, currently unknown, language structures + * added to future versions of the Java™ programming language. + * Therefore, methods whose names begin with {@code "visit"} may be + * added to this class in the future; to avoid incompatibilities, + * classes which extend this class should not declare any instance + * methods with names beginning with {@code "visit"}. + * + *

When such a new visit method is added, the default + * implementation in this class will be to call the {@link + * #visitUnknown visitUnknown} method. A new simple element visitor + * class will also be introduced to correspond to the new language + * level; this visitor will have different default behavior for the + * visit method in question. When the new visitor is introduced, all + * or portions of this visitor may be deprecated. + * + * @param the return type of this visitor's methods. Use {@code Void} + * for visitors that do not need to return results. + * @param

the type of the additional parameter to this visitor's methods. Use {@code Void} + * for visitors that do not need an additional parameter. + * + * @see SimpleElementVisitor6 + * @since 1.7 + */ +@SupportedSourceVersion(RELEASE_7) +public class SimpleElementVisitor7 extends SimpleElementVisitor6 { + /** + * Constructor for concrete subclasses; uses {@code null} for the + * default value. + */ + protected SimpleElementVisitor7(){ + super(null); + } + + /** + * Constructor for concrete subclasses; uses the argument for the + * default value. + * + * @param defaultValue the value to assign to {@link #DEFAULT_VALUE} + */ + protected SimpleElementVisitor7(R defaultValue){ + super(defaultValue); + } +} --- /dev/null 2009-08-12 17:12:33.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java 2010-06-02 18:11:20.000000000 -0700 @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2010, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.lang.model.util; + +import javax.lang.model.type.*; +import javax.annotation.processing.SupportedSourceVersion; +import javax.lang.model.SourceVersion; +import static javax.lang.model.SourceVersion.*; + +/** + * A simple visitor of types with default behavior appropriate for the + * {@link SourceVersion#RELEASE_7 RELEASE_7} source version. + * + * Visit methods corresponding to {@code RELEASE_7} language + * constructs call {@link #defaultAction}, passing their arguments to + * {@code defaultAction}'s corresponding parameters. + * + *

Methods in this class may be overridden subject to their + * general contract. Note that annotating methods in concrete + * subclasses with {@link java.lang.Override @Override} will help + * ensure that methods are overridden as intended. + * + *

WARNING: The {@code TypeVisitor} interface implemented + * by this class may have methods added to it in the future to + * accommodate new, currently unknown, language structures added to + * future versions of the Java™ programming language. + * Therefore, methods whose names begin with {@code "visit"} may be + * added to this class in the future; to avoid incompatibilities, + * classes which extend this class should not declare any instance + * methods with names beginning with {@code "visit"}. + * + *

When such a new visit method is added, the default + * implementation in this class will be to call the {@link + * #visitUnknown visitUnknown} method. A new simple type visitor + * class will also be introduced to correspond to the new language + * level; this visitor will have different default behavior for the + * visit method in question. When the new visitor is introduced, all + * or portions of this visitor may be deprecated. + * + * @param the return type of this visitor's methods. Use {@link + * Void} for visitors that do not need to return results. + * @param

the type of the additional parameter to this visitor's + * methods. Use {@code Void} for visitors that do not need an + * additional parameter. + * + * @see SimpleTypeVisitor6 + * @since 1.7 + */ +@SupportedSourceVersion(RELEASE_7) +public class SimpleTypeVisitor7 extends SimpleTypeVisitor6 { + /** + * Constructor for concrete subclasses; uses {@code null} for the + * default value. + */ + protected SimpleTypeVisitor7(){ + super(null); + } + + /** + * Constructor for concrete subclasses; uses the argument for the + * default value. + * + * @param defaultValue the value to assign to {@link #DEFAULT_VALUE} + */ + protected SimpleTypeVisitor7(R defaultValue){ + super(defaultValue); + } +} --- /dev/null 2009-08-12 17:12:33.000000000 -0700 +++ new/src/share/classes/javax/lang/model/util/TypeKindVisitor7.java 2010-06-02 18:11:21.000000000 -0700 @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2010, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.lang.model.util; + +import javax.lang.model.type.*; +import javax.annotation.processing.SupportedSourceVersion; +import static javax.lang.model.element.ElementKind.*; +import static javax.lang.model.SourceVersion.*; +import javax.lang.model.SourceVersion; + +/** + * A visitor of types based on their {@linkplain TypeKind kind} with + * default behavior appropriate for the {@link SourceVersion#RELEASE_7 + * RELEASE_7} source version. For {@linkplain + * TypeMirror types} XYZ that may have more than one + * kind, the visitXYZ methods in this class delegate + * to the visitXYZKind method corresponding to the + * first argument's kind. The visitXYZKind methods + * call {@link #defaultAction defaultAction}, passing their arguments + * to {@code defaultAction}'s corresponding parameters. + * + *

Methods in this class may be overridden subject to their + * general contract. Note that annotating methods in concrete + * subclasses with {@link java.lang.Override @Override} will help + * ensure that methods are overridden as intended. + * + *

WARNING: The {@code TypeVisitor} interface implemented + * by this class may have methods added to it in the future to + * accommodate new, currently unknown, language structures added to + * future versions of the Java™ programming language. + * Therefore, methods whose names begin with {@code "visit"} may be + * added to this class in the future; to avoid incompatibilities, + * classes which extend this class should not declare any instance + * methods with names beginning with {@code "visit"}. + * + *

When such a new visit method is added, the default + * implementation in this class will be to call the {@link + * #visitUnknown visitUnknown} method. A new type kind visitor class + * will also be introduced to correspond to the new language level; + * this visitor will have different default behavior for the visit + * method in question. When the new visitor is introduced, all or + * portions of this visitor may be deprecated. + * + * @param the return type of this visitor's methods. Use {@link + * Void} for visitors that do not need to return results. + * @param

the type of the additional parameter to this visitor's + * methods. Use {@code Void} for visitors that do not need an + * additional parameter. + * + * @see TypeKindVisitor6 + * @since 1.7 + */ +@SupportedSourceVersion(RELEASE_7) +public class TypeKindVisitor7 extends TypeKindVisitor6 { + /** + * Constructor for concrete subclasses to call; uses {@code null} + * for the default value. + */ + protected TypeKindVisitor7() { + super(null); + } + + /** + * Constructor for concrete subclasses to call; uses the argument + * for the default value. + * + * @param defaultValue the value to assign to {@link #DEFAULT_VALUE} + */ + protected TypeKindVisitor7(R defaultValue) { + super(defaultValue); + } +}