(int index, int size, String desc)
| 1294 | } |
| 1295 | |
| 1296 | private static String badPositionIndex(int index, int size, String desc) { |
| 1297 | if (index < 0) { |
| 1298 | return format("%s (%s) must not be negative", desc, index); |
| 1299 | } else if (size < 0) { |
| 1300 | throw new IllegalArgumentException("negative size: " + size); |
| 1301 | } else { // index > size |
| 1302 | return format("%s (%s) must not be greater than size (%s)", desc, index, size); |
| 1303 | } |
| 1304 | } |
| 1305 | |
| 1306 | /** |
| 1307 | * Ensures that {@code start} and {@code end} specify a valid <i>positions</i> in an array, list |
no test coverage detected