# HG changeset patch # User darcy # Date 1405615645 25200 # Node ID b1dac768ab79d3b3ebcec3ba3553f55197095be4 # Parent e1be1d88a55768e9aa255d5e301cf54bbaa5eec4 8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9 Reviewed-by: jjg diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java --- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Thu Jul 17 09:47:25 2014 -0700 @@ -749,7 +749,7 @@ * Leave class public for external testing purposes. */ public static class ComputeAnnotationSet extends - ElementScanner8, Set> { + ElementScanner9, Set> { final Elements elements; public ComputeAnnotationSet(Elements elements) { diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java --- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java Thu Jul 17 09:47:25 2014 -0700 @@ -114,7 +114,7 @@ if (a.getKind() != ElementKind.ANNOTATION_TYPE) throw new IllegalArgumentException(NOT_AN_ANNOTATION_TYPE + a); - ElementScanner8, TypeElement> scanner = + ElementScanner9, TypeElement> scanner = new AnnotationSetScanner(result); for (Element element : rootElements) @@ -125,7 +125,7 @@ // Could be written as a local class inside getElementsAnnotatedWith private class AnnotationSetScanner extends - ElementScanner8, TypeElement> { + ElementScanner9, TypeElement> { // Insertion-order preserving set Set annotatedElements = new LinkedHashSet<>(); diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java --- a/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java Thu Jul 17 09:47:25 2014 -0700 @@ -83,7 +83,7 @@ * Used for the -Xprint option and called by Elements.printElements */ public static class PrintingElementVisitor - extends SimpleElementVisitor8 { + extends SimpleElementVisitor9 { int indentation; // Indentation level; final PrintWriter writer; final Elements elementUtils; diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/com/sun/tools/javah/JavahTask.java --- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, 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 @@ -60,7 +60,7 @@ import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVisitor; import javax.lang.model.util.ElementFilter; -import javax.lang.model.util.SimpleTypeVisitor8; +import javax.lang.model.util.SimpleTypeVisitor9; import javax.lang.model.util.Types; import javax.tools.Diagnostic; @@ -738,7 +738,7 @@ } private TypeVisitor checkMethodParametersVisitor = - new SimpleTypeVisitor8() { + new SimpleTypeVisitor9() { @Override public Void visitArray(ArrayType t, Types types) { visit(t.getComponentType(), types); diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/com/sun/tools/javah/LLNI.java --- a/langtools/src/share/classes/com/sun/tools/javah/LLNI.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/com/sun/tools/javah/LLNI.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, 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 @@ -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.SimpleTypeVisitor8; +import javax.lang.model.util.SimpleTypeVisitor9; /* *

This is NOT part of any supported API. @@ -628,7 +628,7 @@ } protected final boolean isLongOrDouble(TypeMirror t) { - TypeVisitor v = new SimpleTypeVisitor8() { + TypeVisitor v = new SimpleTypeVisitor9() { public Boolean defaultAction(TypeMirror t, Void p){ return false; } diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java --- a/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, 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 @@ -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.SimpleTypeVisitor8; +import javax.lang.model.util.SimpleTypeVisitor9; /** * Returns internal type signature. @@ -248,7 +248,7 @@ String qualifiedTypeName(TypeMirror type) { - TypeVisitor v = new SimpleTypeVisitor8() { + TypeVisitor v = new SimpleTypeVisitor9() { @Override public Name visitArray(ArrayType t, Void p) { return t.getComponentType().accept(this, p); diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/com/sun/tools/sjavac/comp/PubapiVisitor.java --- a/langtools/src/share/classes/com/sun/tools/sjavac/comp/PubapiVisitor.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/com/sun/tools/sjavac/comp/PubapiVisitor.java Thu Jul 17 09:47:25 2014 -0700 @@ -32,7 +32,7 @@ import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; import javax.lang.model.type.TypeMirror; -import javax.lang.model.util.ElementScanner6; +import javax.lang.model.util.ElementScanner9; /** Utility class that constructs a textual representation * of the public api of a class. @@ -42,7 +42,7 @@ * risk. This code and its internal interfaces are subject to change * or deletion without notice.

*/ -public class PubapiVisitor extends ElementScanner6 { +public class PubapiVisitor extends ElementScanner9 { StringBuffer sb; // Important that it is 1! Part of protocol over wire, silly yes. diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/element/ElementVisitor.java --- a/langtools/src/share/classes/javax/lang/model/element/ElementVisitor.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/element/ElementVisitor.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -73,8 +73,6 @@ * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ahé - * @see AbstractElementVisitor6 - * @see AbstractElementVisitor7 * @since 1.6 */ public interface ElementVisitor { diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java --- a/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -72,8 +72,12 @@ * * @see AbstractAnnotationValueVisitor7 * @see AbstractAnnotationValueVisitor8 + * @see AbstractAnnotationValueVisitor9 * @since 1.6 + * @deprecated Release 6 is obsolete; update to a visitor for a newer + * release level. */ +@Deprecated @SupportedSourceVersion(RELEASE_6) public abstract class AbstractAnnotationValueVisitor6 implements AnnotationValueVisitor { diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java --- a/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, 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 @@ -65,6 +65,7 @@ * * @see AbstractAnnotationValueVisitor6 * @see AbstractAnnotationValueVisitor8 + * @see AbstractAnnotationValueVisitor9 * @since 1.7 */ @SupportedSourceVersion(RELEASE_7) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor8.java --- a/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor8.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor8.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -65,6 +65,7 @@ * * @see AbstractAnnotationValueVisitor6 * @see AbstractAnnotationValueVisitor7 + * @see AbstractAnnotationValueVisitor9 * @since 1.8 */ @SupportedSourceVersion(RELEASE_8) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor9.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor9.java Thu Jul 17 09:47:25 2014 -0700 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2011, 2014, 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 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_9 RELEASE_9} + * 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 + * @see AbstractAnnotationValueVisitor7 + * @see AbstractAnnotationValueVisitor8 + * @since 1.9 + */ +@SupportedSourceVersion(RELEASE_9) +public abstract class AbstractAnnotationValueVisitor9 extends AbstractAnnotationValueVisitor8 { + + /** + * Constructor for concrete subclasses to call. + */ + protected AbstractAnnotationValueVisitor9() { + super(); + } +} diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java --- a/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -74,8 +74,12 @@ * * @see AbstractElementVisitor7 * @see AbstractElementVisitor8 + * @see AbstractElementVisitor9 * @since 1.6 + * @deprecated Release 6 is obsolete; update to a visitor for a newer + * release level. */ +@Deprecated @SupportedSourceVersion(RELEASE_6) public abstract class AbstractElementVisitor6 implements ElementVisitor { /** diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor7.java --- a/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor7.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor7.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, 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 @@ -69,6 +69,7 @@ * * @see AbstractElementVisitor6 * @see AbstractElementVisitor8 + * @see AbstractElementVisitor9 * @since 1.7 */ @SupportedSourceVersion(RELEASE_7) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor8.java --- a/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor8.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor8.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -69,6 +69,7 @@ * * @see AbstractElementVisitor6 * @see AbstractElementVisitor7 + * @see AbstractElementVisitor9 * @since 1.8 */ @SupportedSourceVersion(RELEASE_8) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor9.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor9.java Thu Jul 17 09:47:25 2014 -0700 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2011, 2014, 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.annotation.processing.SupportedSourceVersion; +import javax.lang.model.SourceVersion; +import static javax.lang.model.SourceVersion.*; + + +/** + * A skeletal visitor of program elements with default behavior + * appropriate for the {@link SourceVersion#RELEASE_9 RELEASE_9} + * 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 + * @see AbstractElementVisitor7 + * @see AbstractElementVisitor8 + * @since 1.9 + */ +@SupportedSourceVersion(RELEASE_9) +public abstract class AbstractElementVisitor9 extends AbstractElementVisitor8 { + /** + * Constructor for concrete subclasses to call. + */ + protected AbstractElementVisitor9(){ + super(); + } +} diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java --- a/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -25,8 +25,11 @@ package javax.lang.model.util; +import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.type.*; +import static javax.lang.model.SourceVersion.*; + /** * A skeletal visitor of types with default behavior appropriate for * the {@link javax.lang.model.SourceVersion#RELEASE_6 RELEASE_6} @@ -70,8 +73,13 @@ * * @see AbstractTypeVisitor7 * @see AbstractTypeVisitor8 + * @see AbstractTypeVisitor9 * @since 1.6 + * @deprecated Release 6 is obsolete; update to a visitor for a newer + * release level. */ +@Deprecated +@SupportedSourceVersion(RELEASE_6) public abstract class AbstractTypeVisitor6 implements TypeVisitor { /** * Constructor for concrete subclasses to call. diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java --- a/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, 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 @@ -25,8 +25,11 @@ package javax.lang.model.util; +import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.type.*; +import static javax.lang.model.SourceVersion.*; + /** * A skeletal visitor of types with default behavior appropriate for * the {@link javax.lang.model.SourceVersion#RELEASE_7 RELEASE_7} @@ -66,8 +69,10 @@ * * @see AbstractTypeVisitor6 * @see AbstractTypeVisitor8 + * @see AbstractTypeVisitor9 * @since 1.7 */ +@SupportedSourceVersion(RELEASE_7) public abstract class AbstractTypeVisitor7 extends AbstractTypeVisitor6 { /** * Constructor for concrete subclasses to call. diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor8.java --- a/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor8.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor8.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -25,8 +25,11 @@ package javax.lang.model.util; +import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.type.*; +import static javax.lang.model.SourceVersion.*; + /** * A skeletal visitor of types with default behavior appropriate for * the {@link javax.lang.model.SourceVersion#RELEASE_8 RELEASE_8} @@ -66,8 +69,10 @@ * * @see AbstractTypeVisitor6 * @see AbstractTypeVisitor7 + * @see AbstractTypeVisitor9 * @since 1.8 */ +@SupportedSourceVersion(RELEASE_8) public abstract class AbstractTypeVisitor8 extends AbstractTypeVisitor7 { /** * Constructor for concrete subclasses to call. diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java Thu Jul 17 09:47:25 2014 -0700 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2011, 2014, 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.annotation.processing.SupportedSourceVersion; +import javax.lang.model.type.*; + +import static javax.lang.model.SourceVersion.*; + +/** + * A skeletal visitor of types with default behavior appropriate for + * the {@link javax.lang.model.SourceVersion#RELEASE_9 RELEASE_9} + * source version. + * + *

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 + * @see AbstractTypeVisitor7 + * @see AbstractTypeVisitor8 + * @since 1.9 + */ +@SupportedSourceVersion(RELEASE_9) +public abstract class AbstractTypeVisitor9 extends AbstractTypeVisitor8 { + /** + * Constructor for concrete subclasses to call. + */ + protected AbstractTypeVisitor9() { + super(); + } +} diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java --- a/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -88,8 +88,12 @@ * * @see ElementKindVisitor7 * @see ElementKindVisitor8 + * @see ElementKindVisitor9 * @since 1.6 + * @deprecated Release 6 is obsolete; update to a visitor for a newer + * release level. */ +@Deprecated @SupportedSourceVersion(RELEASE_6) public class ElementKindVisitor6 extends SimpleElementVisitor6 { diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java --- a/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, 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 @@ -82,6 +82,7 @@ * * @see ElementKindVisitor6 * @see ElementKindVisitor8 + * @see ElementKindVisitor9 * @since 1.7 */ @SupportedSourceVersion(RELEASE_7) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor8.java --- a/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor8.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor8.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -82,6 +82,7 @@ * * @see ElementKindVisitor6 * @see ElementKindVisitor7 + * @see ElementKindVisitor9 * @since 1.8 */ @SupportedSourceVersion(RELEASE_8) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor9.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor9.java Thu Jul 17 09:47:25 2014 -0700 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2011, 2014, 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.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_9 RELEASE_9} 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 + * @see ElementKindVisitor7 + * @see ElementKindVisitor8 + * @since 1.9 + */ +@SupportedSourceVersion(RELEASE_9) +public class ElementKindVisitor9 extends ElementKindVisitor8 { + /** + * Constructor for concrete subclasses; uses {@code null} for the + * default value. + */ + protected ElementKindVisitor9() { + super(null); + } + + /** + * Constructor for concrete subclasses; uses the argument for the + * default value. + * + * @param defaultValue the value to assign to {@link #DEFAULT_VALUE} + */ + protected ElementKindVisitor9(R defaultValue) { + super(defaultValue); + } +} diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java --- a/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -90,8 +90,12 @@ * * @see ElementScanner7 * @see ElementScanner8 + * @see ElementScanner9 * @since 1.6 + * @deprecated Release 6 is obsolete; update to a visitor for a newer + * release level. */ +@Deprecated @SupportedSourceVersion(RELEASE_6) public class ElementScanner6 extends AbstractElementVisitor6 { /** diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java --- a/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, 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 @@ -86,6 +86,7 @@ * * @see ElementScanner6 * @see ElementScanner8 + * @see ElementScanner9 * @since 1.7 */ @SupportedSourceVersion(RELEASE_7) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/ElementScanner8.java --- a/langtools/src/share/classes/javax/lang/model/util/ElementScanner8.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner8.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -86,6 +86,7 @@ * * @see ElementScanner6 * @see ElementScanner7 + * @see ElementScanner9 * @since 1.8 */ @SupportedSourceVersion(RELEASE_8) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/ElementScanner9.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner9.java Thu Jul 17 09:47:25 2014 -0700 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2011, 2014, 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.SourceVersion; +import static javax.lang.model.SourceVersion.*; + + +/** + * A scanning visitor of program elements with default behavior + * appropriate for the {@link SourceVersion#RELEASE_9 RELEASE_9} + * 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 + * @see ElementScanner7 + * @see ElementScanner8 + * @since 1.9 + */ +@SupportedSourceVersion(RELEASE_9) +public class ElementScanner9 extends ElementScanner8 { + /** + * Constructor for concrete subclasses; uses {@code null} for the + * default value. + */ + protected ElementScanner9(){ + super(null); + } + + /** + * Constructor for concrete subclasses; uses the argument for the + * default value. + * + * @param defaultValue the default value + */ + protected ElementScanner9(R defaultValue){ + super(defaultValue); + } +} diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java --- a/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -81,8 +81,12 @@ * * @see SimpleAnnotationValueVisitor7 * @see SimpleAnnotationValueVisitor8 + * @see SimpleAnnotationValueVisitor9 * @since 1.6 + * @deprecated Release 6 is obsolete; update to a visitor for a newer + * release level. */ +@Deprecated @SupportedSourceVersion(RELEASE_6) public class SimpleAnnotationValueVisitor6 extends AbstractAnnotationValueVisitor6 { diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java --- a/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, 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 @@ -72,6 +72,7 @@ * * @see SimpleAnnotationValueVisitor6 * @see SimpleAnnotationValueVisitor8 + * @see SimpleAnnotationValueVisitor9 * @since 1.7 */ @SupportedSourceVersion(RELEASE_7) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor8.java --- a/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor8.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor8.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -72,6 +72,7 @@ * * @see SimpleAnnotationValueVisitor6 * @see SimpleAnnotationValueVisitor7 + * @see SimpleAnnotationValueVisitor8 * @since 1.8 */ @SupportedSourceVersion(RELEASE_8) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java Thu Jul 17 09:47:25 2014 -0700 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2011, 2014, 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.annotation.processing.SupportedSourceVersion; +import javax.lang.model.SourceVersion; +import static javax.lang.model.SourceVersion.*; + +/** + * A simple visitor for annotation values with default behavior + * appropriate for the {@link SourceVersion#RELEASE_9 RELEASE_9} + * source version. Visit 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 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 + * @see SimpleAnnotationValueVisitor7 + * @see SimpleAnnotationValueVisitor8 + * @since 1.9 + */ +@SupportedSourceVersion(RELEASE_9) +public class SimpleAnnotationValueVisitor9 extends SimpleAnnotationValueVisitor8 { + /** + * Constructor for concrete subclasses; uses {@code null} for the + * default value. + */ + protected SimpleAnnotationValueVisitor9() { + super(null); + } + + /** + * Constructor for concrete subclasses; uses the argument for the + * default value. + * + * @param defaultValue the value to assign to {@link #DEFAULT_VALUE} + */ + protected SimpleAnnotationValueVisitor9(R defaultValue) { + super(defaultValue); + } +} diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java --- a/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -85,8 +85,12 @@ * * @see SimpleElementVisitor7 * @see SimpleElementVisitor8 + * @see SimpleElementVisitor9 * @since 1.6 + * @deprecated Release 6 is obsolete; update to a visitor for a newer + * release level. */ +@Deprecated @SupportedSourceVersion(RELEASE_6) public class SimpleElementVisitor6 extends AbstractElementVisitor6 { /** diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor7.java --- a/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor7.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor7.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, 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 @@ -78,6 +78,7 @@ * * @see SimpleElementVisitor6 * @see SimpleElementVisitor8 + * @see SimpleElementVisitor9 * @since 1.7 */ @SupportedSourceVersion(RELEASE_7) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor8.java --- a/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor8.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor8.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -34,7 +34,7 @@ * appropriate for the {@link SourceVersion#RELEASE_8 RELEASE_8} * source version. * - * Visit methods corresponding to {@code RELEASE_7} and earlier + * Visit methods corresponding to {@code RELEASE_8} and earlier * language constructs call {@link #defaultAction defaultAction}, * passing their arguments to {@code defaultAction}'s corresponding * parameters. @@ -77,6 +77,7 @@ * * @see SimpleElementVisitor6 * @see SimpleElementVisitor7 + * @see SimpleElementVisitor9 * @since 1.8 */ @SupportedSourceVersion(RELEASE_8) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor9.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor9.java Thu Jul 17 09:47:25 2014 -0700 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2011, 2014, 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.annotation.processing.SupportedSourceVersion; +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_9 RELEASE_9} + * source version. + * + * Visit methods corresponding to {@code RELEASE_9} and earlier + * language constructs 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 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 + * @see SimpleElementVisitor7 + * @see SimpleElementVisitor8 + * @since 1.9 + */ +@SupportedSourceVersion(RELEASE_9) +public class SimpleElementVisitor9 extends SimpleElementVisitor8 { + /** + * Constructor for concrete subclasses; uses {@code null} for the + * default value. + */ + protected SimpleElementVisitor9(){ + super(null); + } + + /** + * Constructor for concrete subclasses; uses the argument for the + * default value. + * + * @param defaultValue the value to assign to {@link #DEFAULT_VALUE} + */ + protected SimpleElementVisitor9(R defaultValue){ + super(defaultValue); + } +} diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java --- a/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -85,8 +85,12 @@ * * @see SimpleTypeVisitor7 * @see SimpleTypeVisitor8 + * @see SimpleTypeVisitor9 * @since 1.6 + * @deprecated Release 6 is obsolete; update to a visitor for a newer + * release level. */ +@Deprecated @SupportedSourceVersion(RELEASE_6) public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 { /** diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java --- a/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, 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 @@ -78,6 +78,7 @@ * * @see SimpleTypeVisitor6 * @see SimpleTypeVisitor8 + * @see SimpleTypeVisitor9 * @since 1.7 */ @SupportedSourceVersion(RELEASE_7) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java --- a/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -32,7 +32,7 @@ /** * A simple visitor of types with default behavior appropriate for the - * {@link SourceVersion#RELEASE_7 RELEASE_7} source version. + * {@link SourceVersion#RELEASE_8 RELEASE_8} source version. * * Visit methods corresponding to {@code RELEASE_8} and earlier * language constructs call {@link #defaultAction defaultAction}, @@ -78,6 +78,7 @@ * * @see SimpleTypeVisitor6 * @see SimpleTypeVisitor7 + * @see SimpleTypeVisitor9 * @since 1.8 */ @SupportedSourceVersion(RELEASE_8) diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java Thu Jul 17 09:47:25 2014 -0700 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2011, 2014, 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.annotation.processing.SupportedSourceVersion; +import javax.lang.model.SourceVersion; +import javax.lang.model.type.IntersectionType; +import static javax.lang.model.SourceVersion.*; + +/** + * A simple visitor of types with default behavior appropriate for the + * {@link SourceVersion#RELEASE_9 RELEASE_9} source version. + * + * Visit methods corresponding to {@code RELEASE_9} and earlier + * language constructs 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 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 + * @see SimpleTypeVisitor7 + * @since 1.8 + */ +@SupportedSourceVersion(RELEASE_9) +public class SimpleTypeVisitor9 extends SimpleTypeVisitor8 { + /** + * Constructor for concrete subclasses; uses {@code null} for the + * default value. + */ + protected SimpleTypeVisitor9(){ + super(null); + } + + /** + * Constructor for concrete subclasses; uses the argument for the + * default value. + * + * @param defaultValue the value to assign to {@link #DEFAULT_VALUE} + */ + protected SimpleTypeVisitor9(R defaultValue){ + super(defaultValue); + } +} diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java --- a/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java Thu Jul 17 09:47:25 2014 -0700 @@ -85,7 +85,10 @@ * @see TypeKindVisitor7 * @see TypeKindVisitor8 * @since 1.6 + * @deprecated Release 6 is obsolete; update to a visitor for a newer + * release level. */ +@Deprecated @SupportedSourceVersion(RELEASE_6) public class TypeKindVisitor6 extends SimpleTypeVisitor6 { /** diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor9.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor9.java Thu Jul 17 09:47:25 2014 -0700 @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2011, 2014, 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.annotation.processing.SupportedSourceVersion; +import javax.lang.model.SourceVersion; +import javax.lang.model.type.*; +import static javax.lang.model.SourceVersion.*; + +/** + * A visitor of types based on their {@linkplain TypeKind kind} with + * default behavior appropriate for the {@link SourceVersion#RELEASE_9 + * RELEASE_9} 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 + * @see TypeKindVisitor7 + * @see TypeKindVisitor8 + * @since 1.9 + */ +@SupportedSourceVersion(RELEASE_9) +public class TypeKindVisitor9 extends TypeKindVisitor8 { + /** + * Constructor for concrete subclasses to call; uses {@code null} + * for the default value. + */ + protected TypeKindVisitor9() { + 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 TypeKindVisitor9(R defaultValue) { + super(defaultValue); + } +} diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java --- a/langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -138,7 +138,7 @@ public SourceVersion getSupportedSourceVersion() { /* * Return latest source version instead of a fixed version - * like RELEASE_8. To return a fixed version, this class + * like RELEASE_9. To return a fixed version, this class * could be annotated with a SupportedSourceVersion * annotation. * @@ -192,7 +192,7 @@ /** * Visitor to implement name checks. */ - private class NameCheckScanner extends ElementScanner8 { + private class NameCheckScanner extends ElementScanner9 { // 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 diff -r e1be1d88a557 -r b1dac768ab79 langtools/src/share/sample/language/model/CoreReflectionFactory.java --- a/langtools/src/share/sample/language/model/CoreReflectionFactory.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/src/share/sample/language/model/CoreReflectionFactory.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -39,7 +39,7 @@ import java.io.Writer; import java.util.*; -import static javax.lang.model.SourceVersion.RELEASE_8; +import static javax.lang.model.SourceVersion.RELEASE_9; import static java.util.Objects.*; /** @@ -487,10 +487,10 @@ /** * Base class for concrete visitors of elements backed by core reflection. */ - public static abstract class AbstractReflectionElementVisitor8 - extends AbstractElementVisitor8 + public static abstract class AbstractReflectionElementVisitor9 + extends AbstractElementVisitor9 implements ReflectionElementVisitor { - protected AbstractReflectionElementVisitor8() { + protected AbstractReflectionElementVisitor9() { super(); } } @@ -498,16 +498,16 @@ /** * Base class for simple visitors of elements that are backed by core reflection. */ - @SupportedSourceVersion(value=RELEASE_8) - public static abstract class SimpleReflectionElementVisitor8 - extends SimpleElementVisitor8 + @SupportedSourceVersion(value=RELEASE_9) + public static abstract class SimpleReflectionElementVisitor9 + extends SimpleElementVisitor9 implements ReflectionElementVisitor { - protected SimpleReflectionElementVisitor8(){ + protected SimpleReflectionElementVisitor9(){ super(); } - protected SimpleReflectionElementVisitor8(R defaultValue) { + protected SimpleReflectionElementVisitor9(R defaultValue) { super(defaultValue); } @@ -2527,7 +2527,7 @@ Constructor printProcCtor = printProcClass.getConstructor(Writer.class, Elements.class); return (ElementVisitor) printProcCtor.newInstance(w, getElements()); } catch (ReflectiveOperationException | SecurityException e) { - return new ElementScanner8(w){ + return new ElementScanner9(w){ @Override public Writer scan(Element e, Void v) { try { diff -r e1be1d88a557 -r b1dac768ab79 langtools/test/tools/javac/6402516/CheckLocalElements.java --- a/langtools/test/tools/javac/6402516/CheckLocalElements.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/test/tools/javac/6402516/CheckLocalElements.java Thu Jul 17 09:47:25 2014 -0700 @@ -110,7 +110,7 @@ return encl == null ? "" : encl.accept(qualNameVisitor, null); } - private ElementVisitor qualNameVisitor = new SimpleElementVisitor8() { + private ElementVisitor qualNameVisitor = new SimpleElementVisitor9() { protected String defaultAction(Element e, Void ignore) { return ""; } diff -r e1be1d88a557 -r b1dac768ab79 langtools/test/tools/javac/lib/JavacTestingAbstractProcessor.java --- a/langtools/test/tools/javac/lib/JavacTestingAbstractProcessor.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/test/tools/javac/lib/JavacTestingAbstractProcessor.java Thu Jul 17 09:47:25 2014 -0700 @@ -28,7 +28,7 @@ import static javax.lang.model.SourceVersion.*; /** - * An abstract annotation processor tailored to javac regression testing. + * An abstract annotation processor tailored to {@code javac} regression testing. */ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { private static final Set allAnnotations; @@ -103,7 +103,7 @@ */ @SupportedSourceVersion(RELEASE_9) - public static abstract class AbstractAnnotationValueVisitor extends AbstractAnnotationValueVisitor8 { + public static abstract class AbstractAnnotationValueVisitor extends AbstractAnnotationValueVisitor9 { /** * Constructor for concrete subclasses to call. @@ -114,7 +114,7 @@ } @SupportedSourceVersion(RELEASE_9) - public static abstract class AbstractElementVisitor extends AbstractElementVisitor8 { + public static abstract class AbstractElementVisitor extends AbstractElementVisitor9 { /** * Constructor for concrete subclasses to call. */ @@ -124,7 +124,7 @@ } @SupportedSourceVersion(RELEASE_9) - public static abstract class AbstractTypeVisitor extends AbstractTypeVisitor8 { + public static abstract class AbstractTypeVisitor extends AbstractTypeVisitor9 { /** * Constructor for concrete subclasses to call. */ @@ -134,7 +134,7 @@ } @SupportedSourceVersion(RELEASE_9) - public static class ElementKindVisitor extends ElementKindVisitor8 { + public static class ElementKindVisitor extends ElementKindVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the * default value. @@ -155,7 +155,7 @@ } @SupportedSourceVersion(RELEASE_9) - public static class ElementScanner extends ElementScanner8 { + public static class ElementScanner extends ElementScanner9 { /** * Constructor for concrete subclasses; uses {@code null} for the * default value. @@ -174,7 +174,7 @@ } @SupportedSourceVersion(RELEASE_9) - public static class SimpleAnnotationValueVisitor extends SimpleAnnotationValueVisitor8 { + public static class SimpleAnnotationValueVisitor extends SimpleAnnotationValueVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the * default value. @@ -195,7 +195,7 @@ } @SupportedSourceVersion(RELEASE_9) - public static class SimpleElementVisitor extends SimpleElementVisitor8 { + public static class SimpleElementVisitor extends SimpleElementVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the * default value. @@ -216,7 +216,7 @@ } @SupportedSourceVersion(RELEASE_9) - public static class SimpleTypeVisitor extends SimpleTypeVisitor8 { + public static class SimpleTypeVisitor extends SimpleTypeVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the * default value. @@ -237,7 +237,7 @@ } @SupportedSourceVersion(RELEASE_9) - public static class TypeKindVisitor extends TypeKindVisitor8 { + public static class TypeKindVisitor extends TypeKindVisitor9 { /** * Constructor for concrete subclasses to call; uses {@code null} * for the default value. diff -r e1be1d88a557 -r b1dac768ab79 langtools/test/tools/javac/multicatch/model/ModelChecker.java --- a/langtools/test/tools/javac/multicatch/model/ModelChecker.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/test/tools/javac/multicatch/model/ModelChecker.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, 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 @@ -46,7 +46,6 @@ import javax.lang.model.type.UnionType; import javax.lang.model.type.UnknownTypeException; import javax.lang.model.util.SimpleTypeVisitor6; -import javax.lang.model.util.SimpleTypeVisitor7; @SupportedAnnotationTypes("Check") public class ModelChecker extends JavacTestingAbstractProcessor { diff -r e1be1d88a557 -r b1dac768ab79 langtools/test/tools/javac/processing/model/TestSymtabItems.java --- a/langtools/test/tools/javac/processing/model/TestSymtabItems.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/test/tools/javac/processing/model/TestSymtabItems.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -110,7 +110,7 @@ int errors; - class ElemPrinter extends ElementScanner8 { + class ElemPrinter extends ElementScanner9 { @Override public Void visitPackage(PackageElement e, Void p) { show("package", e); @@ -201,7 +201,7 @@ int indent; }; - class TypePrinter extends SimpleTypeVisitor7 { + class TypePrinter extends SimpleTypeVisitor9 { @Override public Void defaultAction(TypeMirror m, Types types) { System.err.println(m.getKind() + " " + m + " " + types.asElement(m)); diff -r e1be1d88a557 -r b1dac768ab79 langtools/test/tools/javac/processing/model/element/TestTypeParameter.java --- a/langtools/test/tools/javac/processing/model/element/TestTypeParameter.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/test/tools/javac/processing/model/element/TestTypeParameter.java Thu Jul 17 09:47:25 2014 -0700 @@ -53,7 +53,7 @@ return true; } - class Scanner extends ElementScanner7 { + class Scanner extends ElementScanner { @Override public Integer visitExecutable(ExecutableElement e, Void p) { super.visitExecutable(e, p); diff -r e1be1d88a557 -r b1dac768ab79 langtools/test/tools/javac/processing/model/type/InheritedAP.java --- a/langtools/test/tools/javac/processing/model/type/InheritedAP.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/test/tools/javac/processing/model/type/InheritedAP.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, 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 @@ -25,7 +25,7 @@ * @test * @bug 8024513 * @library /tools/javac/lib - * @build InheritedAP + * @build JavacTestingAbstractProcessor InheritedAP * @compile -cp . -processor InheritedAP -proc:only InheritedAP.java * @summary NPE in annotation processing */ @@ -40,8 +40,7 @@ import static javax.lang.model.util.ElementFilter.*; @SupportedAnnotationTypes("testclass") -@SupportedSourceVersion(RELEASE_8) -public class InheritedAP extends AbstractProcessor { +public class InheritedAP extends JavacTestingAbstractProcessor { static Types types; public void init(ProcessingEnvironment penv) {super.init(penv);} public static Types getTypes() { return types; } @@ -54,14 +53,14 @@ types=processingEnv.getTypeUtils(); for (TypeElement typeElem: typesIn(renv.getRootElements())) { if (typeElem.getAnnotation(testclass.class) != null) { - new ElementScanner( new SimpleTypeMirrorVisitor()).scan(typeElem, null); + new LocalElementScanner( new SimpleTypeMirrorVisitor()).scan(typeElem, null); } } return true ; } } -class SimpleTypeMirrorVisitor extends SimpleTypeVisitor6 { +class SimpleTypeMirrorVisitor extends JavacTestingAbstractProcessor.SimpleTypeVisitor { protected Void defaultAction(TypeMirror mirror, Void p ) { try { System.out.println( "InheritedAP.getTypes().directSupertypes( "+mirror.toString()+" );" ); @@ -72,11 +71,11 @@ } } -class ElementScanner > - extends ElementScanner6 { - SimpleTypeVisitor6 typeVisitor; +class LocalElementScanner > + extends JavacTestingAbstractProcessor.ElementScanner { + JavacTestingAbstractProcessor.SimpleTypeVisitor typeVisitor; - public ElementScanner(T typeVisitor) { this.typeVisitor=typeVisitor;} + public LocalElementScanner(T typeVisitor) { this.typeVisitor=typeVisitor;} @Override public Void scan(Element e, Void p) { @@ -86,7 +85,6 @@ } return p; } - } diff -r e1be1d88a557 -r b1dac768ab79 langtools/test/tools/javac/processing/model/util/elements/doccomments/TestDocComments.java --- a/langtools/test/tools/javac/processing/model/util/elements/doccomments/TestDocComments.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/test/tools/javac/processing/model/util/elements/doccomments/TestDocComments.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, 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 @@ -25,6 +25,9 @@ * @test * @bug 6877202 6986246 * @summary Elements.getDocComment() is not getting JavaDocComments + * @library /tools/javac/lib + * @build JavacTestingAbstractProcessor TestDocComments + * @run main TestDocComments */ import com.sun.source.tree.*; @@ -49,8 +52,7 @@ */ @SupportedOptions("scan") -@SupportedAnnotationTypes("*") -public class TestDocComments extends AbstractProcessor { +public class TestDocComments extends JavacTestingAbstractProcessor { enum CompileKind { API, CMD }; enum ScanKind { TREE, ELEMENT }; @@ -72,7 +74,7 @@ } static void test(CompileKind ck, ScanKind sk) throws IOException { - String testClasses = System.getProperty("test.classes"); + String testClasses = System.getProperty("test.class.path"); String testSrc = System.getProperty("test.src"); File testDir = new File("test." + ck + "." + sk); testDir.mkdirs(); @@ -136,26 +138,15 @@ // ----- Annotation processor: scan for elements and check doc comments ---- Map options; - Filer filer; - Messager messager; - Elements elements; Trees trees; ScanKind skind; int round = 0; @Override - public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latest(); - } - - @Override public void init(ProcessingEnvironment pEnv) { super.init(pEnv); options = pEnv.getOptions(); - filer = pEnv.getFiler(); - messager = pEnv.getMessager(); - elements = pEnv.getElementUtils(); trees = Trees.instance(processingEnv); skind = ScanKind.valueOf(options.get("scan")); } @@ -271,7 +262,7 @@ // ----- Scanners to find elements ----------------------------------------- - class TestElementScanner extends ElementScanner7 { + class TestElementScanner extends ElementScanner { @Override public Void visitExecutable(ExecutableElement e, Void _) { check(e); @@ -306,5 +297,4 @@ return super.visitVariable(tree, trees); } } - } diff -r e1be1d88a557 -r b1dac768ab79 langtools/test/tools/javac/processing/model/util/elements/doccomments/TestPackageInfoComments.java --- a/langtools/test/tools/javac/processing/model/util/elements/doccomments/TestPackageInfoComments.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/test/tools/javac/processing/model/util/elements/doccomments/TestPackageInfoComments.java Thu Jul 17 09:47:25 2014 -0700 @@ -25,8 +25,10 @@ * @test * @bug 8042345 * @summary getDocComment() fails for doc comments on PackageElement found in package-info.java + * @library /tools/javac/lib + * @build JavacTestingAbstractProcessor TestPackageInfoComments + * @run main TestPackageInfoComments */ - import com.sun.source.util.JavacTask; import java.io.*; @@ -37,14 +39,13 @@ import javax.lang.model.util.*; import javax.tools.*; -@SupportedAnnotationTypes("*") -public class TestPackageInfoComments extends AbstractProcessor { +public class TestPackageInfoComments extends JavacTestingAbstractProcessor { public static void main(String... args) throws Exception { String[] opts = { "-implicit:none", "-processor", TestPackageInfoComments.class.getName(), - "-processorpath", System.getProperty("test.classes") + "-processorpath", System.getProperty("test.class.path") }; File[] files = { new File(System.getProperty("test.src"), "p/package-info.java") @@ -68,21 +69,6 @@ // -- Annotation processor: Check all PackageDecl's have a doc comment - Messager messager; - Elements elements; - - @Override - public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latest(); - } - - @Override - public void init(ProcessingEnvironment pEnv) { - super.init(pEnv); - messager = pEnv.getMessager(); - elements = pEnv.getElementUtils(); - } - @Override public boolean process(Set annotations, RoundEnvironment roundEnv) { for (Element e: roundEnv.getRootElements()) @@ -90,7 +76,7 @@ return true; } - class TestElementScanner extends ElementScanner7 { + class TestElementScanner extends ElementScanner { @Override public Void visitPackage(PackageElement e, Void v) { if (elements.getDocComment(e) == null) diff -r e1be1d88a557 -r b1dac768ab79 langtools/test/tools/javac/tree/NoPrivateTypesExported.java --- a/langtools/test/tools/javac/tree/NoPrivateTypesExported.java Thu Jul 17 10:55:50 2014 -0400 +++ b/langtools/test/tools/javac/tree/NoPrivateTypesExported.java Thu Jul 17 09:47:25 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, 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 @@ -51,8 +51,6 @@ import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVariable; import javax.lang.model.type.WildcardType; -import javax.lang.model.util.ElementScanner8; -import javax.lang.model.util.SimpleAnnotationValueVisitor8; import javax.tools.Diagnostic.Kind; public class NoPrivateTypesExported extends JavacTestingAbstractProcessor { @@ -131,7 +129,7 @@ private void verifyReferredTypesAcceptable(Element rootElement, final Set acceptable) { - new ElementScanner8() { + new ElementScanner() { @Override public Void visitType(TypeElement e, Void p) { verifyTypeAcceptable(e.getSuperclass(), acceptable); verifyTypesAcceptable(e.getInterfaces(), acceptable); @@ -189,7 +187,7 @@ private void verifyAnnotationValue(AnnotationValue value, final Set acceptable) { - value.accept(new SimpleAnnotationValueVisitor8() { + value.accept(new SimpleAnnotationValueVisitor() { @Override public Void visitType(TypeMirror t, Void p) { verifyTypeAcceptable(t, acceptable); return null;