(Collection<?> c)
| 3988 | } |
| 3989 | |
| 3990 | @Override |
| 3991 | public boolean retainAll(Collection<?> c) { |
| 3992 | try { |
| 3993 | return super.retainAll(checkNotNull(c)); |
| 3994 | } catch (UnsupportedOperationException e) { |
| 3995 | // if the iterators don't support remove |
| 3996 | Set<Object> keys = Sets.newHashSetWithExpectedSize(c.size()); |
| 3997 | for (Object o : c) { |
| 3998 | if (contains(o)) { |
| 3999 | Entry<?, ?> entry = (Entry<?, ?>) o; |
| 4000 | keys.add(entry.getKey()); |
| 4001 | } |
| 4002 | } |
| 4003 | return map().keySet().retainAll(keys); |
| 4004 | } |
| 4005 | } |
| 4006 | } |
| 4007 | |
| 4008 | @GwtIncompatible // NavigableMap |
nothing calls this directly
no test coverage detected