MCPcopy Create free account
hub / github.com/antlr/codebuff / ensureCapacity

Method ensureCapacity

output/java_guava/1.4.18/Longs.java:490–494  ·  view source on GitHub ↗

Returns an array containing the same values as array, but guaranteed to be of a specified minimum length. If array already has a length of at least minLength, it is returned directly. Otherwise, a new array of size minLength + padding is returned, containing the value

(long[] array, int minLength, int padding)

Source from the content-addressed store, hash-verified

488
489
490 public static long[] ensureCapacity(long[] array, int minLength, int padding) {
491 checkArgument(minLength >= 0, "Invalid minLength: %s", minLength);
492 checkArgument(padding >= 0, "Invalid padding: %s", padding);
493 return (array.length < minLength) ? Arrays.copyOf(array, minLength + padding) : array;
494 }
495
496 /**
497 * Returns a string containing the supplied {@code long} values separated by {@code separator}.

Callers

nothing calls this directly

Calls 2

checkArgumentMethod · 0.45
copyOfMethod · 0.45

Tested by

no test coverage detected