Bug 5740: Remove Serializable where not necessary
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / Snapshot.java
index 24132ea99979ca5b3ad45bdc0951c0195c30890b..93226ccab201aab0ed98214ae7e64251a98f0540 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.controller.cluster.raft;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.io.Serializable;
 import java.util.List;
 import org.opendaylight.controller.cluster.raft.persisted.ServerConfigurationPayload;
@@ -16,7 +17,10 @@ import org.opendaylight.controller.cluster.raft.persisted.ServerConfigurationPay
  *
  * @author Moiz Raja
  * @author Thomas Pantelis
+ *
+ * @deprecated Use {@link org.opendaylight.controller.cluster.raft.persisted.Snapshot} instead.
  */
+@Deprecated
 public class Snapshot implements Serializable {
     private static final long serialVersionUID = -8298574936724056236L;
 
@@ -62,6 +66,9 @@ public class Snapshot implements Serializable {
                 electionTerm, electionVotedFor, serverConfig);
     }
 
+    @SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "Exposes a mutable object stored in a field but "
+            + "this is OK since this class is merely a DTO and does not process the byte[] internally. "
+            + "Also it would be inefficient to create a return copy as the byte[] could be large.")
     public byte[] getState() {
         return state;
     }