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

Method retainAll

corpus/java/training/guava/collect/Maps.java:3920–3935  ·  view source on GitHub ↗
(Collection<?> c)

Source from the content-addressed store, hash-verified

3918 }
3919
3920 @Override
3921 public boolean retainAll(Collection<?> c) {
3922 try {
3923 return super.retainAll(checkNotNull(c));
3924 } catch (UnsupportedOperationException e) {
3925 // if the iterators don't support remove
3926 Set<Object> keys = Sets.newHashSetWithExpectedSize(c.size());
3927 for (Object o : c) {
3928 if (contains(o)) {
3929 Entry<?, ?> entry = (Entry<?, ?>) o;
3930 keys.add(entry.getKey());
3931 }
3932 }
3933 return map().keySet().retainAll(keys);
3934 }
3935 }
3936 }
3937
3938 @GwtIncompatible // NavigableMap

Callers

nothing calls this directly

Calls 9

containsMethod · 0.95
mapMethod · 0.95
retainAllMethod · 0.65
sizeMethod · 0.65
addMethod · 0.65
getKeyMethod · 0.65
keySetMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected