MCPcopy Create free account
hub / github.com/BaseXdb/basex / checkCapacity

Method checkCapacity

basex-core/src/main/java/org/basex/util/Array.java:286–290  ·  view source on GitHub ↗

Raises an exception if the specified size exceeds the maximum array size. Should be called whenever an array with a fixed size is created. @param size array capacity @return argument as integer, or 0 if the argument is negative

(final long size)

Source from the content-addressed store, hash-verified

284 * @return argument as integer, or {@code 0} if the argument is negative
285 */
286 public static int checkCapacity(final long size) {
287 if(size > MAX_SIZE) throw new ArrayIndexOutOfBoundsException(
288 "Maximum array size exceeded (" + size + " > " + MAX_SIZE + ").");
289 return Math.max(0, (int) size);
290 }
291
292 /**
293 * Compares two token arrays for equality.

Callers 6

writeMethod · 0.95
hexMethod · 0.95
newCapacityMethod · 0.95
ASetMethod · 0.95
storeMethod · 0.45
storeMethod · 0.45

Calls 1

maxMethod · 0.45

Tested by

no test coverage detected