Warning: in most circumstances it is better to set a per-cache {@linkplain #maximumSize maximum size} instead of using soft references. You should only use this method ifyou are well familiar with the practical consequences of soft references.
Warning: when this method is used, the resulting map will use identity ( {@code ==}) comparison to determine equality of values. This technically violates the specifications of the methods {@link Map#containsValue containsValue}, {@link ConcurrentMap#remove(Object,Object) remove(Object, Object)} and{@link ConcurrentMap#replace(Object,Object,Object) replace(K, V, V)}, and may not be what you expect. @throws IllegalStateException if the value strength was already set @see SoftReference
|
|