Migrate nullness annotations
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / exceptions / NoShardLeaderException.java
index fed443b5d4f08f67c4887ab78fd1b630c4d9ce34..205de939559caaa684a2c21a7034489f5e40746d 100644 (file)
@@ -8,8 +8,7 @@
 package org.opendaylight.controller.cluster.datastore.exceptions;
 
 import com.google.common.base.Strings;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import javax.annotation.Nullable;
+import org.opendaylight.controller.cluster.datastore.identifiers.ShardIdentifier;
 
 /**
  * Exception indicating a shard has no current leader.
@@ -19,14 +18,16 @@ import javax.annotation.Nullable;
 public class NoShardLeaderException extends RuntimeException {
     private static final long serialVersionUID = 1L;
 
-    public NoShardLeaderException(String message) {
+    public NoShardLeaderException(final String message) {
         super(message);
     }
 
-    @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
-            justification = "Unrecognised NullableDecl")
-    public NoShardLeaderException(@Nullable String message, String shardName) {
+    public NoShardLeaderException(final String message, final String shardName) {
         super(String.format("%sShard %s currently has no leader. Try again later.",
-                (Strings.isNullOrEmpty(message) ? "" : message + ". "), shardName));
+                Strings.isNullOrEmpty(message) ? "" : message + ". ", shardName));
+    }
+
+    public NoShardLeaderException(final ShardIdentifier shardId) {
+        this("Shard " + shardId + " currently has no leader. Try again later.");
     }
 }