From cf8d0b05372838db345ff373950e71b7b3b76de7 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Fri, 16 Jun 2023 16:43:00 +0000 Subject: [PATCH] 8309964: Use directed inheritDoc for javax.lang.model API Reviewed-by: vromero --- .../processing/AbstractProcessor.java | 31 ++++--- .../javax/lang/model/element/Element.java | 9 ++- .../javax/lang/model/type/TypeMirror.java | 12 +-- .../util/AbstractAnnotationValueVisitor6.java | 21 ++--- .../model/util/AbstractElementVisitor14.java | 11 +-- .../model/util/AbstractElementVisitor6.java | 29 ++++--- .../model/util/AbstractElementVisitor9.java | 11 +-- .../lang/model/util/AbstractTypeVisitor6.java | 24 +++--- .../lang/model/util/AbstractTypeVisitor7.java | 6 +- .../lang/model/util/AbstractTypeVisitor8.java | 10 ++- .../lang/model/util/ElementKindVisitor14.java | 20 ++--- .../lang/model/util/ElementKindVisitor6.java | 41 +++++----- .../lang/model/util/ElementKindVisitor7.java | 8 +- .../lang/model/util/ElementKindVisitor9.java | 11 +-- .../lang/model/util/ElementScanner14.java | 28 ++++--- .../lang/model/util/ElementScanner6.java | 53 ++++++++---- .../lang/model/util/ElementScanner7.java | 11 +-- .../lang/model/util/ElementScanner9.java | 11 +-- .../util/SimpleAnnotationValueVisitor6.java | 80 +++++++++---------- .../model/util/SimpleElementVisitor14.java | 11 +-- .../model/util/SimpleElementVisitor6.java | 49 +++++++----- .../model/util/SimpleElementVisitor7.java | 11 +-- .../model/util/SimpleElementVisitor9.java | 11 +-- .../lang/model/util/SimpleTypeVisitor6.java | 66 ++++++++------- .../lang/model/util/SimpleTypeVisitor7.java | 9 ++- .../lang/model/util/SimpleTypeVisitor8.java | 9 ++- .../lang/model/util/TypeKindVisitor6.java | 14 ++-- .../lang/model/util/TypeKindVisitor7.java | 10 +-- .../lang/model/util/TypeKindVisitor8.java | 8 +- .../lang/model/util/TypeKindVisitor9.java | 8 +- 30 files changed, 350 insertions(+), 283 deletions(-) diff --git a/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java b/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java index 3950e705500..3d65d200c0d 100644 --- a/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java +++ b/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -68,6 +68,9 @@ public abstract class AbstractProcessor implements Processor { protected AbstractProcessor() {} /** + * Returns the options recognized by this processor. + * + * @implSpec * If the processor class is annotated with {@link * SupportedOptions}, return an unmodifiable set with the same set * of strings as the annotation. If the class is not so @@ -85,6 +88,9 @@ public abstract class AbstractProcessor implements Processor { } /** + * Returns the names of the annotation interfaces supported by this processor. + * + * @implSpec * If the processor class is annotated with {@link * SupportedAnnotationTypes}, return an unmodifiable set with the * same set of strings as the annotation. If the class is not so @@ -96,8 +102,7 @@ public abstract class AbstractProcessor implements Processor { * then any leading {@linkplain Processor#getSupportedAnnotationTypes * module prefixes} are stripped from the names. * - * @return the names of the annotation interfaces supported by - * this processor, or an empty set if none + * @return {@inheritDoc Processor} */ @Override public Set getSupportedAnnotationTypes() { @@ -120,12 +125,15 @@ public abstract class AbstractProcessor implements Processor { } /** + * {@inheritDoc Processor} + * + * @implSpec * If the processor class is annotated with {@link * SupportedSourceVersion}, return the source version in the * annotation. If the class is not so annotated, {@link * SourceVersion#RELEASE_6} is returned. * - * @return the latest source version supported by this processor + * @return {@inheritDoc Processor} */ @Override public SourceVersion getSupportedSourceVersion() { @@ -145,6 +153,9 @@ public abstract class AbstractProcessor implements Processor { /** + * {@inheritDoc Processor} + * + * @implSpec * Initializes the processor with the processing environment by * setting the {@code processingEnv} field to the value of the * {@code processingEnv} argument. An {@code @@ -165,7 +176,9 @@ public abstract class AbstractProcessor implements Processor { } /** - * {@inheritDoc} + * {@inheritDoc Processor} + * @param annotations {@inheritDoc Processor} + * @param roundEnv {@inheritDoc Processor} */ @Override public abstract boolean process(Set annotations, @@ -174,10 +187,10 @@ public abstract class AbstractProcessor implements Processor { /** * {@return an empty iterable of completions} * - * @param element {@inheritDoc} - * @param annotation {@inheritDoc} - * @param member {@inheritDoc} - * @param userText {@inheritDoc} + * @param element {@inheritDoc Processor} + * @param annotation {@inheritDoc Processor} + * @param member {@inheritDoc Processor} + * @param userText {@inheritDoc Processor} */ @Override public Iterable getCompletions(Element element, diff --git a/src/java.compiler/share/classes/javax/lang/model/element/Element.java b/src/java.compiler/share/classes/javax/lang/model/element/Element.java index 6e0cba8ba6c..473e428d9ad 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/Element.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/Element.java @@ -32,6 +32,7 @@ import java.lang.annotation.IncompleteAnnotationException; import java.util.List; import java.util.Set; +import javax.lang.model.AnnotatedConstruct; import javax.lang.model.type.*; import javax.lang.model.util.*; @@ -56,7 +57,7 @@ import javax.lang.model.util.*; * @see TypeMirror * @since 1.6 */ -public interface Element extends javax.lang.model.AnnotatedConstruct { +public interface Element extends AnnotatedConstruct { /** * {@return the type defined by this element} * @@ -261,7 +262,7 @@ public interface Element extends javax.lang.model.AnnotatedConstruct { int hashCode(); /** - * {@inheritDoc} + * {@inheritDoc AnnotatedConstruct} * *

To get inherited annotations as well, use {@link * Elements#getAllAnnotationMirrors(Element) @@ -276,7 +277,7 @@ public interface Element extends javax.lang.model.AnnotatedConstruct { List getAnnotationMirrors(); /** - * {@inheritDoc} + * {@inheritDoc AnnotatedConstruct} * *

Note that any annotation returned by this method is a * declaration annotation. @@ -287,7 +288,7 @@ public interface Element extends javax.lang.model.AnnotatedConstruct { A getAnnotation(Class annotationType); /** - * {@inheritDoc} + * {@inheritDoc AnnotatedConstruct} * *

Note that any annotations returned by this method are * declaration annotations. diff --git a/src/java.compiler/share/classes/javax/lang/model/type/TypeMirror.java b/src/java.compiler/share/classes/javax/lang/model/type/TypeMirror.java index a9a4613feb4..5bd205a6c4b 100644 --- a/src/java.compiler/share/classes/javax/lang/model/type/TypeMirror.java +++ b/src/java.compiler/share/classes/javax/lang/model/type/TypeMirror.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -27,6 +27,8 @@ package javax.lang.model.type; import java.lang.annotation.Annotation; import java.util.List; + +import javax.lang.model.AnnotatedConstruct; import javax.lang.model.element.*; import javax.lang.model.util.Types; @@ -62,7 +64,7 @@ import javax.lang.model.util.Types; * @jls 10.1 Array Types * @since 1.6 */ -public interface TypeMirror extends javax.lang.model.AnnotatedConstruct { +public interface TypeMirror extends AnnotatedConstruct { /** * {@return the {@code kind} of this type} @@ -141,7 +143,7 @@ public interface TypeMirror extends javax.lang.model.AnnotatedConstruct { String toString(); /** - * {@inheritDoc} + * {@inheritDoc AnnotatedConstruct} * *

Note that any annotations returned by this method are type * annotations. @@ -152,7 +154,7 @@ public interface TypeMirror extends javax.lang.model.AnnotatedConstruct { List getAnnotationMirrors(); /** - * {@inheritDoc} + * {@inheritDoc AnnotatedConstruct} * *

Note that any annotation returned by this method is a type * annotation. @@ -163,7 +165,7 @@ public interface TypeMirror extends javax.lang.model.AnnotatedConstruct { A getAnnotation(Class annotationType); /** - * {@inheritDoc} + * {@inheritDoc AnnotatedConstruct} * *

Note that any annotations returned by this method are type * annotations. diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java index 9d30df23212..bb0f697ed89 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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,9 +82,9 @@ public abstract class AbstractAnnotationValueVisitor6 * Visits any annotation value as if by passing itself to that * value's {@link AnnotationValue#accept accept}. The invocation * {@code v.visit(av, p)} is equivalent to {@code av.accept(v, p)}. - * @param av {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param av {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} + * @return {@inheritDoc AnnotationValueVisitor} */ public final R visit(AnnotationValue av, P p) { return av.accept(this, p); @@ -96,24 +96,25 @@ public abstract class AbstractAnnotationValueVisitor6 * {@code null} for the additional parameter. The invocation * {@code v.visit(av)} is equivalent to {@code av.accept(v, * null)}. - * @param av {@inheritDoc} - * @return {@inheritDoc} + * @param av {@inheritDoc AnnotationValueVisitor} + * @return {@inheritDoc AnnotationValueVisitor} */ public final R visit(AnnotationValue av) { return av.accept(this, null); } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec The default implementation of this method in {@code * AbstractAnnotationValueVisitor6} will always throw {@code * new UnknownAnnotationValueException(av, p)}. This behavior is not * required of a subclass. * - * @param av {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param av {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} + * @return {@inheritDoc AnnotationValueVisitor} + * @throws UnknownAnnotationValueException {@inheritDoc AnnotationValueVisitor} */ @Override public R visitUnknown(AnnotationValue av, P p) { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor14.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor14.java index 875de10d68b..2aafe0b9d3e 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor14.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor14.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -27,6 +27,7 @@ package javax.lang.model.util; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; +import javax.lang.model.element.ElementVisitor; import javax.lang.model.element.RecordComponentElement; import static javax.lang.model.SourceVersion.*; @@ -59,14 +60,14 @@ public abstract class AbstractElementVisitor14 extends AbstractElementVisi } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec Visits a {@code RecordComponentElement} in a manner defined by a * subclass. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ @Override public abstract R visitRecordComponent(RecordComponentElement e, P p); diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java index 943c16f4d6c..4fd5f39fd91 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -107,18 +107,17 @@ public abstract class AbstractElementVisitor6 implements ElementVisitor implements ElementVisitor implements ElementVisitor extends AbstractElementVisit } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec Visits a {@code ModuleElement} in a manner defined by a * subclass. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ @Override public abstract R visitModule(ModuleElement e, P p); diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java index 01609d4d51a..8929a6940b0 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -105,29 +105,30 @@ public abstract class AbstractTypeVisitor6 implements TypeVisitor { } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec Visits a {@code UnionType} element by calling {@code * visitUnknown}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code visitUnknown} * * @since 1.7 */ + @Override public R visitUnion(UnionType t, P p) { return visitUnknown(t, p); } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec Visits an {@code IntersectionType} element by calling {@code * visitUnknown}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code visitUnknown} * * @since 1.8 @@ -138,18 +139,17 @@ public abstract class AbstractTypeVisitor6 implements TypeVisitor { } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec The default implementation of this method in {@code * AbstractTypeVisitor6} will always throw {@code * new UnknownTypeException(t, p)}. This behavior is not required of a * subclass. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return a visitor-specified result - * @throws UnknownTypeException - * a visitor implementation may optionally throw this exception + * @throws UnknownTypeException {@inheritDoc TypeVisitor} */ @Override public R visitUnknown(TypeMirror t, P p) { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java index 28cab50acd2..286de272e47 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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,8 +65,8 @@ public abstract class AbstractTypeVisitor7 extends AbstractTypeVisitor6 extends AbstractTypeVisitor7 extends ElementKindVisitor9 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param e the element to visit - * @param p a visitor-specified parameter + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} * @return the result of {@code defaultAction} */ @Override @@ -96,12 +96,12 @@ public class ElementKindVisitor14 extends ElementKindVisitor9 { } /** - * {@inheritDoc} + * {@inheritDoc ElementKindVisitor6} * * @implSpec This implementation calls {@code defaultAction}. *. - * @param e the element to visit - * @param p a visitor-specified parameter + * @param e {@inheritDoc ElementKindVisitor6} + * @param p {@inheritDoc ElementKindVisitor6} * @return the result of {@code defaultAction} */ @Override @@ -110,12 +110,12 @@ public class ElementKindVisitor14 extends ElementKindVisitor9 { } /** - * Visits a {@code BINDING_VARIABLE} variable element. + * {@inheritDoc ElementKindVisitor6} * * @implSpec This implementation calls {@code defaultAction}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} + * @param e {@inheritDoc ElementKindVisitor6} + * @param p {@inheritDoc ElementKindVisitor6} * @return the result of {@code defaultAction} * * @since 14 diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java index bdc4fe82ccf..41ad8ffe218 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -26,10 +26,11 @@ 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; +import javax.lang.model.element.ElementVisitor; +import static javax.lang.model.element.ElementKind.*; +import static javax.lang.model.SourceVersion.*; /** @@ -107,15 +108,15 @@ public class ElementKindVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * The element argument has kind {@code PACKAGE}. * * @implSpec This implementation calls {@code defaultAction}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ @Override public R visitPackage(PackageElement e, P p) { @@ -124,15 +125,15 @@ public class ElementKindVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation dispatches to the visit method for the * specific {@linkplain ElementKind kind} of type, {@code * ANNOTATION_TYPE}, {@code CLASS}, {@code ENUM}, or {@code * INTERFACE}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} * @return the result of the kind-specific visit method */ @Override @@ -227,15 +228,15 @@ public class ElementKindVisitor6 } /** - * Visits a variable element + * {@inheritDoc ElementVisitor} * * @implSpec This implementation dispatches to the visit method for * the specific {@linkplain ElementKind kind} of variable, {@code * ENUM_CONSTANT}, {@code EXCEPTION_PARAMETER}, {@code FIELD}, * {@code LOCAL_VARIABLE}, {@code PARAMETER}, or {@code RESOURCE_VARIABLE}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} * @return the result of the kind-specific visit method */ @Override @@ -364,15 +365,15 @@ public class ElementKindVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation dispatches to the visit method * for the specific {@linkplain ElementKind kind} of executable, * {@code CONSTRUCTOR}, {@code INSTANCE_INIT}, {@code METHOD}, or * {@code STATIC_INIT}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} * @return the result of the kind-specific visit method */ @Override @@ -449,15 +450,15 @@ public class ElementKindVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * The element argument has kind {@code TYPE_PARAMETER}. * * @implSpec This implementation calls {@code defaultAction}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ @Override public R visitTypeParameter(TypeParameterElement e, P p) { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor7.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor7.java index 4daef619843..262f5ecf857 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor7.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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,12 +88,12 @@ public class ElementKindVisitor7 extends ElementKindVisitor6 { } /** - * {@inheritDoc} + * {@inheritDoc ElementKindVisitor6} * * @implSpec This implementation calls {@code defaultAction}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} + * @param e {@inheritDoc ElementKindVisitor6} + * @param p {@inheritDoc ElementKindVisitor6} * @return the result of {@code defaultAction} */ @Override diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java index c463c0b5ab6..0d915b2f465 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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 @@ -27,8 +27,9 @@ 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; +import javax.lang.model.element.ElementVisitor; +import static javax.lang.model.SourceVersion.*; /** * A visitor of program elements based on their {@linkplain @@ -82,12 +83,12 @@ public class ElementKindVisitor9 extends ElementKindVisitor8 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param e the element to visit - * @param p a visitor-specified parameter + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} * @return the result of {@code defaultAction} */ @Override diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner14.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner14.java index 648d710f987..e8406737938 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner14.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner14.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -30,6 +30,7 @@ import java.util.ArrayList; import javax.lang.model.element.*; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; +import javax.lang.model.element.ElementVisitor; import static javax.lang.model.SourceVersion.*; /** @@ -98,15 +99,15 @@ public class ElementScanner14 extends ElementScanner9 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation scans the type parameters, if * any, and then the enclosed elements. * * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return the result of scanning + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementScanner6} */ @Override public R visitType(TypeElement e, P p) { @@ -114,15 +115,16 @@ public class ElementScanner14 extends ElementScanner9 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation first scans the type parameters, if any, and then * the parameters. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return the result of scanning + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementScanner6} */ + @Override public R visitExecutable(ExecutableElement e, P p) { return scan(createScanningList(e, e.getParameters()), p); } @@ -140,13 +142,13 @@ public class ElementScanner14 extends ElementScanner9 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation scans the enclosed elements. * - * @param e the element to visit - * @param p a visitor-specified parameter - * @return the result of the scan + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementScanner6} */ @Override public R visitRecordComponent(RecordComponentElement e, P p) { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner6.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner6.java index c2b628b033c..47a2029d850 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner6.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -27,10 +27,10 @@ package javax.lang.model.util; import javax.lang.model.element.*; import javax.annotation.processing.SupportedSourceVersion; +import javax.lang.model.element.ElementVisitor; 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_6 RELEASE_6} @@ -162,20 +162,21 @@ public class ElementScanner6 extends AbstractElementVisitor6 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation scans the enclosed elements. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} * @return the result of scanning */ + @Override public R visitPackage(PackageElement e, P p) { return scan(e.getEnclosedElements(), p); } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation scans the enclosed elements. * Note that type parameters are not scanned by this @@ -183,25 +184,27 @@ public class ElementScanner6 extends AbstractElementVisitor6 { * {@linkplain TypeElement#getEnclosedElements enclosed elements * of a type}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} * @return the result of scanning */ + @Override public R visitType(TypeElement e, P p) { return scan(e.getEnclosedElements(), p); } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation scans the enclosed elements, unless the * element is a {@code RESOURCE_VARIABLE} in which case {@code * visitUnknown} is called. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} * @return the result of scanning */ + @Override public R visitVariable(VariableElement e, P p) { if (e.getKind() != ElementKind.RESOURCE_VARIABLE) return scan(e.getEnclosedElements(), p); @@ -210,30 +213,46 @@ public class ElementScanner6 extends AbstractElementVisitor6 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation scans the parameters. * Note that type parameters are not scanned by this * implementation. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} * @return the result of scanning */ + @Override public R visitExecutable(ExecutableElement e, P p) { return scan(e.getParameters(), p); } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation scans the enclosed elements. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} * @return the result of scanning */ + @Override public R visitTypeParameter(TypeParameterElement e, P p) { return scan(e.getEnclosedElements(), p); } + + /** + * {@inheritDoc ElementVisitor} + * + * @implSpec This implementation calls {@code visitUnknown(e, p)}. + * + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return the result of scanning + */ + @Override + public R visitRecordComponent(RecordComponentElement e, P p) { + return visitUnknown(e, p); + } } diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner7.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner7.java index 73e286cea55..2135dfedbc3 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner7.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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 @@ -28,6 +28,7 @@ package javax.lang.model.util; import javax.lang.model.element.*; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; +import javax.lang.model.element.ElementVisitor; import static javax.lang.model.SourceVersion.*; @@ -104,13 +105,13 @@ public class ElementScanner7 extends ElementScanner6 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation scans the enclosed elements. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return the result of scanning + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementScanner6} */ @Override public R visitVariable(VariableElement e, P p) { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java index 3ee290d70cf..ffea7566e74 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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 @@ -28,6 +28,7 @@ package javax.lang.model.util; import javax.lang.model.element.*; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; +import javax.lang.model.element.ElementVisitor; import static javax.lang.model.SourceVersion.*; @@ -97,13 +98,13 @@ public class ElementScanner9 extends ElementScanner8 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation scans the enclosed elements. * - * @param e the element to visit - * @param p a visitor-specified parameter - * @return the result of the scan + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementScanner6} */ @Override public R visitModule(ModuleElement e, P p) { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java index bf63d64f6b0..9b73fbbffca 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -125,12 +125,12 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param b {@inheritDoc} - * @param p {@inheritDoc} + * @param b {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitBoolean(boolean b, P p) { @@ -138,12 +138,12 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param b {@inheritDoc} - * @param p {@inheritDoc} + * @param b {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitByte(byte b, P p) { @@ -151,12 +151,12 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param c {@inheritDoc} - * @param p {@inheritDoc} + * @param c {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitChar(char c, P p) { @@ -164,13 +164,13 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * * - * @param d {@inheritDoc} - * @param p {@inheritDoc} + * @param d {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitDouble(double d, P p) { @@ -178,13 +178,13 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * * - * @param f {@inheritDoc} - * @param p {@inheritDoc} + * @param f {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitFloat(float f, P p) { @@ -192,12 +192,12 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param i {@inheritDoc} - * @param p {@inheritDoc} + * @param i {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitInt(int i, P p) { @@ -205,12 +205,12 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param i {@inheritDoc} - * @param p {@inheritDoc} + * @param i {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitLong(long i, P p) { @@ -218,12 +218,12 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param s {@inheritDoc} - * @param p {@inheritDoc} + * @param s {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitShort(short s, P p) { @@ -231,12 +231,12 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param s {@inheritDoc} - * @param p {@inheritDoc} + * @param s {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitString(String s, P p) { @@ -244,12 +244,12 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitType(TypeMirror t, P p) { @@ -257,12 +257,12 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param c {@inheritDoc} - * @param p {@inheritDoc} + * @param c {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitEnumConstant(VariableElement c, P p) { @@ -270,12 +270,12 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param a {@inheritDoc} - * @param p {@inheritDoc} + * @param a {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitAnnotation(AnnotationMirror a, P p) { @@ -283,12 +283,12 @@ public class SimpleAnnotationValueVisitor6 } /** - * {@inheritDoc} + * {@inheritDoc AnnotationValueVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param vals {@inheritDoc} - * @param p {@inheritDoc} + * @param vals {@inheritDoc AnnotationValueVisitor} + * @param p {@inheritDoc AnnotationValueVisitor} * @return the result of {@code defaultAction} */ public R visitArray(List vals, P p) { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor14.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor14.java index 8d45c35ae7b..34efdaf71d3 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor14.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor14.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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 @@ -27,6 +27,7 @@ package javax.lang.model.util; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; +import javax.lang.model.element.ElementVisitor; import javax.lang.model.element.RecordComponentElement; import static javax.lang.model.SourceVersion.*; @@ -78,14 +79,14 @@ public class SimpleElementVisitor14 extends SimpleElementVisitor9 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec Visits a {@code RecordComponentElement} by calling {@code * defaultAction}. * - * @param e the element to visit - * @param p a visitor-specified parameter - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ @Override public R visitRecordComponent(RecordComponentElement e, P p) { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor6.java index e894a076295..2e8e27eeff0 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor6.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -28,6 +28,7 @@ package javax.lang.model.util; import javax.lang.model.element.*; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; +import javax.lang.model.element.ElementVisitor; import static javax.lang.model.SourceVersion.*; @@ -110,6 +111,7 @@ public class SimpleElementVisitor6 extends AbstractElementVisitor6 { protected SimpleElementVisitor6(R defaultValue){ DEFAULT_VALUE = defaultValue; } + /** * The default action for visit methods. * @@ -125,42 +127,45 @@ public class SimpleElementVisitor6 extends AbstractElementVisitor6 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ + @Override public R visitPackage(PackageElement e, P p) { return defaultAction(e, p); } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ + @Override public R visitType(TypeElement e, P p) { return defaultAction(e, p); } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation calls {@code defaultAction}, unless the * element is a {@code RESOURCE_VARIABLE} in which case {@code * visitUnknown} is called. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ + @Override public R visitVariable(VariableElement e, P p) { if (e.getKind() != ElementKind.RESOURCE_VARIABLE) return defaultAction(e, p); @@ -169,27 +174,29 @@ public class SimpleElementVisitor6 extends AbstractElementVisitor6 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ + @Override public R visitExecutable(ExecutableElement e, P p) { return defaultAction(e, p); } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ + @Override public R visitTypeParameter(TypeParameterElement e, P p) { return defaultAction(e, p); } diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor7.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor7.java index d511deceba4..47ad53797fb 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor7.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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 @@ -28,6 +28,7 @@ package javax.lang.model.util; import javax.lang.model.element.*; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; +import javax.lang.model.element.ElementVisitor; import static javax.lang.model.SourceVersion.*; /** @@ -86,13 +87,13 @@ public class SimpleElementVisitor7 extends SimpleElementVisitor6 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param e {@inheritDoc} - * @param p {@inheritDoc} - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ @Override public R visitVariable(VariableElement e, P p) { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java index 497fed1a059..2d368a749ac 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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 @@ -27,6 +27,7 @@ package javax.lang.model.util; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; +import javax.lang.model.element.ElementVisitor; import javax.lang.model.element.ModuleElement; import static javax.lang.model.SourceVersion.*; @@ -78,14 +79,14 @@ public class SimpleElementVisitor9 extends SimpleElementVisitor8 { } /** - * {@inheritDoc} + * {@inheritDoc ElementVisitor} * * @implSpec Visits a {@code ModuleElement} by calling {@code * defaultAction}. * - * @param e the element to visit - * @param p a visitor-specified parameter - * @return {@inheritDoc} + * @param e {@inheritDoc ElementVisitor} + * @param p {@inheritDoc ElementVisitor} + * @return {@inheritDoc ElementVisitor} */ @Override public R visitModule(ModuleElement e, P p) { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java index 60674315d8c..ce6321d9fd3 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -29,6 +29,7 @@ import javax.lang.model.type.*; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; import static javax.lang.model.SourceVersion.*; +import javax.lang.model.type.TypeVisitor; /** @@ -126,118 +127,127 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 { } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ + @Override public R visitPrimitive(PrimitiveType t, P p) { return defaultAction(t, p); } /** - * {@inheritDoc} This implementation calls {@code defaultAction}. + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ + @Override public R visitNull(NullType t, P p){ return defaultAction(t, p); } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ + @Override public R visitArray(ArrayType t, P p){ return defaultAction(t, p); } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ + @Override public R visitDeclared(DeclaredType t, P p){ return defaultAction(t, p); } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ + @Override public R visitError(ErrorType t, P p){ return defaultAction(t, p); } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ + @Override public R visitTypeVariable(TypeVariable t, P p){ return defaultAction(t, p); } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ + @Override public R visitWildcard(WildcardType t, P p){ return defaultAction(t, p); } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ + @Override public R visitExecutable(ExecutableType t, P p) { return defaultAction(t, p); } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ + @Override public R visitNoType(NoType t, P p){ return defaultAction(t, p); } diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java index 0e5c6eeee38..c89ed9b7e0f 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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 @@ -29,6 +29,7 @@ import javax.lang.model.type.*; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; import static javax.lang.model.SourceVersion.*; +import javax.lang.model.type.TypeVisitor; /** * A simple visitor of types with default behavior appropriate for the @@ -86,12 +87,12 @@ public class SimpleTypeVisitor7 extends SimpleTypeVisitor6 { } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ @Override diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java index 299fee1199d..46957941dff 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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 @@ -29,6 +29,7 @@ import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; import javax.lang.model.type.IntersectionType; import static javax.lang.model.SourceVersion.*; +import javax.lang.model.type.TypeVisitor; /** * A simple visitor of types with default behavior appropriate for the @@ -80,12 +81,12 @@ public class SimpleTypeVisitor8 extends SimpleTypeVisitor7 { } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ @Override diff --git a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor6.java b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor6.java index 602e89ae08b..3bdaac98798 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor6.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, 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 @@ -105,14 +105,14 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 { } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation dispatches to the visit method for * the specific {@linkplain TypeKind kind} of primitive type: * {@code BOOLEAN}, {@code BYTE}, etc. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of the kind-specific visit method */ @Override @@ -253,14 +253,14 @@ public class TypeKindVisitor6 extends SimpleTypeVisitor6 { } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation dispatches to the visit method for * the specific {@linkplain TypeKind kind} of pseudo-type: * {@code VOID}, {@code PACKAGE}, {@code MODULE}, or {@code NONE}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of the kind-specific visit method */ @Override diff --git a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor7.java b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor7.java index 637a65bb7a1..d0d053b4b3e 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor7.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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,13 +88,13 @@ public class TypeKindVisitor7 extends TypeKindVisitor6 { } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} - * @return the result of {@code defaultAction} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} + * @return the result of {@code defaultAction} */ @Override public R visitUnion(UnionType t, P p) { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor8.java b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor8.java index bc0da84315b..8290351e854 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor8.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor8.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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,12 +82,12 @@ public class TypeKindVisitor8 extends TypeKindVisitor7 { } /** - * {@inheritDoc} + * {@inheritDoc TypeVisitor} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeVisitor} + * @param p {@inheritDoc TypeVisitor} * @return the result of {@code defaultAction} */ @Override diff --git a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java index 2e7ab2c4fd1..93345749f74 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, 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 @@ -83,12 +83,12 @@ public class TypeKindVisitor9 extends TypeKindVisitor8 { } /** - * {@inheritDoc} + * {@inheritDoc TypeKindVisitor6} * * @implSpec This implementation calls {@code defaultAction}. * - * @param t {@inheritDoc} - * @param p {@inheritDoc} + * @param t {@inheritDoc TypeKindVisitor6} + * @param p {@inheritDoc TypeKindVisitor6} * @return the result of {@code defaultAction} * * @since 10