RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float) [v2]

Raffaello Giulietti rgiulietti at openjdk.org
Fri Sep 29 19:51:26 UTC 2023


On Fri, 29 Sep 2023 18:56:26 GMT, 温绍锦 <duke at openjdk.org> wrote:

>> Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Uppercase JLA.
>
> src/java.base/share/classes/jdk/internal/math/DoubleToDecimal.java line 110:
> 
>> 108:     private static final int NAN            = 5;
>> 109: 
>> 110:     private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
> 
> JLA is defined repeatedly in many places. Is this a good practice?  Can we use it directly, like this:
> 
> return SharedSecrets
>            .getJavaLangAccess()
>            .newStringNoRepl(bytes, StandardCharsets.ISO_8859_1);

@wenshao I'll take a note for the next commit, thanks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15861#discussion_r1341741225


More information about the core-libs-dev mailing list