mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8246774: implement Record Classes as a standard feature in Java
Co-authored-by: Vicente Romero <vromero@openjdk.org> Co-authored-by: Harold Seigel <hseigel@openjdk.org> Co-authored-by: Chris Hegarty <chegar@openjdk.org> Reviewed-by: coleenp, jlahoda, sspitsyn, chegar
This commit is contained in:
parent
0b3e6c51ba
commit
c17d58516f
109 changed files with 294 additions and 784 deletions
|
@ -2342,13 +2342,6 @@ public final class Class<T> implements java.io.Serializable,
|
|||
}
|
||||
|
||||
/**
|
||||
* {@preview Associated with records, a preview feature of the Java language.
|
||||
*
|
||||
* This method is associated with <i>records</i>, a preview
|
||||
* feature of the Java language. Preview features
|
||||
* may be removed in a future release, or upgraded to permanent
|
||||
* features of the Java language.}
|
||||
*
|
||||
* Returns an array of {@code RecordComponent} objects representing all the
|
||||
* record components of this record class, or {@code null} if this class is
|
||||
* not a record class.
|
||||
|
@ -2385,11 +2378,8 @@ public final class Class<T> implements java.io.Serializable,
|
|||
* </ul>
|
||||
*
|
||||
* @jls 8.10 Record Types
|
||||
* @since 14
|
||||
* @since 16
|
||||
*/
|
||||
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
|
||||
essentialAPI=false)
|
||||
@SuppressWarnings("preview")
|
||||
@CallerSensitive
|
||||
public RecordComponent[] getRecordComponents() {
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
|
@ -3688,13 +3678,6 @@ public final class Class<T> implements java.io.Serializable,
|
|||
}
|
||||
|
||||
/**
|
||||
* {@preview Associated with records, a preview feature of the Java language.
|
||||
*
|
||||
* This method is associated with <i>records</i>, a preview
|
||||
* feature of the Java language. Preview features
|
||||
* may be removed in a future release, or upgraded to permanent
|
||||
* features of the Java language.}
|
||||
*
|
||||
* Returns {@code true} if and only if this class is a record class.
|
||||
*
|
||||
* <p> The {@linkplain #getSuperclass() direct superclass} of a record
|
||||
|
@ -3707,10 +3690,8 @@ public final class Class<T> implements java.io.Serializable,
|
|||
*
|
||||
* @return true if and only if this class is a record class, otherwise false
|
||||
* @jls 8.10 Record Types
|
||||
* @since 14
|
||||
* @since 16
|
||||
*/
|
||||
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
|
||||
essentialAPI=false)
|
||||
public boolean isRecord() {
|
||||
return getSuperclass() == JAVA_LANG_RECORD_CLASS && isRecord0();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue