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

Method safeContainsKey

output/java_guava/1.4.17/Maps.java:3540–3549  ·  view source on GitHub ↗

Delegates to Map#containsKey. Returns false on ClassCastException and NullPointerException.

(Map<?, ?> map, Object key)

Source from the content-addressed store, hash-verified

3538
3539
3540 static boolean safeContainsKey(Map<?, ?> map, Object key) {
3541 checkNotNull(map);
3542 try {
3543 return map.containsKey(key);
3544 } catch (ClassCastException e) {
3545 return false;
3546 } catch (NullPointerException e) {
3547 return false;
3548 }
3549 }
3550
3551 /**
3552 * Delegates to {@link Map#remove}. Returns {@code null} on {@code

Callers 8

containsKeyMethod · 0.95
containsRowMethod · 0.95
containsColumnMethod · 0.95
containsMethod · 0.95
containsKeyMethod · 0.95
containsKeyMethod · 0.95
containsColumnMethod · 0.45
containsRowMethod · 0.45

Calls 2

containsKeyMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected