(Collection<?> c)
| 4213 | } |
| 4214 | |
| 4215 | @Override |
| 4216 | public boolean retainAll(Collection<?> c) { |
| 4217 | try { |
| 4218 | return super.retainAll(checkNotNull(c)); |
| 4219 | } catch (UnsupportedOperationException e) { |
| 4220 | // if the iterators don't support remove |
| 4221 | Set<@Nullable Object> keys = Sets.newHashSetWithExpectedSize(c.size()); |
| 4222 | for (Object o : c) { |
| 4223 | /* |
| 4224 | * `o instanceof Entry` is guaranteed by `contains`, but we check it here to satisfy our |
| 4225 | * nullness checker. |
| 4226 | */ |
| 4227 | if (contains(o) && o instanceof Entry) { |
| 4228 | Entry<?, ?> entry = (Entry<?, ?>) o; |
| 4229 | keys.add(entry.getKey()); |
| 4230 | } |
| 4231 | } |
| 4232 | return map().keySet().retainAll(keys); |
| 4233 | } |
| 4234 | } |
| 4235 | } |
| 4236 | |
| 4237 | @GwtIncompatible // NavigableMap |
nothing calls this directly
no test coverage detected