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

Method weakValues

output/java_guava/1.4.19/MapMaker.java:249–253  ·  view source on GitHub ↗

Specifies that each value (not key) stored in the map should be wrapped in a WeakReference (by default, strong references are used). Weak values will be garbage collected once they are weakly reachable. This makes them a poor candidate for caching. Warning: when this method is

()

Source from the content-addressed store, hash-verified

247 */
248
249 @CanIgnoreReturnValue
250 @GwtIncompatible // java.lang.ref.WeakReference
251 public MapMaker weakValues() {
252 return setValueStrength(Strength.WEAK);
253 }
254
255 MapMaker setValueStrength(Strength strength) {
256 checkState(valueStrength == null, "Value strength was already set to %s", valueStrength);

Callers 2

toCacheBuilderMethod · 0.45
LargeLazyStripedMethod · 0.45

Calls 1

setValueStrengthMethod · 0.95

Tested by

no test coverage detected