Summary
jdk.jshell.Snippet.SubKind contains constants for different types of jshell snippets, and differentiated between classes, enums, interfaces and annotations. It should also show records separately.
Problem
The jdk.jshell.Snippet.SubKind enum does not contain an enum constant for records.
Solution
A new constant, RECORD_SUBKIND, is added into jdk.jshell.Snippet.SubKind.
Specification
The exact proposed change is:
@@ -234,10 +234,27 @@ * @jls 8.9 Enum Types */ ENUM_SUBKIND(Kind.TYPE_DECL), /** + * {@preview Associated with records, a preview feature of the Java language. + * + * This enum constant is associated with records, 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 declaration. + * A {@code SubKind} of {@link Kind#TYPE_DECL}. + * @jls 8.10 Record Types + * @since 14 + * + */ + @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS) + RECORD_SUBKIND(Kind.TYPE_DECL), + + /** * An annotation interface declaration. A {@code SubKind} of * {@link Kind#TYPE_DECL}. * @jls 9.6 Annotation Types */ ANNOTATION_TYPE_SUBKIND(Kind.TYPE_DECL),
- csr of
-
JDK-8235474 JShell does not handle records properly
-
- Resolved
-