Migrate OSGI compendium reference
[controller.git] / opendaylight / md-sal / sal-common-api / src / main / java / org / opendaylight / controller / md / sal / common / api / data / DataValidationFailedException.java
index 9d2b88702eba612dcfc55c01d8f6d9d54e3af49f..16c956caf4d7bd9c97cb6abad11e35dfd79e89d6 100644 (file)
@@ -7,7 +7,9 @@
  */
 package org.opendaylight.controller.md.sal.common.api.data;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.opendaylight.yangtools.concepts.Path;
 import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
@@ -20,14 +22,18 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
  * failed, because other data submitted via transactions.
  *
  * <p>
- *  Clients usually are not able recover from this error condition by
- *  retrieving same transaction, since data introduced by this transaction
- *  are invalid.
+ * Clients usually are not able recover from this error condition by
+ * retrieving same transaction, since data introduced by this transaction
+ * are invalid.
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.common.api.DataValidationFailedException} instead.
  */
+@Deprecated(forRemoval = true)
 public class DataValidationFailedException extends TransactionCommitFailedException {
 
     private static final long serialVersionUID = 1L;
 
+    @SuppressFBWarnings("SE_BAD_FIELD")
     private final Path<?> path;
 
     private final Class<? extends Path<?>> pathType;
@@ -36,12 +42,12 @@ public class DataValidationFailedException extends TransactionCommitFailedExcept
                                                              final String message, final Throwable cause) {
         super(message, cause, RpcResultBuilder.newError(ErrorType.APPLICATION, "invalid-value", message, null,
                                                         path != null ? path.toString() : null, cause));
-        this.pathType = Preconditions.checkNotNull(pathType, "path type must not be null");
-        this.path = Preconditions.checkNotNull(path,"path must not be null.");
+        this.pathType = requireNonNull(pathType, "path type must not be null");
+        this.path = requireNonNull(path,"path must not be null.");
     }
 
-    public  <P extends Path<P>> DataValidationFailedException(final Class<P> pathType,final P path,
-                                                              final String message) {
+    public <P extends Path<P>> DataValidationFailedException(final Class<P> pathType,final P path,
+                                                             final String message) {
         this(pathType, path, message, null);
     }