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

Glavo duke at openjdk.org
Tue Jun 27 13:36:14 UTC 2023


On Tue, 27 Jun 2023 13:10:40 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> It's a bit smelly to have a public static field of type array. Static analysers are likely to flag this. It would be better to make the field private and have a public static method that returns DIGITS.clone() - then each class that needs it (and if I'm not mistaken there are only two) could encapsulate its own private copy.

I don't think this is a problem. If users can access JDK internal packages, it can do many things. For example, through `JavaLangAccess::getEnumConstantsShared`, an array shared within JDK can be obtained.

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

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


More information about the core-libs-dev mailing list