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

Method badElementIndex

output/java_guava/1.4.19/Preconditions.java:1249–1257  ·  view source on GitHub ↗
(int index, int size, String desc)

Source from the content-addressed store, hash-verified

1247 }
1248
1249 private static String badElementIndex(int index, int size, String desc) {
1250 if (index < 0) {
1251 return format("%s (%s) must not be negative", desc, index);
1252 } else if (size < 0) {
1253 throw new IllegalArgumentException("negative size: " + size);
1254 } else { // index >= size
1255 return format("%s (%s) must be less than size (%s)", desc, index, size);
1256 }
1257 }
1258
1259 /**
1260 * Ensures that {@code index} specifies a valid <i>position</i> in an array, list or string of

Callers 1

checkElementIndexMethod · 0.95

Calls 1

formatMethod · 0.95

Tested by

no test coverage detected