RFR: 8278863: Add method ClassDesc::ofInternalName [v3]

ExE Boss duke at openjdk.org
Tue Jul 26 20:01:19 UTC 2022


On Tue, 26 Jul 2022 09:19:07 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   updated ClassDesc::ofInternal javadoc with JVMS link and fixed indentation
>
> src/java.base/share/classes/java/lang/constant/ClassDesc.java line 85:
> 
>> 83:      * given the name of the class or interface in internal form,
>> 84:      * such as {@code "java/lang/String"}.
>> 85:      * (To create a descriptor for an array type, either use {@link #ofDescriptor(String)}
> 
> It feels like this section could be expanded a bit (and parenthesis removed). E.g. as you point out in the comment, this method only supports reference types, so we should state so clearly. And then present alternatives (like you do now).

Isn’t the internal name of an array type its descriptor though?

So, I feel like this method should allow array descriptors.

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

PR: https://git.openjdk.org/jdk/pull/9201


More information about the core-libs-dev mailing list