Fix javadoc warnings in ImmutableOffsetMap
[yangtools.git] / common / util / src / main / java / org / opendaylight / yangtools / util / ImmutableOffsetMap.java
index aa44a97deaddcff4b2019b78dfd9f2b475bd302a..66b20fbdf1ec9be8cdb47ef557bc897be1b08d38 100644 (file)
@@ -13,6 +13,7 @@ import static java.util.Objects.requireNonNull;
 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;
@@ -116,6 +117,8 @@ public abstract class ImmutableOffsetMap<K, V> implements UnmodifiableMapPhase<K
      * {@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.
@@ -151,6 +154,8 @@ public abstract class ImmutableOffsetMap<K, V> implements UnmodifiableMapPhase<K
      * {@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.
@@ -349,7 +354,7 @@ public abstract class ImmutableOffsetMap<K, V> implements UnmodifiableMapPhase<K
         @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();
@@ -392,6 +397,8 @@ public abstract class ImmutableOffsetMap<K, V> implements UnmodifiableMapPhase<K
         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 {