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

Method ensureCapacity

corpus/java/training/guava/primitives/Doubles.java:309–313  ·  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

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

Source from the content-addressed store, hash-verified

307 * {@code minLength}
308 */
309 public static double[] ensureCapacity(double[] array, int minLength, int padding) {
310 checkArgument(minLength >= 0, "Invalid minLength: %s", minLength);
311 checkArgument(padding >= 0, "Invalid padding: %s", padding);
312 return (array.length < minLength) ? Arrays.copyOf(array, minLength + padding) : array;
313 }
314
315 /**
316 * Returns a string containing the supplied {@code double} values, converted to strings as

Callers

nothing calls this directly

Calls 2

checkArgumentMethod · 0.45
copyOfMethod · 0.45

Tested by

no test coverage detected