X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FDatastoreSnapshot.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FDatastoreSnapshot.java;h=23ad0f965bfe91f498687b8ca2772c65ea66cb49;hb=057b787289f7b909d7013c22ac73a1c91c860af8;hp=54c0d7465ebbb77cac3a288aa7b72e926d94db0b;hpb=f6818ade96a5b2df7340636ac913448733d3239e;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/DatastoreSnapshot.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/DatastoreSnapshot.java index 54c0d7465e..23ad0f965b 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/DatastoreSnapshot.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/DatastoreSnapshot.java @@ -8,6 +8,7 @@ package org.opendaylight.controller.cluster.datastore.messages; import com.google.common.base.Preconditions; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.Serializable; import java.util.List; import javax.annotation.Nonnull; @@ -25,6 +26,9 @@ public class DatastoreSnapshot implements Serializable { private final byte[] shardManagerSnapshot; private final List shardSnapshots; + @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 return copy as the byte[] could be large.") public DatastoreSnapshot(@Nonnull String type, @Nullable byte[] shardManagerSnapshot, @Nonnull List shardSnapshots) { this.type = Preconditions.checkNotNull(type); @@ -37,6 +41,9 @@ public class DatastoreSnapshot implements Serializable { return type; } + @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 byte[] internally. " + + "Also it would be inefficient to create a return copy as the byte[] could be large.") @Nullable public byte[] getShardManagerSnapshot() { return shardManagerSnapshot; @@ -63,6 +70,9 @@ public class DatastoreSnapshot implements Serializable { return name; } + @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 byte[] internally. " + + "Also it would be inefficient to create a return copy as the byte[] could be large.") @Nonnull public byte[] getSnapshot() { return snapshot;