MCPcopy Index your code
hub / github.com/apache/groovy / checkType

Method checkType

src/main/java/groovy/lang/Sequence.java:289–302  ·  view source on GitHub ↗

Checks that the given object instance is of the correct type otherwise a runtime exception is thrown

(Object object)

Source from the content-addressed store, hash-verified

287 * otherwise a runtime exception is thrown
288 */
289 protected void checkType(Object object) {
290 if (object == null) {
291 throw new NullPointerException("Sequences cannot contain null, use a List instead");
292 }
293 if (type != null) {
294 if (!type.isInstance(object)) {
295 throw new IllegalArgumentException(
296 "Invalid type of argument for sequence of type: "
297 + type.getName()
298 + " cannot add object: "
299 + object);
300 }
301 }
302 }
303}

Callers 2

addMethod · 0.95
checkCollectionTypeMethod · 0.95

Calls 1

getNameMethod · 0.65

Tested by

no test coverage detected