RFR: 8308856: jdk.internal.classfile.impl.EntryMap::nextPowerOfTwo math problem
Andrey Turbanov
aturbanov at openjdk.org
Sun May 28 22:06:54 UTC 2023
On Thu, 25 May 2023 12:24:59 GMT, Adam Sotona <asotona at openjdk.org> wrote:
> Fix of jdk.internal.classfile.impl.EntryMap::nextPowerOfTwo returning correct zero power of two.
>
> Please review.
>
> Thanks,
> Adam
src/java.base/share/classes/jdk/internal/classfile/impl/EntryMap.java line 177:
> 175:
> 176: public static long nextPowerOfTwo( long x ) {
> 177: return 1l << -Long.numberOfLeadingZeros(x - 1);
Suggestion:
return 1L << -Long.numberOfLeadingZeros(x - 1);
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14148#discussion_r1208669192
More information about the core-libs-dev
mailing list