8308856: jdk.internal.classfile.impl.EntryMap::nextPowerOfTwo math problem

Reviewed-by: jlahoda
This commit is contained in:
Adam Sotona 2023-06-01 11:50:20 +00:00
parent 6adc242cf3
commit a6109bf1ea

@ -174,8 +174,7 @@ public abstract class EntryMap<T> {
}
public static long nextPowerOfTwo( long x ) {
x = -1 >>> Long.numberOfLeadingZeros(x - 1);
return x + 1;
return 1L << -Long.numberOfLeadingZeros(x - 1);
}
public static int arraySize( final int expected, final float f ) {