JDK-8235428 : Class.toGenericString need to be updated for records
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 14
  • Submitted: 2019-12-05
  • Updated: 2019-12-06
  • Resolved: 2019-12-05
Related Reports
CSR :  
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.


Comments
Looks like now a comma is missed before " as appropriate"
06-12-2019

Moving to Approved.
05-12-2019