final long s = Math.max(2L, nextPowerOfTwo((long) Math.ceil((double) ((float) expected / f)))); if (s > 1073741824L) { throw new IllegalArgumentException( "Too large (" + expected + " expected elements with load factor " + f + ")"); } else { return (int) s;
Math.ceil( expected / f ).
final long s = nextPowerOfTwo((long) Math.ceil(expected / f)); if (s > (1 << 30)) throw new IllegalArgumentException( "Too large (" + expected + " expected elements with load factor " + f + ")"); return (int) s;
if (array == null) return 0; return calArraySize(array.length, SIZE_OF_INT);