Delegates to Map#containsKey. Returns false on ClassCastException and NullPointerException.
(Map<?, ?> map, Object key)
| 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 |
no test coverage detected