import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMap.Builder;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.AbstractMap;
// Used via VarHandle above
@SuppressWarnings("unused")
+ @SuppressFBWarnings(value = "UUF_UNUSED_FIELD", justification = "https://github.com/spotbugs/spotbugs/issues/2749")
private volatile State<K, V> state;
private LazyBindingMap(final Unordered<K, V> codec, final MapNode mapNode) {
this.mapNode = requireNonNull(mapNode);
}
- static <K extends Key<V>, V extends DataObject & KeyAware<K>> @NonNull Map<K, V> create(
- final Unordered<K, V> codec, final MapNode mapNode, final int size) {
+ static <K extends Key<V>, V extends DataObject & KeyAware<K>> @NonNull Map<K, V> of(final Unordered<K, V> codec,
+ final MapNode mapNode, final int size) {
if (size == 1) {
// Do not bother with lazy instantiation in case of a singleton
final V entry = codec.createBindingProxy(mapNode.body().iterator().next());