RFR: 8331114: Further improve performance of MethodTypeDesc::descriptorString [v3]

Chen Liang liach at openjdk.org
Thu Apr 25 23:08:35 UTC 2024


On Thu, 25 Apr 2024 22:57:50 GMT, Florent Guillaume <duke at openjdk.org> wrote:

>> Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Calculate length precisely
>
> src/java.base/share/classes/java/lang/constant/MethodTypeDescImpl.java line 181:
> 
>> 179:             sb.append(argType.descriptorString());
>> 180:         }
>> 181:         desc = sb.append(')').append(returnType().descriptorString()).toString();
> 
> Nit: the rest of the code (and even the new sizing part you added) uses `returnType` instead of `returnType()`

Think the `returnType()` call was for parity with displayDescriptor changes; now that we are just in the impl class, either way is fine.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18945#discussion_r1580235742


More information about the core-libs-dev mailing list