Delegates to Map#get. Returns null on ClassCastException and NullPointerException.
(Map<?, V> map, @Nullable Object key)
| 3480 | * ClassCastException} and {@code NullPointerException}. |
| 3481 | */ |
| 3482 | static <V> V safeGet(Map<?, V> map, @Nullable Object key) { |
| 3483 | checkNotNull(map); |
| 3484 | try { |
| 3485 | return map.get(key); |
| 3486 | } catch (ClassCastException e) { |
| 3487 | return null; |
| 3488 | } catch (NullPointerException e) { |
| 3489 | return null; |
| 3490 | } |
| 3491 | } |
| 3492 | |
| 3493 | /** |
| 3494 | * Delegates to {@link Map#containsKey}. Returns {@code false} on {@code |