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

Method safeContainsKey

output/java_guava/1.4.19/Maps.java:3544–3553  ·  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

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

Callers 7

containsKeyMethod · 0.95
containsRowMethod · 0.95
containsColumnMethod · 0.95
containsMethod · 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