JShell does not handle records properly

XMLWordPrintable

    • Type: CSR
    • Resolution: Approved
    • Priority: P3
    • 14
    • Component/s: tools
    • None
    • source, behavioral
    • minimal
    • Changes ordering of existing enum constants.
    • Java API
    • JDK

      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:

      <pre> @@ -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 <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 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), </pre>

            Assignee:
            Jan Lahoda
            Reporter:
            Jan Lahoda
            Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: