mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8257636: Update usage of "type" terminology in java.lang.Class and java.lang.reflect
Reviewed-by: darcy
This commit is contained in:
parent
04a1e5b75b
commit
952dc70402
14 changed files with 74 additions and 73 deletions
|
@ -91,8 +91,8 @@ import sun.reflect.misc.ReflectUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instances of the class {@code Class} represent classes and
|
* Instances of the class {@code Class} represent classes and
|
||||||
* interfaces in a running Java application. An enum type and a record
|
* interfaces in a running Java application. An enum class and a record
|
||||||
* type are kinds of class; an annotation type is a kind of
|
* class are kinds of class; an annotation interface is a kind of
|
||||||
* interface. Every array also belongs to a class that is reflected as
|
* interface. Every array also belongs to a class that is reflected as
|
||||||
* a {@code Class} object that is shared by all arrays with the same
|
* a {@code Class} object that is shared by all arrays with the same
|
||||||
* element type and number of dimensions. The primitive Java types
|
* element type and number of dimensions. The primitive Java types
|
||||||
|
@ -131,7 +131,7 @@ import sun.reflect.misc.ReflectUtil;
|
||||||
* </pre></blockquote>
|
* </pre></blockquote>
|
||||||
*
|
*
|
||||||
* It is also possible to get the {@code Class} object for a named
|
* It is also possible to get the {@code Class} object for a named
|
||||||
* type (or for {@code void}) using a <i>class literal</i>.
|
* class or interface (or for {@code void}) using a <i>class literal</i>.
|
||||||
* For example:
|
* For example:
|
||||||
*
|
*
|
||||||
* <blockquote>
|
* <blockquote>
|
||||||
|
@ -159,8 +159,8 @@ import sun.reflect.misc.ReflectUtil;
|
||||||
* {@link java.lang.invoke.MethodHandles.Lookup#defineHiddenClass(byte[], boolean, MethodHandles.Lookup.ClassOption...)
|
* {@link java.lang.invoke.MethodHandles.Lookup#defineHiddenClass(byte[], boolean, MethodHandles.Lookup.ClassOption...)
|
||||||
* Lookup::defineHiddenClass} is a {@linkplain Class#isHidden() <em>hidden</em>}
|
* Lookup::defineHiddenClass} is a {@linkplain Class#isHidden() <em>hidden</em>}
|
||||||
* class or interface.
|
* class or interface.
|
||||||
* All kinds of class, including enum types and record types, may be
|
* All kinds of class, including enum classes and record classes, may be
|
||||||
* hidden classes; all kinds of interface, including annotation types,
|
* hidden classes; all kinds of interface, including annotation interfaces,
|
||||||
* may be hidden interfaces.
|
* may be hidden interfaces.
|
||||||
*
|
*
|
||||||
* The {@linkplain #getName() name of a hidden class or interface} is
|
* The {@linkplain #getName() name of a hidden class or interface} is
|
||||||
|
@ -294,7 +294,7 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
if (isAnnotation()) {
|
if (isAnnotation()) {
|
||||||
sb.append('@');
|
sb.append('@');
|
||||||
}
|
}
|
||||||
if (isInterface()) { // Note: all annotation types are interfaces
|
if (isInterface()) { // Note: all annotation interfaces are interfaces
|
||||||
sb.append("interface");
|
sb.append("interface");
|
||||||
} else {
|
} else {
|
||||||
if (isEnum())
|
if (isEnum())
|
||||||
|
@ -767,11 +767,11 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this {@code Class} object represents an annotation
|
* Returns true if this {@code Class} object represents an annotation
|
||||||
* type. Note that if this method returns true, {@link #isInterface()}
|
* interface. Note that if this method returns true, {@link #isInterface()}
|
||||||
* would also return true, as all annotation types are also interfaces.
|
* would also return true, as all annotation interfaces are also interfaces.
|
||||||
*
|
*
|
||||||
* @return {@code true} if this {@code Class} object represents an annotation
|
* @return {@code true} if this {@code Class} object represents an annotation
|
||||||
* type; {@code false} otherwise
|
* interface; {@code false} otherwise
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public boolean isAnnotation() {
|
public boolean isAnnotation() {
|
||||||
|
@ -1298,8 +1298,8 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
* {@code null} otherwise.
|
* {@code null} otherwise.
|
||||||
*
|
*
|
||||||
* In particular, this method returns {@code null} if the underlying
|
* In particular, this method returns {@code null} if the underlying
|
||||||
* class is a local or anonymous class immediately enclosed by a type
|
* class is a local or anonymous class immediately enclosed by a class or
|
||||||
* declaration, instance initializer or static initializer.
|
* interface declaration, instance initializer or static initializer.
|
||||||
*
|
*
|
||||||
* @return the immediately enclosing method of the underlying class, if
|
* @return the immediately enclosing method of the underlying class, if
|
||||||
* that class is a local or anonymous class; otherwise {@code null}.
|
* that class is a local or anonymous class; otherwise {@code null}.
|
||||||
|
@ -1456,8 +1456,8 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
* the immediately enclosing constructor of the underlying
|
* the immediately enclosing constructor of the underlying
|
||||||
* class. Returns {@code null} otherwise. In particular, this
|
* class. Returns {@code null} otherwise. In particular, this
|
||||||
* method returns {@code null} if the underlying class is a local
|
* method returns {@code null} if the underlying class is a local
|
||||||
* or anonymous class immediately enclosed by a type declaration,
|
* or anonymous class immediately enclosed by a class or
|
||||||
* instance initializer or static initializer.
|
* interface declaration, instance initializer or static initializer.
|
||||||
*
|
*
|
||||||
* @return the immediately enclosing constructor of the underlying class, if
|
* @return the immediately enclosing constructor of the underlying class, if
|
||||||
* that class is a local or anonymous class; otherwise {@code null}.
|
* that class is a local or anonymous class; otherwise {@code null}.
|
||||||
|
@ -1650,9 +1650,9 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an informative string for the name of this type.
|
* Return an informative string for the name of this class or interface.
|
||||||
*
|
*
|
||||||
* @return an informative string for the name of this type
|
* @return an informative string for the name of this class or interface
|
||||||
* @since 1.8
|
* @since 1.8
|
||||||
*/
|
*/
|
||||||
public String getTypeName() {
|
public String getTypeName() {
|
||||||
|
@ -2371,7 +2371,7 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
*
|
*
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @jls 8.10 Record Types
|
* @jls 8.10 Record Classes
|
||||||
* @since 16
|
* @since 16
|
||||||
*/
|
*/
|
||||||
@CallerSensitive
|
@CallerSensitive
|
||||||
|
@ -2392,14 +2392,14 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
* Class} object, including public, protected, default (package)
|
* Class} object, including public, protected, default (package)
|
||||||
* access, and private methods, but excluding inherited methods.
|
* access, and private methods, but excluding inherited methods.
|
||||||
*
|
*
|
||||||
* <p> If this {@code Class} object represents a type that has multiple
|
* <p> If this {@code Class} object represents a class or interface that
|
||||||
* declared methods with the same name and parameter types, but different
|
* has multiple declared methods with the same name and parameter types,
|
||||||
* return types, then the returned array has a {@code Method} object for
|
* but different return types, then the returned array has a {@code Method}
|
||||||
* each such method.
|
* object for each such method.
|
||||||
*
|
*
|
||||||
* <p> If this {@code Class} object represents a type that has a class
|
* <p> If this {@code Class} object represents a class or interface that
|
||||||
* initialization method {@code <clinit>}, then the returned array does
|
* has a class initialization method {@code <clinit>}, then the returned
|
||||||
* <em>not</em> have a corresponding {@code Method} object.
|
* array does <em>not</em> have a corresponding {@code Method} object.
|
||||||
*
|
*
|
||||||
* <p> If this {@code Class} object represents a class or interface with no
|
* <p> If this {@code Class} object represents a class or interface with no
|
||||||
* declared methods, then the returned array has length 0.
|
* declared methods, then the returned array has length 0.
|
||||||
|
@ -3671,13 +3671,13 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
* Returns true if and only if this class was declared as an enum in the
|
* Returns true if and only if this class was declared as an enum in the
|
||||||
* source code.
|
* source code.
|
||||||
*
|
*
|
||||||
* Note that {@link java.lang.Enum} is not itself an enum type.
|
* Note that {@link java.lang.Enum} is not itself an enum class.
|
||||||
*
|
*
|
||||||
* Also note that if an enum constant is declared with a class body,
|
* Also note that if an enum constant is declared with a class body,
|
||||||
* the class of that enum constant object is an anonymous class
|
* the class of that enum constant object is an anonymous class
|
||||||
* and <em>not</em> the class of the declaring enum type. The
|
* and <em>not</em> the class of the declaring enum class. The
|
||||||
* {@link Enum#getDeclaringClass} method of an enum constant can
|
* {@link Enum#getDeclaringClass} method of an enum constant can
|
||||||
* be used to get the class of the enum type declaring the
|
* be used to get the class of the enum class declaring the
|
||||||
* constant.
|
* constant.
|
||||||
*
|
*
|
||||||
* @return true if and only if this class was declared as an enum in the
|
* @return true if and only if this class was declared as an enum in the
|
||||||
|
@ -3702,11 +3702,11 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
* components; {@link #getRecordComponents()} returns a non-null but
|
* components; {@link #getRecordComponents()} returns a non-null but
|
||||||
* possibly empty value for a record.
|
* possibly empty value for a record.
|
||||||
*
|
*
|
||||||
* <p> Note that class {@link Record} is not a record type and thus invoking
|
* <p> Note that class {@link Record} is not a record class and thus
|
||||||
* this method on class {@code Record} returns {@code false}.
|
* invoking this method on class {@code Record} returns {@code false}.
|
||||||
*
|
*
|
||||||
* @return true if and only if this class is a record class, otherwise false
|
* @return true if and only if this class is a record class, otherwise false
|
||||||
* @jls 8.10 Record Types
|
* @jls 8.10 Record Classes
|
||||||
* @since 16
|
* @since 16
|
||||||
*/
|
*/
|
||||||
public boolean isRecord() {
|
public boolean isRecord() {
|
||||||
|
@ -3730,12 +3730,12 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the elements of this enum class or null if this
|
* Returns the elements of this enum class or null if this
|
||||||
* Class object does not represent an enum type.
|
* Class object does not represent an enum class.
|
||||||
*
|
*
|
||||||
* @return an array containing the values comprising the enum class
|
* @return an array containing the values comprising the enum class
|
||||||
* represented by this {@code Class} object in the order they're
|
* represented by this {@code Class} object in the order they're
|
||||||
* declared, or null if this {@code Class} object does not
|
* declared, or null if this {@code Class} object does not
|
||||||
* represent an enum type
|
* represent an enum class
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public T[] getEnumConstants() {
|
public T[] getEnumConstants() {
|
||||||
|
@ -3745,7 +3745,7 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the elements of this enum class or null if this
|
* Returns the elements of this enum class or null if this
|
||||||
* Class object does not represent an enum type;
|
* Class object does not represent an enum class;
|
||||||
* identical to getEnumConstants except that the result is
|
* identical to getEnumConstants except that the result is
|
||||||
* uncloned, cached, and shared by all callers.
|
* uncloned, cached, and shared by all callers.
|
||||||
*/
|
*/
|
||||||
|
@ -3788,7 +3788,7 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
T[] universe = getEnumConstantsShared();
|
T[] universe = getEnumConstantsShared();
|
||||||
if (universe == null)
|
if (universe == null)
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
getName() + " is not an enum type");
|
getName() + " is not an enum class");
|
||||||
directory = new HashMap<>((int)(universe.length / 0.75f) + 1);
|
directory = new HashMap<>((int)(universe.length / 0.75f) + 1);
|
||||||
for (T constant : universe) {
|
for (T constant : universe) {
|
||||||
directory.put(((Enum<?>)constant).name(), constant);
|
directory.put(((Enum<?>)constant).name(), constant);
|
||||||
|
@ -4024,7 +4024,7 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
return new AnnotationData(annotations, declaredAnnotations, classRedefinedCount);
|
return new AnnotationData(annotations, declaredAnnotations, classRedefinedCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Annotation types cache their internal (AnnotationType) form
|
// Annotation interfaces cache their internal (AnnotationType) form
|
||||||
|
|
||||||
@SuppressWarnings("UnusedDeclaration")
|
@SuppressWarnings("UnusedDeclaration")
|
||||||
private transient volatile AnnotationType annotationType;
|
private transient volatile AnnotationType annotationType;
|
||||||
|
@ -4050,10 +4050,10 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
* Returns an {@code AnnotatedType} object that represents the use of a
|
* Returns an {@code AnnotatedType} object that represents the use of a
|
||||||
* type to specify the superclass of the entity represented by this {@code
|
* type to specify the superclass of the entity represented by this {@code
|
||||||
* Class} object. (The <em>use</em> of type Foo to specify the superclass
|
* Class} object. (The <em>use</em> of type Foo to specify the superclass
|
||||||
* in '... extends Foo' is distinct from the <em>declaration</em> of type
|
* in '... extends Foo' is distinct from the <em>declaration</em> of class
|
||||||
* Foo.)
|
* Foo.)
|
||||||
*
|
*
|
||||||
* <p> If this {@code Class} object represents a type whose declaration
|
* <p> If this {@code Class} object represents a class whose declaration
|
||||||
* does not explicitly indicate an annotated superclass, then the return
|
* does not explicitly indicate an annotated superclass, then the return
|
||||||
* value is an {@code AnnotatedType} object representing an element with no
|
* value is an {@code AnnotatedType} object representing an element with no
|
||||||
* annotations.
|
* annotations.
|
||||||
|
@ -4082,7 +4082,7 @@ public final class Class<T> implements java.io.Serializable,
|
||||||
* of types to specify superinterfaces of the entity represented by this
|
* of types to specify superinterfaces of the entity represented by this
|
||||||
* {@code Class} object. (The <em>use</em> of type Foo to specify a
|
* {@code Class} object. (The <em>use</em> of type Foo to specify a
|
||||||
* superinterface in '... implements Foo' is distinct from the
|
* superinterface in '... implements Foo' is distinct from the
|
||||||
* <em>declaration</em> of type Foo.)
|
* <em>declaration</em> of interface Foo.)
|
||||||
*
|
*
|
||||||
* <p> If this {@code Class} object represents a class, the return value is
|
* <p> If this {@code Class} object represents a class, the return value is
|
||||||
* an array containing objects representing the uses of interface types to
|
* an array containing objects representing the uses of interface types to
|
||||||
|
|
|
@ -46,8 +46,8 @@ public interface AnnotatedArrayType extends AnnotatedType {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the potentially annotated type that this type is a member of, if
|
* 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
|
* this type represents a nested class or interface. For example, if this
|
||||||
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
|
* 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
|
* <p>Returns {@code null} for an {@code AnnotatedType} that is an instance
|
||||||
* of {@code AnnotatedArrayType}.
|
* of {@code AnnotatedArrayType}.
|
||||||
|
|
|
@ -248,7 +248,7 @@ import sun.reflect.annotation.AnnotationType;
|
||||||
*
|
*
|
||||||
* <p>Similarly, attempting to read an enum-valued member will result in
|
* <p>Similarly, attempting to read an enum-valued member will result in
|
||||||
* a {@link EnumConstantNotPresentException} if the enum constant in the
|
* 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
|
* <p>If an annotation type <i>T</i> is (meta-)annotated with an
|
||||||
* {@code @Repeatable} annotation whose value element indicates a type
|
* {@code @Repeatable} annotation whose value element indicates a type
|
||||||
|
|
|
@ -49,13 +49,13 @@ public interface AnnotatedParameterizedType extends AnnotatedType {
|
||||||
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
|
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
|
||||||
*
|
*
|
||||||
* <p>Returns {@code null} if this {@code AnnotatedType} represents a
|
* <p>Returns {@code null} if this {@code AnnotatedType} represents a
|
||||||
* top-level type, or a local or anonymous class, or a primitive type, or
|
* top-level class or interface, or a local or anonymous class, or
|
||||||
* void.
|
* a primitive type, or void.
|
||||||
*
|
*
|
||||||
* @return an {@code AnnotatedType} object representing the potentially
|
* @return an {@code AnnotatedType} object representing the potentially
|
||||||
* annotated type that this type is a member of, or {@code null}
|
* annotated type that this type is a member of, or {@code null}
|
||||||
* @throws TypeNotPresentException if the owner type
|
* @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
|
* @throws MalformedParameterizedTypeException if the owner type
|
||||||
* refers to a parameterized type that cannot be instantiated
|
* refers to a parameterized type that cannot be instantiated
|
||||||
* for any reason
|
* for any reason
|
||||||
|
|
|
@ -55,8 +55,8 @@ public interface AnnotatedType extends AnnotatedElement {
|
||||||
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
|
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
|
||||||
*
|
*
|
||||||
* <p>Returns {@code null} if this {@code AnnotatedType} represents a
|
* <p>Returns {@code null} if this {@code AnnotatedType} represents a
|
||||||
* top-level type, or a local or anonymous class, or a primitive type, or
|
* top-level class or interface, or a local or anonymous class, or
|
||||||
* void.
|
* a primitive type, or void.
|
||||||
*
|
*
|
||||||
* <p>Returns {@code null} if this {@code AnnotatedType} is an instance of
|
* <p>Returns {@code null} if this {@code AnnotatedType} is an instance of
|
||||||
* {@code AnnotatedArrayType}, {@code AnnotatedTypeVariable}, or
|
* {@code AnnotatedArrayType}, {@code AnnotatedTypeVariable}, or
|
||||||
|
@ -69,7 +69,7 @@ public interface AnnotatedType extends AnnotatedElement {
|
||||||
* @return an {@code AnnotatedType} object representing the potentially
|
* @return an {@code AnnotatedType} object representing the potentially
|
||||||
* annotated type that this type is a member of, or {@code null}
|
* annotated type that this type is a member of, or {@code null}
|
||||||
* @throws TypeNotPresentException if the owner type
|
* @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
|
* @throws MalformedParameterizedTypeException if the owner type
|
||||||
* refers to a parameterized type that cannot be instantiated
|
* refers to a parameterized type that cannot be instantiated
|
||||||
* for any reason
|
* for any reason
|
||||||
|
|
|
@ -462,7 +462,7 @@ public final class Constructor<T> extends Executable {
|
||||||
* after possible unwrapping, a parameter value
|
* after possible unwrapping, a parameter value
|
||||||
* cannot be converted to the corresponding formal
|
* cannot be converted to the corresponding formal
|
||||||
* parameter type by a method invocation conversion; if
|
* 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
|
* @throws InstantiationException if the class that declares the
|
||||||
* underlying constructor represents an abstract class.
|
* underlying constructor represents an abstract class.
|
||||||
* @throws InvocationTargetException if the underlying constructor
|
* @throws InvocationTargetException if the underlying constructor
|
||||||
|
|
|
@ -206,10 +206,10 @@ class Field extends AccessibleObject implements Member {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns {@code true} if this field represents an element of
|
* 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
|
* @return {@code true} if and only if this field represents an element of
|
||||||
* an enumerated type.
|
* an enumerated class.
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public boolean isEnumConstant() {
|
public boolean isEnumConstant() {
|
||||||
|
@ -258,7 +258,7 @@ class Field extends AccessibleObject implements Member {
|
||||||
* <cite>The Java Virtual Machine Specification</cite>
|
* <cite>The Java Virtual Machine Specification</cite>
|
||||||
* @throws TypeNotPresentException if the generic type
|
* @throws TypeNotPresentException if the generic type
|
||||||
* signature of the underlying field refers to a non-existent
|
* signature of the underlying field refers to a non-existent
|
||||||
* type declaration
|
* class or interface declaration
|
||||||
* @throws MalformedParameterizedTypeException if the generic
|
* @throws MalformedParameterizedTypeException if the generic
|
||||||
* signature of the underlying field refers to a parameterized type
|
* signature of the underlying field refers to a parameterized type
|
||||||
* that cannot be instantiated for any reason
|
* that cannot be instantiated for any reason
|
||||||
|
|
|
@ -44,8 +44,8 @@ public interface GenericArrayType extends Type {
|
||||||
*
|
*
|
||||||
* @return a {@code Type} object representing the component type
|
* @return a {@code Type} object representing the component type
|
||||||
* of this array
|
* of this array
|
||||||
* @throws TypeNotPresentException if the underlying array type's
|
* @throws TypeNotPresentException if the underlying array type's component
|
||||||
* component type refers to a non-existent type declaration
|
* type refers to a non-existent class or interface declaration
|
||||||
* @throws MalformedParameterizedTypeException if the
|
* @throws MalformedParameterizedTypeException if the
|
||||||
* underlying array type's component type refers to a
|
* underlying array type's component type refers to a
|
||||||
* parameterized type that cannot be instantiated for any reason
|
* parameterized type that cannot be instantiated for any reason
|
||||||
|
|
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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
|
* Thrown when a syntactically malformed signature attribute is
|
||||||
* encountered by a reflective method that needs to interpret the
|
* encountered by a reflective method that needs to interpret the generic
|
||||||
* generic signature information for a type, method or constructor.
|
* signature information for a class or interface, method or constructor.
|
||||||
*
|
*
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -282,9 +282,9 @@ public final class Method extends Executable {
|
||||||
* specified in
|
* specified in
|
||||||
* <cite>The Java Virtual Machine Specification</cite>
|
* <cite>The Java Virtual Machine Specification</cite>
|
||||||
* @throws TypeNotPresentException if the underlying method's
|
* @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
|
* @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
|
* type that cannot be instantiated for any reason
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
|
@ -603,8 +603,7 @@ public final class Method extends Executable {
|
||||||
* method; returns {@code false} otherwise.
|
* method; returns {@code false} otherwise.
|
||||||
*
|
*
|
||||||
* A default method is a public non-abstract instance method, that
|
* A default method is a public non-abstract instance method, that
|
||||||
* is, a non-static method with a body, declared in an interface
|
* is, a non-static method with a body, declared in an interface.
|
||||||
* type.
|
|
||||||
*
|
*
|
||||||
* @return true if and only if this method is a default
|
* @return true if and only if this method is a default
|
||||||
* method as defined by the Java Language Specification.
|
* method as defined by the Java Language Specification.
|
||||||
|
|
|
@ -32,15 +32,15 @@ package java.lang.reflect;
|
||||||
*
|
*
|
||||||
* <p>A parameterized type is created the first time it is needed by a
|
* <p>A parameterized type is created the first time it is needed by a
|
||||||
* reflective method, as specified in this package. When a
|
* reflective method, as specified in this package. When a
|
||||||
* parameterized type p is created, the generic type declaration that
|
* parameterized type p is created, the generic class or interface declaration
|
||||||
* p instantiates is resolved, and all type arguments of p are created
|
* that p instantiates is resolved, and all type arguments of p are created
|
||||||
* recursively. See {@link java.lang.reflect.TypeVariable
|
* recursively. See {@link java.lang.reflect.TypeVariable
|
||||||
* TypeVariable} for details on the creation process for type
|
* TypeVariable} for details on the creation process for type
|
||||||
* variables. Repeated creation of a parameterized type has no effect.
|
* variables. Repeated creation of a parameterized type has no effect.
|
||||||
*
|
*
|
||||||
* <p>Instances of classes that implement this interface must implement
|
* <p>Instances of classes that implement this interface must implement
|
||||||
* an equals() method that equates any two instances that share the
|
* 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
|
* @jls 4.5 Parameterized Types
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
|
@ -56,8 +56,8 @@ public interface ParameterizedType extends Type {
|
||||||
*
|
*
|
||||||
* @return an array of {@code Type} objects representing the actual type
|
* @return an array of {@code Type} objects representing the actual type
|
||||||
* arguments to this type
|
* arguments to this type
|
||||||
* @throws TypeNotPresentException if any of the
|
* @throws TypeNotPresentException if any of the actual type arguments
|
||||||
* actual type arguments refers to a non-existent type declaration
|
* refers to a non-existent class or interface declaration
|
||||||
* @throws MalformedParameterizedTypeException if any of the
|
* @throws MalformedParameterizedTypeException if any of the
|
||||||
* actual type parameters refer to a parameterized type that cannot
|
* actual type parameters refer to a parameterized type that cannot
|
||||||
* be instantiated for any reason
|
* 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,
|
* this type is a member of. If this type is a top-level type,
|
||||||
* {@code null} is returned
|
* {@code null} is returned
|
||||||
* @throws TypeNotPresentException if the owner type
|
* @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
|
* @throws MalformedParameterizedTypeException if the owner type
|
||||||
* refers to a parameterized type that cannot be instantiated
|
* refers to a parameterized type that cannot be instantiated
|
||||||
* for any reason
|
* for any reason
|
||||||
|
|
|
@ -240,10 +240,11 @@ import static java.lang.module.ModuleDescriptor.Modifier.SYNTHETIC;
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* A dynamic module can read the modules of all of the superinterfaces of a proxy
|
* 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
|
* class and the modules of the classes and interfaces referenced by
|
||||||
* of a proxy class. If a superinterface or a referenced type, say {@code T},
|
* all public method signatures of a proxy class. If a superinterface or
|
||||||
* is in a non-exported package, the {@linkplain Module module} of {@code T} is
|
* a referenced class or interface, say {@code T}, is in a non-exported package,
|
||||||
* updated to export the package of {@code T} to the dynamic module.
|
* 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>
|
* <h3>Methods Duplicated in Multiple Proxy Interfaces</h3>
|
||||||
*
|
*
|
||||||
|
|
|
@ -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
|
* @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) {
|
private static String[] typeNames(List<Class<?>> classes) {
|
||||||
if (classes == null || classes.size() == 0)
|
if (classes == null || classes.size() == 0)
|
||||||
|
|
|
@ -43,7 +43,7 @@ import java.util.Objects;
|
||||||
*
|
*
|
||||||
* @see Class#getRecordComponents()
|
* @see Class#getRecordComponents()
|
||||||
* @see java.lang.Record
|
* @see java.lang.Record
|
||||||
* @jls 8.10 Record Types
|
* @jls 8.10 Record Classes
|
||||||
* @since 16
|
* @since 16
|
||||||
*/
|
*/
|
||||||
public final class RecordComponent implements AnnotatedElement {
|
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.
|
* this record component.
|
||||||
*
|
*
|
||||||
* @return a {@code String} that describes the generic type signature for
|
* @return a {@code String} that describes the generic type signature for
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue