MCPcopy Index your code
hub / github.com/antlr/codebuff / putInBothMaps

Method putInBothMaps

output/java_guava/1.4.17/AbstractBiMap.java:132–147  ·  view source on GitHub ↗
(@Nullable K key, @Nullable V value, boolean force)

Source from the content-addressed store, hash-verified

130 }
131
132 private V putInBothMaps(@Nullable K key, @Nullable V value, boolean force) {
133 checkKey(key);
134 checkValue(value);
135 boolean containedKey = containsKey(key);
136 if (containedKey && Objects.equal(value, get(key))) {
137 return value;
138 }
139 if (force) {
140 inverse().remove(value);
141 } else {
142 checkArgument(!containsValue(value), "value already present: %s", value);
143 }
144 V oldValue = delegate.put(key, value);
145 updateInverseMap(key, containedKey, oldValue, value);
146 return oldValue;
147 }
148
149 private void updateInverseMap(K key, boolean containedKey, V oldValue, V newValue) {
150 if (containedKey) {

Callers 2

putMethod · 0.95
forcePutMethod · 0.95

Calls 11

checkKeyMethod · 0.95
checkValueMethod · 0.95
equalMethod · 0.95
inverseMethod · 0.95
containsValueMethod · 0.95
updateInverseMapMethod · 0.95
containsKeyMethod · 0.65
getMethod · 0.65
removeMethod · 0.65
putMethod · 0.65
checkArgumentMethod · 0.45

Tested by

no test coverage detected