diff --git a/src/java.base/share/classes/java/lang/Record.java b/src/java.base/share/classes/java/lang/Record.java index f57bbb65a2c..6c81f09f282 100644 --- a/src/java.base/share/classes/java/lang/Record.java +++ b/src/java.base/share/classes/java/lang/Record.java @@ -46,20 +46,21 @@ package java.lang; * record components are declared in the record header. The list of record * components declared in the record header form the record descriptor. * - *

A record class has the following mandated members: a public canonical - * constructor, whose descriptor is the same as the record descriptor; + *

A record class has the following mandated members: a canonical + * constructor, which must provide at least as much access as the record + * class and whose descriptor is the same as the record descriptor; * a private final field corresponding to each component, whose name and * type are the same as that of the component; a public accessor method * corresponding to each component, whose name and return type are the same as * that of the component. If not explicitly declared in the body of the record, * implicit implementations for these members are provided. * - *

The implicit declaration of the canonical constructor initializes the - * component fields from the corresponding constructor arguments. The implicit - * declaration of the accessor methods returns the value of the corresponding - * component field. The implicit declaration of the {@link Object#equals(Object)}, - * {@link Object#hashCode()}, and {@link Object#toString()} methods are derived - * from all of the component fields. + *

The implicit declaration of the canonical constructor has the same accessibility + * as the record class and initializes the component fields from the corresponding + * constructor arguments. The implicit declaration of the accessor methods returns + * the value of the corresponding component field. The implicit declaration of the + * {@link Object#equals(Object)}, {@link Object#hashCode()}, and {@link Object#toString()} + * methods are derived from all of the component fields. * *

The primary reasons to provide an explicit declaration for the * canonical constructor or accessor methods are to validate constructor