RFR: 8309838: Classfile API Util.toBinaryName and other cleanup

Chen Liang liach at openjdk.org
Mon Jun 12 10:56:52 UTC 2023


On Mon, 12 Jun 2023 10:45:03 GMT, ExE Boss <duke at openjdk.org> wrote:

>> Thanks to @exe-boss for the reviews in #13082. This cleanup patch fixed the typos you pointed out and removed other redundancies in classfile Util as well.
>
> src/java.base/share/classes/jdk/internal/classfile/impl/Util.java line 90:
> 
>> 88:     public static String toBinaryName(ClassDesc cd) {
>> 89:         return toInternalName(cd).replace('/', '.');
>> 90:     }
> 
> Note that this method can get called with array class descriptors as well, so the correct implementation would be:
> Suggestion:
> 
>     public static String toBinaryName(ClassDesc cd) {
>         return (cd.isArray() ? cd.descriptorString() : toInternalName(cd))
>             .replace('/', '.');
>     }

This isn't. We don't pass array classes to ClassHierarchyResolvers.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14412#discussion_r1226470850


More information about the core-libs-dev mailing list