Fix FindBugs warnings in sal-akk-raft
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / base / messages / CaptureSnapshotReply.java
index 82f3e0dce02102034c54d127cdf83374313c61bc..1e573014a9ed6596ae6af84df0f724a9e730c34c 100644 (file)
@@ -7,14 +7,21 @@
  */
 package org.opendaylight.controller.cluster.raft.base.messages;
 
  */
 package org.opendaylight.controller.cluster.raft.base.messages;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 public class CaptureSnapshotReply {
     private final byte [] snapshot;
 
 
 public class CaptureSnapshotReply {
     private final byte [] snapshot;
 
+    @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "Stores a reference to an externally mutable byte[] "
+            + "object but this is OK since this class is merely a DTO and does not process byte[] internally. "
+            + "Also it would be inefficient to create a copy as the byte[] could be large.")
     public CaptureSnapshotReply(byte [] snapshot) {
         this.snapshot = snapshot;
     }
 
     public CaptureSnapshotReply(byte [] snapshot) {
         this.snapshot = snapshot;
     }
 
+    @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 [] getSnapshot() {
         return snapshot;
     }
     public byte [] getSnapshot() {
         return snapshot;
     }