RFR: JDK-8310502 : Optimization for j.l.Long.fastUUID() [v22]

温绍锦 duke at openjdk.org
Sun Jun 25 16:51:10 UTC 2023


On Sun, 25 Jun 2023 16:20:15 GMT, ExE Boss <duke at openjdk.org> wrote:

>> 温绍锦 has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   add jdk.util.HexDigits, sharing cache array across multiple classes, including :
>>   java.lang.Long#fastUUID
>>   java.util.HexDigits
>>   java.lang.Long#toHexString(future)
>>   java.lang.Integer#toHexString(future)
>>   java.util.HexFormat(future)
>
> src/java.base/share/classes/java/lang/Long.java line 451:
> 
>> 449:     }
>> 450: 
>> 451:     static String fastUUID(long lsb, long msb) {
> 
> This method should probably have an assert or something that `COMPACT_STRINGS` is `true`, e.g.:
> Suggestion:
> 
>     static String fastUUID(long lsb, long msb) {
>         if (!COMPACT_STRINGS) {
>             throw new InternalError("Long::fastUUID requires compact strings");
>         }

it's none-public method, only for UUID.toString

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14578#discussion_r1241236769


More information about the core-libs-dev mailing list