X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2Fmessages%2FInstallSnapshot.java;h=b64e902f3ff9f93e782c4114e6e690bbef971b0a;hp=4528dcbf5e9370dec5631fd7efcd97745aaa876b;hb=97542f208267cb5392fc8c8d9baf6c1d3ee4ae32;hpb=0f4c2236a45097dcac1d66415cb76aabcc4a873f diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshot.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshot.java index 4528dcbf5e..b64e902f3f 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshot.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshot.java @@ -9,6 +9,7 @@ package org.opendaylight.controller.cluster.raft.messages; import com.google.common.base.Optional; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; @@ -30,6 +31,9 @@ public class InstallSnapshot extends AbstractRaftRPC { private final Optional lastChunkHashCode; private final Optional serverConfig; + @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 InstallSnapshot(long term, String leaderId, long lastIncludedIndex, long lastIncludedTerm, byte[] data, int chunkIndex, int totalChunks, Optional lastChunkHashCode, Optional serverConfig) { @@ -62,6 +66,9 @@ public class InstallSnapshot extends AbstractRaftRPC { return lastIncludedTerm; } + @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[] getData() { return data; }