8287886: Further terminology updates to match JLS

Reviewed-by: jjg
This commit is contained in:
Joe Darcy 2022-06-08 00:56:57 +00:00
parent 68c5957b9e
commit 39ec58b63c
6 changed files with 64 additions and 61 deletions

@ -115,7 +115,7 @@ public abstract class AbstractProcessor implements Processor {
initialized &&
processingEnv.getSourceVersion().compareTo(SourceVersion.RELEASE_8) <= 0;
return arrayToSet(sat.value(), stripModulePrefixes,
"annotation type", "@SupportedAnnotationTypes");
"annotation interface", "@SupportedAnnotationTypes");
}
}

@ -70,7 +70,7 @@ public interface RoundEnvironment {
Set<? extends Element> getRootElements();
/**
* Returns the elements annotated with the given annotation type.
* Returns the elements annotated with the given annotation interface.
* The annotation may appear directly or be inherited. Only
* package elements, module elements, and type elements <i>included</i> in this
* round of annotation processing, or declarations of members,
@ -84,21 +84,21 @@ public interface RoundEnvironment {
* simply because a {@code module-info} file for that module was
* created.
*
* @param a annotation type being requested
* @return the elements annotated with the given annotation type,
* @param a annotation interface being requested
* @return the elements annotated with the given annotation interface,
* or an empty set if there are none
* @throws IllegalArgumentException if the argument does not
* represent an annotation type
* represent an annotation interface
*/
Set<? extends Element> getElementsAnnotatedWith(TypeElement a);
/**
* Returns the elements annotated with one or more of the given
* annotation types.
* annotation interfaces.
*
* @apiNote This method may be useful when processing repeating
* annotations by looking for an annotation type and its
* containing annotation type at the same time.
* annotations by looking for an annotation interface and its
* containing annotation interface at the same time.
*
* @implSpec The default implementation of this method creates an
* empty result set, iterates over the annotations in the argument
@ -107,11 +107,11 @@ public interface RoundEnvironment {
* set. Finally, the contents of the result set are returned as an
* unmodifiable set.
*
* @param annotations annotation types being requested
* @param annotations annotation interfaces being requested
* @return the elements annotated with one or more of the given
* annotation types, or an empty set if there are none
* annotation interfaces, or an empty set if there are none
* @throws IllegalArgumentException if the any elements of the
* argument set do not represent an annotation type
* argument set do not represent an annotation interface
* @jls 9.6.3 Repeatable Annotation Interfaces
* @since 9
*/
@ -125,7 +125,7 @@ public interface RoundEnvironment {
}
/**
* Returns the elements annotated with the given annotation type.
* Returns the elements annotated with the given annotation interface.
* The annotation may appear directly or be inherited. Only
* package elements, module elements, and type elements <i>included</i> in this
* round of annotation processing, or declarations of members,
@ -141,21 +141,21 @@ public interface RoundEnvironment {
*
* <p> Note: An implementation of this method typically performs
* an internal conversion from the runtime reflective
* representation of an annotation type as a {@code Class} object
* representation of an annotation interface as a {@code Class} object
* to a different representation used for annotation
* processing. The set of annotation types present in the runtime
* context may differ from the set of annotation types present in
* processing. The set of annotation interfaces present in the runtime
* context may differ from the set of annotation interfaces present in
* the context of annotation processing in a particular
* environmental configuration. If an runtime annotation type is
* environmental configuration. If an runtime annotation interface is
* not present in the annotation processing context, the situation
* is not treated as an error and no elements are found for that
* annotation type.
* annotation interface.
*
* @param a annotation type being requested
* @return the elements annotated with the given annotation type,
* @param a annotation interface being requested
* @return the elements annotated with the given annotation interface,
* or an empty set if there are none
* @throws IllegalArgumentException if the argument does not
* represent an annotation type
* represent an annotation interface
*
* @see javax.lang.model.AnnotatedConstruct#getAnnotation(Class)
* @see javax.lang.model.AnnotatedConstruct#getAnnotationsByType(Class)
@ -164,23 +164,23 @@ public interface RoundEnvironment {
/**
* Returns the elements annotated with one or more of the given
* annotation types.
* annotation interfaces.
*
* <p> Note: An implementation of this method typically performs
* an internal conversion from the runtime reflective
* representation of an annotation type as a {@code Class} object
* representation of an annotation interface as a {@code Class} object
* to a different representation used for annotation
* processing. The set of annotation types present in the runtime
* context may differ from the set of annotation types present in
* processing. The set of annotation interfaces present in the runtime
* context may differ from the set of annotation interfaces present in
* the context of annotation processing in a particular
* environmental configuration. If an runtime annotation type is
* environmental configuration. If an runtime annotation interface is
* not present in the annotation processing context, the situation
* is not treated as an error and no elements are found for that
* annotation type.
* annotation interface.
*
* @apiNote This method may be useful when processing repeating
* annotations by looking for an annotation type and its
* containing annotation type at the same time.
* annotations by looking for an annotation interface and its
* containing annotation interface at the same time.
*
* @implSpec The default implementation of this method creates an
* empty result set, iterates over the annotations in the argument
@ -189,11 +189,11 @@ public interface RoundEnvironment {
* set. Finally, the contents of the result set are returned as an
* unmodifiable set.
*
* @param annotations annotation types being requested
* @param annotations annotation interfaces being requested
* @return the elements annotated with one or more of the given
* annotation types, or an empty set if there are none
* annotation interfaces, or an empty set if there are none
* @throws IllegalArgumentException if the any elements of the
* argument set do not represent an annotation type
* argument set do not represent an annotation interface
* @jls 9.6.3 Repeatable Annotation Interfaces
*
* @see javax.lang.model.AnnotatedConstruct#getAnnotation(Class)

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2022, 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,8 @@ import javax.lang.model.type.*;
* the methods in this interface.
*
* <p>In the definitions below, an annotation <i>A</i> has an
* annotation type <i>AT</i>. If <i>AT</i> is a repeatable annotation
* type, the type of the containing annotation is <i>ATC</i>.
* annotation interface <i>AI</i>. If <i>AI</i> is a repeatable annotation
* interface, the type of the containing annotation is <i>AIC</i>.
*
* <p>Annotation <i>A</i> is <em>directly present</em> on a construct
* <i>C</i> if either:
@ -65,21 +65,21 @@ import javax.lang.model.type.*;
* declared as applying to
* the source code representation of <i>C</i>.
*
* <p>Typically, if exactly one annotation of type <i>AT</i> appears in
* <p>Typically, if exactly one annotation of type <i>AI</i> appears in
* the source code of representation of <i>C</i>, then <i>A</i> is
* explicitly declared as applying to <i>C</i>.
*
* An annotation of type <i>AT</i> on a {@linkplain
* An annotation of type <i>AI</i> on a {@linkplain
* RecordComponentElement record component} can be implicitly propagated
* down to affiliated mandated members. Type annotations modifying the
* type of a record component can be also propagated to mandated
* members. Propagation of the annotations to mandated members is
* governed by rules given in the <cite>The Java Language
* Specification</cite>.
* Specification</cite> (JLS {@jls 8.10.1}).
*
* If there are multiple annotations of type <i>AT</i> present on
* <i>C</i>, then if <i>AT</i> is repeatable annotation type, an
* annotation of type <i>ATC</i> is {@linkplain javax.lang.model.util.Elements#getOrigin(AnnotatedConstruct, AnnotationMirror) implicitly declared} on <i>C</i>.
* If there are multiple annotations of type <i>AI</i> present on
* <i>C</i>, then if <i>AI</i> is repeatable annotation interface, an
* annotation of type <i>AIC</i> is {@linkplain javax.lang.model.util.Elements#getOrigin(AnnotatedConstruct, AnnotationMirror) implicitly declared} on <i>C</i>.
* <li> A representation of <i>A</i> appears in the executable output
* for <i>C</i>, such as the {@code RuntimeVisibleAnnotations} (JVMS {@jvms 4.7.16}) or
* {@code RuntimeVisibleParameterAnnotations} (JVMS {@jvms 4.7.17}) attributes of a class
@ -93,8 +93,8 @@ import javax.lang.model.type.*;
*
* <li><i>A</i> is directly present on <i>C</i>.
*
* <li>No annotation of type <i>AT</i> is directly present on
* <i>C</i>, and <i>C</i> is a class and <i>AT</i> is inheritable
* <li>No annotation of type <i>AI</i> is directly present on
* <i>C</i>, and <i>C</i> is a class and <i>AI</i> is inheritable
* and <i>A</i> is present on the superclass of <i>C</i>.
*
* </ul>
@ -104,13 +104,13 @@ import javax.lang.model.type.*;
*
* <ul>
*
* <li><i>AT</i> is a repeatable annotation type with a containing
* annotation type <i>ATC</i>.
* <li><i>AI</i> is a repeatable annotation interface with a containing
* annotation interface <i>AIC</i>.
*
* <li>An annotation of type <i>ATC</i> is directly present on
* <li>An annotation of type <i>AIC</i> is directly present on
* <i>C</i> and <i>A</i> is an annotation included in the result of
* calling the {@code value} method of the directly present annotation
* of type <i>ATC</i>.
* of type <i>AIC</i>.
*
* </ul>
*
@ -121,8 +121,8 @@ import javax.lang.model.type.*;
*
* <li> <i>A</i> is directly or indirectly present on <i>C</i>.
*
* <li> No annotation of type <i>AT</i> is directly or indirectly
* present on <i>C</i>, and <i>C</i> is a class, and <i>AT</i> is
* <li> No annotation of type <i>AI</i> is directly or indirectly
* present on <i>C</i>, and <i>C</i> is a class, and <i>AI</i> is
* inheritable, and <i>A</i> is associated with the superclass of
* <i>C</i>.
*
@ -163,19 +163,19 @@ public interface AnnotatedConstruct {
* <blockquote>
* <i>Note:</i> This method is unlike others in this and related
* interfaces. It operates on runtime reflective information &mdash;
* representations of annotation types currently loaded into the
* representations of annotation interfaces currently loaded into the
* VM &mdash; rather than on the representations defined by and used
* throughout these interfaces. Consequently, calling methods on
* the returned annotation object can throw many of the exceptions
* that can be thrown when calling methods on an annotation object
* returned by core reflection. This method is intended for
* callers that are written to operate on a known, fixed set of
* annotation types.
* annotation interfaces.
* </blockquote>
*
* @param <A> the annotation type
* @param <A> the annotation interface
* @param annotationType the {@code Class} object corresponding to
* the annotation type
* the annotation interface
*
* @see #getAnnotationMirrors()
* @see java.lang.reflect.AnnotatedElement#getAnnotation
@ -202,7 +202,7 @@ public interface AnnotatedConstruct {
*
* The difference between this method and {@link #getAnnotation(Class)}
* is that this method detects if its argument is a <em>repeatable
* annotation type</em>, and if so, attempts to find one or more
* annotation interface</em>, and if so, attempts to find one or more
* annotations of that type by "looking through" a container annotation.
*
* <p> The annotations returned by this method could contain an element
@ -220,19 +220,19 @@ public interface AnnotatedConstruct {
* <blockquote>
* <i>Note:</i> This method is unlike others in this and related
* interfaces. It operates on runtime reflective information &mdash;
* representations of annotation types currently loaded into the
* representations of annotation interfaces currently loaded into the
* VM &mdash; rather than on the representations defined by and used
* throughout these interfaces. Consequently, calling methods on
* the returned annotation object can throw many of the exceptions
* that can be thrown when calling methods on an annotation object
* returned by core reflection. This method is intended for
* callers that are written to operate on a known, fixed set of
* annotation types.
* annotation interfaces.
* </blockquote>
*
* @param <A> the annotation type
* @param <A> the annotation interface
* @param annotationType the {@code Class} object corresponding to
* the annotation type
* the annotation interface
* @return this construct's annotations for the specified annotation
* type if present on this construct, else an empty array
*

@ -56,7 +56,7 @@ public interface AnnotationMirror {
* values appear in the annotation's source.
*
* @apiNote
* An annotation mirror of a marker annotation type
* An annotation mirror of a marker annotation interface
* will by definition have an empty map.
*
* <p>To fill in default values, use {@link

@ -30,8 +30,11 @@ import javax.lang.model.type.*;
/**
* Represents a method, constructor, or initializer (static or
* instance) of a class or interface, including annotation type
* instance) of a class or interface, including annotation interface
* elements.
* Annotation interface elements are methods restricted to have no
* formal parameters, no type parameters, and no {@code throws}
* clause, among other restrictions; see JLS {@jls 9.6.1} for details
*
* @see ExecutableType
* @since 1.6

@ -350,7 +350,7 @@ public interface Elements {
*
* @param c the construct the annotation mirror modifies
* @param a the annotation mirror being examined
* @jls 9.6.3 Repeatable Annotation Types
* @jls 9.6.3 Repeatable Annotation Interfaces
* @jls 9.7.5 Multiple Annotations of the Same Interface
* @since 9
*/
@ -425,7 +425,7 @@ public interface Elements {
* @jls 8.8.9 Default Constructor
* @jls 8.9.3 Enum Members
* @jls 8.10.3 Record Members
* @jls 9.6.3 Repeatable Annotation Types
* @jls 9.6.3 Repeatable Annotation Interfaces
* @jls 9.7.5 Multiple Annotations of the Same Interface
*/
MANDATED,