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%2FSnapshot.java;h=2677baff6da40d1e2caba4a7b257594e5233bb3b;hp=8a836bffb9962b760f1bd45362b8555fc9c5f3f8;hb=97542f208267cb5392fc8c8d9baf6c1d3ee4ae32;hpb=c9943f5bc72d4cde9356d3bd4cf73d36f4b2f754 diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/Snapshot.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/Snapshot.java index 8a836bffb9..2677baff6d 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/Snapshot.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/Snapshot.java @@ -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; @@ -62,6 +63,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; } @@ -103,7 +107,7 @@ public class Snapshot implements Serializable { public String toString() { return "Snapshot [lastIndex=" + lastIndex + ", lastTerm=" + lastTerm + ", lastAppliedIndex=" + lastAppliedIndex + ", lastAppliedTerm=" + lastAppliedTerm + ", unAppliedEntries size=" + unAppliedEntries.size() - + ", state size=" + state.length + ", electionTerm=" + electionTerm + ", electionVotedFor=" + electionVotedFor - + ", ServerConfigPayload=" + serverConfig + "]"; + + ", state size=" + state.length + ", electionTerm=" + electionTerm + ", electionVotedFor=" + + electionVotedFor + ", ServerConfigPayload=" + serverConfig + "]"; } }