X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FAbstractDOMForwardedCompositeTransaction.java;h=763614d098d5785d92f17070824bb63c4d26d157;hp=15d53f53103c6d4aef8aa3933d6980ae09f75d04;hb=2a6aa1775604906755883f810ee9ea6d5f286135;hpb=cc0542591cd61d968af7083409730f24954feae1 diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/AbstractDOMForwardedCompositeTransaction.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/AbstractDOMForwardedCompositeTransaction.java index 15d53f5310..763614d098 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/AbstractDOMForwardedCompositeTransaction.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/AbstractDOMForwardedCompositeTransaction.java @@ -1,12 +1,15 @@ /* * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.controller.md.sal.dom.broker.impl; -import com.google.common.base.Preconditions; +import static com.google.common.base.Preconditions.checkArgument; +import static java.util.Objects.requireNonNull; + import java.util.Collection; import java.util.Map; import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; @@ -17,6 +20,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; /** * Composite DOM Transaction backed by {@link DOMStoreTransaction}. * + *

* Abstract base for composite transaction, which provides access only to common * functionality as retrieval of subtransaction, close method and retrieval of * identifier. @@ -26,6 +30,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; * @param * Subtransaction type */ +@Deprecated(forRemoval = true) abstract class AbstractDOMForwardedCompositeTransaction implements AsyncTransaction> { @@ -33,7 +38,6 @@ abstract class AbstractDOMForwardedCompositeTransaction backingTxs) { - this.identifier = Preconditions.checkNotNull(identifier, "Identifier should not be null"); - this.backingTxs = Preconditions.checkNotNull(backingTxs, "Backing transactions should not be null"); + this.identifier = requireNonNull(identifier, "Identifier should not be null"); + this.backingTxs = requireNonNull(backingTxs, "Backing transactions should not be null"); } /** * Returns subtransaction associated with supplied key. * - * @param key - * @return + * @param key key + * @return subtransaction * @throws NullPointerException * if key is null * @throws IllegalArgumentException * if no subtransaction is associated with key. */ protected final T getSubtransaction(final K key) { - Preconditions.checkNotNull(key, "key must not be null."); - - final T ret = backingTxs.get(key); - Preconditions.checkArgument(ret != null, "No subtransaction associated with %s", key); + final T ret = backingTxs.get(requireNonNull(key, "key must not be null.")); + checkArgument(ret != null, "No subtransaction associated with %s", key); return ret; } @@ -77,6 +79,7 @@ abstract class AbstractDOMForwardedCompositeTransaction