Skip to content
Permalink
Browse files
8255009: delta apply fixes for JDK-8246774 and JDK-8253455, pushed to…
…o soon

Reviewed-by: jlahoda
  • Loading branch information
Vicente Romero committed Oct 19, 2020
1 parent a0382cd commit 1da28de82f042440e84c4ce6751dd00ff2ee2ed5
Showing with 923 additions and 312 deletions.
  1. +42 −21 src/hotspot/share/classfile/classFileParser.cpp
  2. +21 −2 src/java.base/share/classes/java/lang/Class.java
  3. +11 −1 src/java.base/share/classes/java/lang/Record.java
  4. +11 −1 src/java.base/share/classes/java/lang/annotation/ElementType.java
  5. +10 −1 src/java.base/share/classes/java/lang/reflect/RecordComponent.java
  6. +10 −1 src/java.base/share/classes/java/lang/runtime/ObjectMethods.java
  7. +0 −5 src/java.base/share/classes/jdk/internal/PreviewFeature.java
  8. +9 −1 src/java.base/share/classes/sun/reflect/annotation/TypeAnnotation.java
  9. +20 −2 src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java
  10. +11 −1 src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java
  11. +10 −1 src/java.compiler/share/classes/javax/lang/model/element/RecordComponentElement.java
  12. +11 −1 src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java
  13. +11 −1 src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor14.java
  14. +22 −2 src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java
  15. +11 −1 src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor14.java
  16. +10 −1 src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java
  17. +11 −1 src/java.compiler/share/classes/javax/lang/model/util/ElementScanner14.java
  18. +11 −1 src/java.compiler/share/classes/javax/lang/model/util/Elements.java
  19. +11 −1 src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor14.java
  20. +11 −1 src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java
  21. +1 −0 src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java
  22. +2 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
  23. +2 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
  24. +2 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
  25. +4 −3 src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
  26. +4 −3 test/hotspot/jtreg/runtime/records/RedefineRecord.java
  27. +1 −1 test/hotspot/jtreg/runtime/records/abstractRecord.jcod
  28. +1 −1 test/hotspot/jtreg/runtime/records/badRecordAttribute.jcod
  29. +8 −3 test/hotspot/jtreg/runtime/records/ignoreRecordAttribute.java
  30. +1 −1 test/hotspot/jtreg/runtime/records/notFinalRecord.jcod
  31. +3 −3 test/hotspot/jtreg/runtime/records/recordAttributeTest.java
  32. +256 −0 test/hotspot/jtreg/runtime/records/recordIgnoredVersion.jcod
  33. +2 −2 test/hotspot/jtreg/runtime/records/recordReflectionTest.java
  34. +1 −1 test/hotspot/jtreg/runtime/records/shortRecordAttribute.jcod
  35. +1 −1 test/hotspot/jtreg/runtime/records/superNotJLRecord.jcod
  36. +1 −1 test/hotspot/jtreg/runtime/records/twoRecordAttributes.jcod
  37. +4 −4 test/jdk/java/io/Serializable/records/AbsentStreamValuesTest.java
  38. +9 −5 test/jdk/java/io/Serializable/records/BadCanonicalCtrTest.java
  39. +4 −4 test/jdk/java/io/Serializable/records/BasicRecordSer.java
  40. +4 −4 test/jdk/java/io/Serializable/records/ConstructorAccessTest.java
  41. +2 −2 test/jdk/java/io/Serializable/records/ConstructorPermissionTest.java
  42. +4 −4 test/jdk/java/io/Serializable/records/CycleTest.java
  43. +3 −3 test/jdk/java/io/Serializable/records/DifferentStreamFieldsTest.java
  44. +9 −5 test/jdk/java/io/Serializable/records/ProhibitedMethods.java
  45. +4 −4 test/jdk/java/io/Serializable/records/ReadResolveTest.java
  46. +4 −4 test/jdk/java/io/Serializable/records/RecordClassTest.java
  47. +13 −7 test/jdk/java/io/Serializable/records/SerialPersistentFieldsTest.java
  48. +4 −4 test/jdk/java/io/Serializable/records/SerialVersionUIDTest.java
  49. +3 −3 test/jdk/java/io/Serializable/records/StreamRefTest.java
  50. +4 −4 test/jdk/java/io/Serializable/records/ThrowingConstructorTest.java
  51. +3 −2 test/jdk/java/io/Serializable/records/UnsharedTest.java
  52. +4 −4 test/jdk/java/io/Serializable/records/WriteReplaceTest.java
  53. +5 −1 test/jdk/java/io/Serializable/records/migration/AbstractTest.java
  54. +4 −5 test/jdk/java/io/Serializable/records/migration/AssignableFromTest.java
  55. +4 −4 test/jdk/java/io/Serializable/records/migration/DefaultValuesTest.java
  56. +4 −4 test/jdk/java/io/Serializable/records/migration/SuperStreamFieldsTest.java
  57. +12 −10 test/jdk/java/lang/instrument/RedefineRecordAttr/TestRecordAttr.java
  58. +8 −6 test/jdk/java/lang/instrument/RedefineRecordAttrGenericSig/TestRecordAttrGenericSig.java
  59. +4 −4 test/jdk/java/lang/runtime/ObjectMethodsTest.java
  60. +3 −1 test/langtools/jdk/javadoc/doclet/testRecordLinks/TestRecordLinks.java
  61. +16 −2 test/langtools/jdk/javadoc/doclet/testRecordTypes/TestRecordTypes.java
  62. +2 −2 test/langtools/jdk/javadoc/tool/api/basic/GetTask_DiagListenerTest.java
  63. +7 −1 test/langtools/jdk/jshell/CompletenessTest.java
  64. +7 −1 test/langtools/jdk/jshell/RecordsTest.java
  65. +3 −3 test/langtools/jdk/jshell/ToolSimpleTest.java
  66. +2 −1 test/langtools/tools/javac/IllegalAnnotation.java
  67. +1 −1 test/langtools/tools/javac/IllegalAnnotation.out
  68. +3 −3 test/langtools/tools/javac/LocalInterface.java
  69. +0 −2 test/langtools/tools/javac/LocalInterface.out
  70. +2 −2 test/langtools/tools/javac/LocalRecord.java
  71. +3 −2 test/langtools/tools/javac/annotations/ApplicableAnnotationsOnRecords.java
  72. +51 −48 test/langtools/tools/javac/annotations/repeatingAnnotations/combo/TargetAnnoCombo.java
  73. +3 −2 test/langtools/tools/javac/annotations/typeAnnotations/TypeAnnotationsPositionsOnRecords.java
  74. +3 −3 test/langtools/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.out
  75. +1 −1 test/langtools/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.out
  76. +1 −1 test/langtools/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage2.out
  77. +8 −3 test/langtools/tools/javac/api/TestGetScopeResult.java
  78. +4 −1 test/langtools/tools/javac/diags/examples/AccessorCantBeGeneric.java
  79. +4 −1 test/langtools/tools/javac/diags/examples/AccessorCantThrowException.java
  80. +3 −0 test/langtools/tools/javac/diags/examples/AccessorMethodCantBeStatic.java
  81. +3 −0 test/langtools/tools/javac/diags/examples/AccessorReturnTypeDoesntMatch.java
  82. +3 −0 test/langtools/tools/javac/diags/examples/CanonicalCantHaveStrongerAccessPrivileges.java
  83. +3 −0 test/langtools/tools/javac/diags/examples/CanonicalCantInvokeOtherConstructor.java
  84. +3 −0 test/langtools/tools/javac/diags/examples/CanonicalConstructorArgumentMismatch.java
  85. +3 −0 test/langtools/tools/javac/diags/examples/CanonicalConstructorCantHaveReturn.java
  86. +3 −0 test/langtools/tools/javac/diags/examples/CanonicalConstructorCantHaveThrowsClause.java
  87. +3 −0 test/langtools/tools/javac/diags/examples/CanonicalMustNotDeclareTypeVariables.java
  88. +3 −0 test/langtools/tools/javac/diags/examples/ConstructorWithSameErasureAsCanonical.java
  89. +0 −2 test/langtools/tools/javac/diags/examples/Expected3.java
  90. +3 −0 test/langtools/tools/javac/diags/examples/FirstInvocationMustBeAnotherConstructor.java
  91. +3 −0 test/langtools/tools/javac/diags/examples/IllegalRecordComponentName.java
  92. +3 −0 test/langtools/tools/javac/diags/examples/IncorrectRecordDeclaration.java
  93. +3 −0 test/langtools/tools/javac/diags/examples/InstanceInitializersNotAllowedInRecords.java
  94. +0 −2 test/langtools/tools/javac/diags/examples/InterfaceNotAllowed.java
  95. +1 −0 test/langtools/tools/javac/diags/examples/InvalidSuperTypeRecord.java
  96. +4 −0 test/langtools/tools/javac/diags/examples/KindnameRecord.java
  97. +0 −2 test/langtools/tools/javac/diags/examples/LocalEnum.java
  98. +3 −0 test/langtools/tools/javac/diags/examples/MethodMustBePublic.java
  99. +2 −3 test/langtools/tools/javac/diags/examples/Records.java
  100. +3 −0 test/langtools/tools/javac/diags/examples/RecordsCanNotDeclareInstanceFields.java
  101. +3 −0 test/langtools/tools/javac/diags/examples/RecordsCantDeclareComponentModifiers.java
  102. +3 −0 test/langtools/tools/javac/diags/examples/RecordsComponentsCanNotDeclareCStyleArrays.java
  103. +3 −0 test/langtools/tools/javac/diags/examples/RecordsNotAllowedInInnerClasses.java
  104. +1 −0 test/langtools/tools/javac/enum/FauxEnum3.java
  105. +2 −2 test/langtools/tools/javac/enum/FauxEnum3.out
  106. +3 −3 test/langtools/tools/javac/enum/LocalEnum.java
  107. +0 −2 test/langtools/tools/javac/enum/LocalEnum.out
  108. +3 −3 test/langtools/tools/javac/launcher/SourceLauncherTest.java
  109. +2 −2 test/langtools/tools/javac/parser/JavacParserTest.java
  110. +1 −1 test/langtools/tools/javac/parser/SingleCommaAnnotationValueFail.out
  111. +9 −5 test/langtools/tools/javac/processing/model/element/JavaxLangModelForRecords.java
  112. +3 −2 test/langtools/tools/javac/records/ElementFilterRecordComponentTest.java
  113. +4 −2 test/langtools/tools/javac/records/LocalStaticDeclarations.java
  114. +2 −2 test/langtools/tools/javac/records/MapAccessorToComponent.java
  115. +19 −9 test/langtools/tools/javac/records/RecordCompilationTests.java
  116. +4 −3 test/langtools/tools/javac/records/RecordMemberTests.java
  117. +4 −3 test/langtools/tools/javac/records/VarargsRecordsTest.java
  118. +2 −2 test/langtools/tools/javac/records/mandated_members/CheckRecordMembers.java
  119. +2 −3 test/langtools/tools/javac/records/writeread/WriteReadTest.java
  120. +0 −9 test/langtools/tools/javac/tree/TreePosTest.java
  121. +4 −2 test/langtools/tools/sjavac/PubApisTest.java
@@ -3567,6 +3567,12 @@ bool ClassFileParser::supports_sealed_types() {
Arguments::enable_preview();
}

bool ClassFileParser::supports_records() {
return _major_version == JVM_CLASSFILE_MAJOR_VERSION &&
_minor_version == JAVA_PREVIEW_MINOR_VERSION &&
Arguments::enable_preview();
}

void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cfs,
ConstantPool* cp,
ClassFileParser::ClassAnnotationCollector* parsed_annotations,
@@ -3814,28 +3820,12 @@ void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cf
"Nest-host class_info_index %u has bad constant type in class file %s",
class_info_index, CHECK);
_nest_host = class_info_index;

} else if (_major_version >= JAVA_15_VERSION) {
// Check for PermittedSubclasses tag
if (tag == vmSymbols::tag_permitted_subclasses()) {
if (supports_sealed_types()) {
if (parsed_permitted_subclasses_attribute) {
classfile_parse_error("Multiple PermittedSubclasses attributes in class file %s", CHECK);
}
// Classes marked ACC_FINAL cannot have a PermittedSubclasses attribute.
if (_access_flags.is_final()) {
classfile_parse_error("PermittedSubclasses attribute in final class file %s", CHECK);
}
parsed_permitted_subclasses_attribute = true;
permitted_subclasses_attribute_start = cfs->current();
permitted_subclasses_attribute_length = attribute_length;
}
cfs->skip_u1(attribute_length, CHECK);

} else if (_major_version >= JAVA_16_VERSION) {
} else if (_major_version >= JAVA_14_VERSION) {
if (tag == vmSymbols::tag_record()) {
// Skip over Record attribute if super class is not java.lang.Record.
if (cp->klass_name_at(_super_class_index) == vmSymbols::java_lang_Record()) {
// Skip over Record attribute if not supported or if super class is
// not java.lang.Record.
if (supports_records() &&
cp->klass_name_at(_super_class_index) == vmSymbols::java_lang_Record()) {
if (parsed_record_attribute) {
classfile_parse_error("Multiple Record attributes in class file %s", THREAD);
return;
@@ -3849,13 +3839,44 @@ void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cf
record_attribute_start = cfs->current();
record_attribute_length = attribute_length;
} else if (log_is_enabled(Info, class, record)) {
// Log why the Record attribute was ignored. Note that if the
// class file version is JVM_CLASSFILE_MAJOR_VERSION.65535 and
// --enable-preview wasn't specified then a java.lang.UnsupportedClassVersionError
// exception would have been thrown.
ResourceMark rm(THREAD);
if (supports_records()) {
log_info(class, record)(
"Ignoring Record attribute in class %s because super type is not java.lang.Record",
_class_name->as_C_string());
} else {
log_info(class, record)(
"Ignoring Record attribute in class %s because class file version is not %d.65535",
_class_name->as_C_string(), JVM_CLASSFILE_MAJOR_VERSION);
}
}
cfs->skip_u1(attribute_length, CHECK);
} else if (_major_version >= JAVA_15_VERSION) {
// Check for PermittedSubclasses tag
if (tag == vmSymbols::tag_permitted_subclasses()) {
if (supports_sealed_types()) {
if (parsed_permitted_subclasses_attribute) {
classfile_parse_error("Multiple PermittedSubclasses attributes in class file %s", THREAD);
return;
}
// Classes marked ACC_FINAL cannot have a PermittedSubclasses attribute.
if (_access_flags.is_final()) {
classfile_parse_error("PermittedSubclasses attribute in final class file %s", THREAD);
return;
}
parsed_permitted_subclasses_attribute = true;
permitted_subclasses_attribute_start = cfs->current();
permitted_subclasses_attribute_length = attribute_length;
}
cfs->skip_u1(attribute_length, CHECK);
} else {
// Unknown attribute
cfs->skip_u1(attribute_length, CHECK);
}
} else {
// Unknown attribute
cfs->skip_u1(attribute_length, CHECK);
@@ -2342,6 +2342,13 @@ public Method getMethod(String name, Class<?>... parameterTypes)
}

/**
* {@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.
@@ -2378,8 +2385,11 @@ public Method getMethod(String name, Class<?>... parameterTypes)
* </ul>
*
* @jls 8.10 Record Types
* @since 16
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=false)
@SuppressWarnings("preview")
@CallerSensitive
public RecordComponent[] getRecordComponents() {
SecurityManager sm = System.getSecurityManager();
@@ -3678,6 +3688,13 @@ public boolean isEnum() {
}

/**
* {@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
@@ -3690,8 +3707,10 @@ public boolean isEnum() {
*
* @return true if and only if this class is a record class, otherwise false
* @jls 8.10 Record Types
* @since 16
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=false)
public boolean isRecord() {
return getSuperclass() == JAVA_LANG_RECORD_CLASS && isRecord0();
}
@@ -25,6 +25,14 @@
package java.lang;

/**
* {@preview Associated with records, a preview feature of the Java language.
*
* This class is associated with <i>records</i>, a preview
* feature of the Java language. Programs can only use this
* class when preview features are enabled. Preview features
* may be removed in a future release, or upgraded to permanent
* features of the Java language.}
*
* This is the common base class of all Java language record classes.
*
* <p>More information about records, including descriptions of the
@@ -78,8 +86,10 @@
* <a href="{@docRoot}/java.base/java/io/ObjectInputStream.html#record-serialization">record serialization</a>.
*
* @jls 8.10 Record Types
* @since 16
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=true)
public abstract class Record {
/**
* Constructor for record classes to call.
@@ -118,12 +118,22 @@
MODULE,

/**
* {@preview Associated with records, a preview feature of the Java language.
*
* This constant is associated with <i>records</i>, a preview
* feature of the Java language. Programs can only use this
* constant when preview features are enabled. Preview features
* may be removed in a future release, or upgraded to permanent
* features of the Java language.}
*
* Record component
*
* @jls 8.10.3 Record Members
* @jls 9.7.4 Where Annotations May Appear
*
* @since 16
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=true)
RECORD_COMPONENT;
}
@@ -38,14 +38,23 @@
import java.util.Objects;

/**
* {@preview Associated with records, a preview feature of the Java language.
*
* This class 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.}
*
* A {@code RecordComponent} provides information about, and dynamic access to, a
* component of a record class.
*
* @see Class#getRecordComponents()
* @see java.lang.Record
* @jls 8.10 Record Types
* @since 16
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=false)
public final class RecordComponent implements AnnotatedElement {
// declaring class
private Class<?> clazz;
@@ -38,14 +38,23 @@
import java.util.Objects;

/**
* {@preview Associated with records, a preview feature of the Java language.
*
* This class 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.}
*
* Bootstrap methods for state-driven implementations of core methods,
* including {@link Object#equals(Object)}, {@link Object#hashCode()}, and
* {@link Object#toString()}. These methods may be used, for example, by
* Java compiler implementations to implement the bodies of {@link Object}
* methods for record classes.
*
* @since 16
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=false)
public class ObjectMethods {

private ObjectMethods() { }
@@ -62,11 +62,6 @@
// JDK 15. Since the JDK 14 codebase uses the enum constant, it is
// necessary for PreviewFeature in JDK 15 to declare the enum constant.
TEXT_BLOCKS,
// The RECORDS enum constant is not used in the JDK 16 codebase, but
// exists to support the bootcycle build of JDK 16. The bootcycle build
// of JDK 16 is performed with JDK 15 and the PreviewFeature type from
// JDK 16. Since the JDK 15 codebase uses the enum constant, it is
// necessary for PreviewFeature in JDK 16 to declare the enum constant.
RECORDS,
SEALED_CLASSES,
;
@@ -92,8 +92,16 @@ public LocationInfo getLocationInfo() {
METHOD_FORMAL_PARAMETER,
THROWS,
/**
* @since 16
* {@preview Associated with records, a preview feature of the Java language.
*
* This enum constant 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.}
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=false)
RECORD_COMPONENT;
}

@@ -110,15 +110,33 @@
MODULE,

/**
* {@preview Associated with records, a preview feature of the Java language.
*
* This enum constant 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.}
*
* A record type.
* @since 16
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=false)
RECORD,

/**
* {@preview Associated with records, a preview feature of the Java language.
*
* This enum constant 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.}
*
* A record component of a {@code record}.
* @since 16
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=false)
RECORD_COMPONENT,

/**
@@ -212,6 +212,13 @@ default R visitModule(ModuleElement e, P p) {
}

/**
* {@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.}
*
* Visits a record component element.
*
* @implSpec The default implementation visits a {@code
@@ -220,8 +227,11 @@ default R visitModule(ModuleElement e, P p) {
* @param e the element to visit
* @param p a visitor-specified parameter
* @return a visitor-specified result
* @since 16
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=false)
@SuppressWarnings("preview")
default R visitRecordComponent(RecordComponentElement e, P p) {
return visitUnknown(e, p);
}
@@ -26,10 +26,19 @@
package javax.lang.model.element;

/**
* {@preview Associated with records, a preview feature of the Java language.
*
* This class 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.}
*
* Represents a record component.
*
* @since 16
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=false)
public interface RecordComponentElement extends Element {
/**
* Returns the enclosing element of this record component.
@@ -180,6 +180,13 @@
List<? extends TypeParameterElement> getTypeParameters();

/**
* {@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 the record components of this type element in
* declaration order.
*
@@ -189,8 +196,11 @@
* @return the record components, or an empty list if there are
* none
*
* @since 16
* @since 14
*/
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
essentialAPI=false)
@SuppressWarnings("preview")
default List<? extends RecordComponentElement> getRecordComponents() {
return List.of();
}

1 comment on commit 1da28de

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot commented on 1da28de Oct 19, 2020

Please sign in to comment.