8257636: Update usage of "type" terminology in java.lang.Class and java.lang.reflect

Reviewed-by: darcy
This commit is contained in:
Julia Boes 2020-12-17 11:32:58 +00:00
parent 04a1e5b75b
commit 952dc70402
14 changed files with 74 additions and 73 deletions

View file

@ -46,8 +46,8 @@ public interface AnnotatedArrayType extends AnnotatedType {
/**
* Returns the potentially annotated type that this type is a member of, if
* this type represents a nested type. For example, if this type is
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
* this type represents a nested class or interface. For example, if this
* type is {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
*
* <p>Returns {@code null} for an {@code AnnotatedType} that is an instance
* of {@code AnnotatedArrayType}.

View file

@ -248,7 +248,7 @@ import sun.reflect.annotation.AnnotationType;
*
* <p>Similarly, attempting to read an enum-valued member will result in
* a {@link EnumConstantNotPresentException} if the enum constant in the
* annotation is no longer present in the enum type.
* annotation is no longer present in the enum class.
*
* <p>If an annotation type <i>T</i> is (meta-)annotated with an
* {@code @Repeatable} annotation whose value element indicates a type

View file

@ -49,13 +49,13 @@ public interface AnnotatedParameterizedType extends AnnotatedType {
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
*
* <p>Returns {@code null} if this {@code AnnotatedType} represents a
* top-level type, or a local or anonymous class, or a primitive type, or
* void.
* top-level class or interface, or a local or anonymous class, or
* a primitive type, or void.
*
* @return an {@code AnnotatedType} object representing the potentially
* annotated type that this type is a member of, or {@code null}
* @throws TypeNotPresentException if the owner type
* refers to a non-existent type declaration
* refers to a non-existent class or interface declaration
* @throws MalformedParameterizedTypeException if the owner type
* refers to a parameterized type that cannot be instantiated
* for any reason

View file

@ -55,8 +55,8 @@ public interface AnnotatedType extends AnnotatedElement {
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
*
* <p>Returns {@code null} if this {@code AnnotatedType} represents a
* top-level type, or a local or anonymous class, or a primitive type, or
* void.
* top-level class or interface, or a local or anonymous class, or
* a primitive type, or void.
*
* <p>Returns {@code null} if this {@code AnnotatedType} is an instance of
* {@code AnnotatedArrayType}, {@code AnnotatedTypeVariable}, or
@ -69,7 +69,7 @@ public interface AnnotatedType extends AnnotatedElement {
* @return an {@code AnnotatedType} object representing the potentially
* annotated type that this type is a member of, or {@code null}
* @throws TypeNotPresentException if the owner type
* refers to a non-existent type declaration
* refers to a non-existent class or interface declaration
* @throws MalformedParameterizedTypeException if the owner type
* refers to a parameterized type that cannot be instantiated
* for any reason

View file

@ -462,7 +462,7 @@ public final class Constructor<T> extends Executable {
* after possible unwrapping, a parameter value
* cannot be converted to the corresponding formal
* parameter type by a method invocation conversion; if
* this constructor pertains to an enum type.
* this constructor pertains to an enum class.
* @throws InstantiationException if the class that declares the
* underlying constructor represents an abstract class.
* @throws InvocationTargetException if the underlying constructor

View file

@ -206,10 +206,10 @@ class Field extends AccessibleObject implements Member {
/**
* Returns {@code true} if this field represents an element of
* an enumerated type; returns {@code false} otherwise.
* an enumerated class; returns {@code false} otherwise.
*
* @return {@code true} if and only if this field represents an element of
* an enumerated type.
* an enumerated class.
* @since 1.5
*/
public boolean isEnumConstant() {
@ -258,7 +258,7 @@ class Field extends AccessibleObject implements Member {
* <cite>The Java Virtual Machine Specification</cite>
* @throws TypeNotPresentException if the generic type
* signature of the underlying field refers to a non-existent
* type declaration
* class or interface declaration
* @throws MalformedParameterizedTypeException if the generic
* signature of the underlying field refers to a parameterized type
* that cannot be instantiated for any reason

View file

@ -44,8 +44,8 @@ public interface GenericArrayType extends Type {
*
* @return a {@code Type} object representing the component type
* of this array
* @throws TypeNotPresentException if the underlying array type's
* component type refers to a non-existent type declaration
* @throws TypeNotPresentException if the underlying array type's component
* type refers to a non-existent class or interface declaration
* @throws MalformedParameterizedTypeException if the
* underlying array type's component type refers to a
* parameterized type that cannot be instantiated for any reason

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, 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,8 +28,8 @@ package java.lang.reflect;
/**
* Thrown when a syntactically malformed signature attribute is
* encountered by a reflective method that needs to interpret the
* generic signature information for a type, method or constructor.
* encountered by a reflective method that needs to interpret the generic
* signature information for a class or interface, method or constructor.
*
* @since 1.5
*/

View file

@ -282,9 +282,9 @@ public final class Method extends Executable {
* specified in
* <cite>The Java Virtual Machine Specification</cite>
* @throws TypeNotPresentException if the underlying method's
* return type refers to a non-existent type declaration
* return type refers to a non-existent class or interface declaration
* @throws MalformedParameterizedTypeException if the
* underlying method's return typed refers to a parameterized
* underlying method's return type refers to a parameterized
* type that cannot be instantiated for any reason
* @since 1.5
*/
@ -603,8 +603,7 @@ public final class Method extends Executable {
* method; returns {@code false} otherwise.
*
* A default method is a public non-abstract instance method, that
* is, a non-static method with a body, declared in an interface
* type.
* is, a non-static method with a body, declared in an interface.
*
* @return true if and only if this method is a default
* method as defined by the Java Language Specification.

View file

@ -32,15 +32,15 @@ package java.lang.reflect;
*
* <p>A parameterized type is created the first time it is needed by a
* reflective method, as specified in this package. When a
* parameterized type p is created, the generic type declaration that
* p instantiates is resolved, and all type arguments of p are created
* parameterized type p is created, the generic class or interface declaration
* that p instantiates is resolved, and all type arguments of p are created
* recursively. See {@link java.lang.reflect.TypeVariable
* TypeVariable} for details on the creation process for type
* variables. Repeated creation of a parameterized type has no effect.
*
* <p>Instances of classes that implement this interface must implement
* an equals() method that equates any two instances that share the
* same generic type declaration and have equal type parameters.
* same generic class or interface declaration and have equal type parameters.
*
* @jls 4.5 Parameterized Types
* @since 1.5
@ -56,8 +56,8 @@ public interface ParameterizedType extends Type {
*
* @return an array of {@code Type} objects representing the actual type
* arguments to this type
* @throws TypeNotPresentException if any of the
* actual type arguments refers to a non-existent type declaration
* @throws TypeNotPresentException if any of the actual type arguments
* refers to a non-existent class or interface declaration
* @throws MalformedParameterizedTypeException if any of the
* actual type parameters refer to a parameterized type that cannot
* be instantiated for any reason
@ -86,7 +86,7 @@ public interface ParameterizedType extends Type {
* this type is a member of. If this type is a top-level type,
* {@code null} is returned
* @throws TypeNotPresentException if the owner type
* refers to a non-existent type declaration
* refers to a non-existent class or interface declaration
* @throws MalformedParameterizedTypeException if the owner type
* refers to a parameterized type that cannot be instantiated
* for any reason

View file

@ -240,10 +240,11 @@ import static java.lang.module.ModuleDescriptor.Modifier.SYNTHETIC;
*
* <p>
* A dynamic module can read the modules of all of the superinterfaces of a proxy
* class and the modules of the types referenced by all public method signatures
* of a proxy class. If a superinterface or a referenced type, say {@code T},
* is in a non-exported package, the {@linkplain Module module} of {@code T} is
* updated to export the package of {@code T} to the dynamic module.
* class and the modules of the classes and interfaces referenced by
* all public method signatures of a proxy class. If a superinterface or
* a referenced class or interface, say {@code T}, is in a non-exported package,
* the {@linkplain Module module} of {@code T} is updated to export the
* package of {@code T} to the dynamic module.
*
* <h3>Methods Duplicated in Multiple Proxy Interfaces</h3>
*

View file

@ -203,10 +203,11 @@ final class ProxyGenerator extends ClassWriter {
}
/**
* Return an array of the type names from an array of Classes.
* Return an array of the class and interface names from an array of Classes.
*
* @param classes an array of classes or interfaces
* @return the array of class names; or null if there are no classes
* @return the array of class and interface names; or null if classes is
* null or empty
*/
private static String[] typeNames(List<Class<?>> classes) {
if (classes == null || classes.size() == 0)

View file

@ -43,7 +43,7 @@ import java.util.Objects;
*
* @see Class#getRecordComponents()
* @see java.lang.Record
* @jls 8.10 Record Types
* @jls 8.10 Record Classes
* @since 16
*/
public final class RecordComponent implements AnnotatedElement {
@ -83,7 +83,7 @@ public final class RecordComponent implements AnnotatedElement {
}
/**
* Returns a {@code String} that describes the generic type signature for
* Returns a {@code String} that describes the generic type signature for
* this record component.
*
* @return a {@code String} that describes the generic type signature for