X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-common-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fcommon%2Fapi%2Fdata%2FDataValidationFailedException.java;h=16c956caf4d7bd9c97cb6abad11e35dfd79e89d6;hb=aaea3e9a92ae9d6fac04c4a065db4b35cbca9ed0;hp=d48bfc79fe8941935bbfa2b762d254d93f1da2d0;hpb=0219d667fd81b48cd3f05faee7d39aa1acce73a4;p=controller.git diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataValidationFailedException.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataValidationFailedException.java index d48bfc79fe..16c956caf4 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataValidationFailedException.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataValidationFailedException.java @@ -7,42 +7,47 @@ */ package org.opendaylight.controller.md.sal.common.api.data; +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; -import com.google.common.base.Preconditions; - /** - * * Failure of asynchronous transaction commit caused by invalid data. * + *

* This exception is raised and returned when transaction commit - * failed, because other data submitted via transactions + * failed, because other data submitted via transactions. * - * 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; - private Path path; + @SuppressFBWarnings("SE_BAD_FIELD") + private final Path path; - private Class> pathType; + private final Class> pathType; public

> DataValidationFailedException(final Class

pathType,final P path, 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

> DataValidationFailedException(final Class

pathType,final P path, - final String message) { + public

> DataValidationFailedException(final Class

pathType,final P path, + final String message) { this(pathType, path, message, null); } @@ -53,5 +58,4 @@ public class DataValidationFailedException extends TransactionCommitFailedExcept public final Class> getPathType() { return pathType; } - }