Fix FindBugs warnings in sal-clustering-commons
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / datastore / node / utils / stream / AbstractNormalizedNodeDataOutput.java
index 51a9c1c24eafe5ee29289f202679ce0e39730172..706665b0b8dfdf738a6c53d9699b2a5a72dda815 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.cluster.datastore.node.utils.stream;
 
 import com.google.common.base.Preconditions;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -361,6 +362,8 @@ abstract class AbstractNormalizedNodeDataOutput implements NormalizedNodeDataOut
         }
     }
 
+    @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST",
+            justification = "The casts in the switch clauses are indirectly confirmed via the determination of 'type'.")
     @Override
     public void writePathArgument(final PathArgument pathArgument) throws IOException {
 
@@ -410,9 +413,9 @@ abstract class AbstractNormalizedNodeDataOutput implements NormalizedNodeDataOut
         if (keyValueMap != null && !keyValueMap.isEmpty()) {
             output.writeInt(keyValueMap.size());
 
-            for (QName qname : keyValueMap.keySet()) {
-                writeQName(qname);
-                writeObject(keyValueMap.get(qname));
+            for (Map.Entry<QName, Object> entry : keyValueMap.entrySet()) {
+                writeQName(entry.getKey());
+                writeObject(entry.getValue());
             }
         } else {
             output.writeInt(0);