X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsamples%2Ftoaster-provider%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsample%2Ftoaster%2Fprovider%2FOpendaylightToaster.java;fp=opendaylight%2Fmd-sal%2Fsamples%2Ftoaster-provider%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsample%2Ftoaster%2Fprovider%2FOpendaylightToaster.java;h=4b425d121af7c5c10b8c33beec9367a6c27a981d;hb=3859df9beca8f13f1ff2b2744ed3470a1715bec3;hp=fc1e380a4c16bf324ee85e611dc510d602d89073;hpb=083a04543a96ae862c48ccb4aaefc667f19d9f1e;p=controller.git diff --git a/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/OpendaylightToaster.java b/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/OpendaylightToaster.java index fc1e380a4c..4b425d121a 100644 --- a/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/OpendaylightToaster.java +++ b/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/OpendaylightToaster.java @@ -7,6 +7,7 @@ */ package org.opendaylight.controller.sample.toaster.provider; +import static java.util.Objects.requireNonNull; import static org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType.DELETE; import static org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType.WRITE; import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION; @@ -14,7 +15,6 @@ import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL import static org.opendaylight.yangtools.yang.common.RpcError.ErrorType.APPLICATION; import com.google.common.base.Function; -import com.google.common.base.Preconditions; import com.google.common.util.concurrent.FluentFuture; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; @@ -120,9 +120,8 @@ public class OpendaylightToaster extends AbstractMXBean public void init() { LOG.info("Initializing..."); - Preconditions.checkNotNull(dataBroker, "dataBroker must be set"); - dataTreeChangeListenerRegistration = dataBroker.registerDataTreeChangeListener( - DataTreeIdentifier.create(CONFIGURATION, TOASTER_IID), this); + dataTreeChangeListenerRegistration = requireNonNull(dataBroker, "dataBroker must be set") + .registerDataTreeChangeListener(DataTreeIdentifier.create(CONFIGURATION, TOASTER_IID), this); setToasterStatusUp(null); // Register our MXBean.