RFR: 8338544: Dedicated Array class descriptor implementation [v6]

Mandy Chung mchung at openjdk.org
Tue Oct 22 23:51:12 UTC 2024


On Tue, 22 Oct 2024 23:29:29 GMT, Chen Liang <liach at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/constant/ClassDesc.java line 278:
>> 
>>> 276: 
>>> 277:     /**
>>> 278:      * {@return a human-readable name for this {@code ClassDesc}}
>> 
>> I don't see the merit of making the string representation unspecified.   The implSpec already specifies the string representation for the display name.   Why not just promoting it to normal spec text?
>
> I believe the specification for class or interface display name is too tight: if we have `java.awt.List` versus `java.util.List`, our current implementation prints `List` for both cases. It makes sense for an implementation to print something like `j.a.List` versus `j.u.List`.

Returning the fully-qualified class name could also be an option.   Since the implementation is not changed, I would suggest promoting the implSpec text to normal spec text.   For a proposal to change the specification as well as the implementation to return something different with incompatibility, it'd good to do it as a separate RFE and discuss what was considered when the implSpec was decided to print the unqualified class name.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20665#discussion_r1811573420


More information about the core-libs-dev mailing list