NormalizedNodeAggregator should also report empty
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / persisted / FrontendShardDataTreeSnapshotMetadata.java
index 55d97573715748b8324305679e2b31eb889f40b0..b7b1261192aeebe9ba8e689d7cff8d4bd12ba4e5 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.cluster.datastore.persisted;
 
 import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableList;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
@@ -25,6 +26,9 @@ public final class FrontendShardDataTreeSnapshotMetadata extends
 
         private List<FrontendClientMetadata> clients;
 
+        // checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
+        // redundant. It is explicitly needed for Java serialization to be able to create instances via reflection.
+        @SuppressWarnings("checkstyle:RedundantModifier")
         public Proxy() {
             // For Externalizable
         }
@@ -42,7 +46,7 @@ public final class FrontendShardDataTreeSnapshotMetadata extends
         }
 
         @Override
-        public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
+        public void readExternal(final ObjectInput in) throws IOException {
             final int size = in.readInt();
             final List<FrontendClientMetadata> readedClients = new ArrayList<>(size);
             for (int i = 0; i < size ; ++i) {
@@ -58,6 +62,9 @@ public final class FrontendShardDataTreeSnapshotMetadata extends
 
     private static final long serialVersionUID = 1L;
 
+    @SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "This field is not Serializable but this class "
+            + "implements writeReplace to delegate serialization to a Proxy class and thus instances of this class "
+            + "aren't serialized. FindBugs does not recognize this.")
     private final List<FrontendClientMetadata> clients;
 
     public FrontendShardDataTreeSnapshotMetadata(final Collection<FrontendClientMetadata> clients) {