import com.google.common.annotations.Beta;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.UnmodifiableIterator;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
* {@link #toModifiableMap()}) and makes an efficient copy of its contents. All other maps are converted to an
* {@link ImmutableOffsetMap} with the same iteration order as input.
*
+ * @param <K> the type of keys maintained by the map
+ * @param <V> the type of mapped values
* @param map Input map, may not be null.
* @return An isolated, immutable copy of the input map
* @throws NullPointerException if {@code map} or any of its elements is null.
* {@link #toModifiableMap()}) and makes an efficient copy of its contents. All other maps are converted to an
* {@link ImmutableOffsetMap}. Iterator order is not guaranteed to be retained.
*
+ * @param <K> the type of keys maintained by the map
+ * @param <V> the type of mapped values
* @param map Input map, may not be null.
* @return An isolated, immutable copy of the input map
* @throws NullPointerException if {@code map} or any of its elements is null.
@Override
public @NonNull Iterator<Entry<K, V>> iterator() {
final Iterator<Entry<K, Integer>> it = offsets.entrySet().iterator();
- return new UnmodifiableIterator<Entry<K, V>>() {
+ return new UnmodifiableIterator<>() {
@Override
public boolean hasNext() {
return it.hasNext();
return f;
}
+ @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static void setField(final @NonNull ImmutableOffsetMap<?, ?> map, final @NonNull Field field,
final Object value) throws IOException {
try {