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

Method retainAll

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

Source from the content-addressed store, hash-verified

3834 }
3835
3836 @Override
3837 public boolean retainAll(Collection<?> c) {
3838 try {
3839 return super.retainAll(checkNotNull(c));
3840 } catch (UnsupportedOperationException e) {
3841 Set<K> toRetain = Sets.newHashSet();
3842 for (Entry<K, V> entry : map().entrySet()) {
3843 if (c.contains(entry.getValue())) {
3844 toRetain.add(entry.getKey());
3845 }
3846 }
3847 return map().keySet().retainAll(toRetain);
3848 }
3849 }
3850
3851 @Override
3852 public int size() {

Callers

nothing calls this directly

Calls 10

newHashSetMethod · 0.95
mapMethod · 0.95
retainAllMethod · 0.65
entrySetMethod · 0.65
containsMethod · 0.65
getValueMethod · 0.65
addMethod · 0.65
getKeyMethod · 0.65
keySetMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected