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%2Fsal%2Fdom%2Fbroker%2Fosgi%2FAbstractBrokerServiceProxy.java;h=853e3e391f591a8b3d6c5aad72d5d62da0093471;hp=cfaf481e721361b605f50d2b7a8a34cb50ac072b;hb=48814d6a264b8f13e5db1422336d9ef25cb05fa9;hpb=94d0d20b41d64bb6696c2a573ec367fcfddc44e9 diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/AbstractBrokerServiceProxy.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/AbstractBrokerServiceProxy.java index cfaf481e72..853e3e391f 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/AbstractBrokerServiceProxy.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/AbstractBrokerServiceProxy.java @@ -7,6 +7,9 @@ */ package org.opendaylight.controller.sal.dom.broker.osgi; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; + import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -14,14 +17,13 @@ import java.util.Set; import org.opendaylight.controller.sal.core.api.BrokerService; import org.opendaylight.yangtools.concepts.Registration; import org.osgi.framework.ServiceReference; -import static com.google.common.base.Preconditions.*; public abstract class AbstractBrokerServiceProxy implements AutoCloseable, BrokerService { private T delegate; private final ServiceReference reference; - public AbstractBrokerServiceProxy(ServiceReference ref, T delegate) { + public AbstractBrokerServiceProxy(final ServiceReference ref, final T delegate) { this.delegate = checkNotNull(delegate, "Delegate should not be null."); this.reference = checkNotNull(ref, "Reference should not be null."); } @@ -35,9 +37,9 @@ public abstract class AbstractBrokerServiceProxy implem return reference; } - private Set> registrations = Collections.synchronizedSet(new HashSet>()); + private final Set> registrations = Collections.synchronizedSet(new HashSet>()); - protected > R addRegistration(R registration) { + protected > R addRegistration(final R registration) { if (registration != null) { registrations.add(registration); }