Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8235428

Class.toGenericString need to be updated for records

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Update Class.toGenericString to account for records.

      Problem

      A record type has a printed representation using class rather than record.

      Solution

      Update the specification and implementation. Note that in the interests of behavioral compatibility, Class.toString is not being updated.

      Specification

      --- a/src/java.base/share/classes/java/lang/Class.java  Wed Dec 04 14:55:15 2019 -0800
      +++ b/src/java.base/share/classes/java/lang/Class.java  Thu Dec 05 10:01:26 2019 -0800
      @@ -207,8 +207,8 @@
            *
            * The string is formatted as a list of type modifiers, if any,
            * followed by the kind of type (empty string for primitive types
      -     * and {@code class}, {@code enum}, {@code interface}, or
      -     * <code>&#64;</code>{@code interface}, as appropriate), followed
      +     * and {@code class}, {@code enum}, {@code interface},
      +     * <code>&#64;</code>{@code interface}, or {@code record} as appropriate), followed
            * by the type's name, followed by an angle-bracketed
            * comma-separated list of the type's type parameters, if any,
            * including informative bounds on the type parameters, if any.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                darcy Joe Darcy
                Reporter:
                darcy Joe Darcy
                Reviewed By:
                Chris Hegarty
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: