Update MRI projects for Aluminium
[netconf.git] / netconf / sal-netconf-connector / src / main / java / org / opendaylight / netconf / sal / connect / netconf / sal / NetconfDeviceSalProvider.java
index d6b6354a3ece4476c4803beb92a739ea20486e9b..5dd2418603f5899444939893cc3caaf7dc5a87e6 100644 (file)
@@ -11,6 +11,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
 import static java.util.Objects.requireNonNull;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.Transaction;
 import org.opendaylight.mdsal.binding.api.TransactionChain;
@@ -24,12 +25,11 @@ import org.opendaylight.mdsal.dom.api.DOMNotificationService;
 import org.opendaylight.mdsal.dom.api.DOMRpcService;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class NetconfDeviceSalProvider implements AutoCloseable {
-
     private static final Logger LOG = LoggerFactory.getLogger(NetconfDeviceSalProvider.class);
 
     private final RemoteDeviceId id;
@@ -78,18 +78,18 @@ public class NetconfDeviceSalProvider implements AutoCloseable {
     }
 
     public NetconfDeviceTopologyAdapter getTopologyDatastoreAdapter() {
-        checkState(topologyDatastoreAdapter != null,
-                "%s: Sal provider %s was not initialized by sal. Cannot get topology datastore adapter", id);
-        return topologyDatastoreAdapter;
+        final NetconfDeviceTopologyAdapter local = topologyDatastoreAdapter;
+        checkState(local != null,
+                "%s: Sal provider %s was not initialized by sal. Cannot get topology datastore adapter", id, this);
+        return local;
     }
 
+    @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
+            justification = "https://github.com/spotbugs/spotbugs/issues/811")
     private void resetTransactionChainForAdapaters() {
         txChain = requireNonNull(dataBroker).createTransactionChain(transactionChainListener);
-
         topologyDatastoreAdapter.setTxChain(txChain);
-
         LOG.trace("{}: Resetting TransactionChain {}", id, txChain);
-
     }
 
     @Override
@@ -117,13 +117,13 @@ public class NetconfDeviceSalProvider implements AutoCloseable {
             this.id = requireNonNull(id);
         }
 
-        public void onTopologyDeviceConnected(final SchemaContext initialCtx,
+        public void onTopologyDeviceConnected(final EffectiveModelContext initialCtx,
                 final DOMDataBroker broker, final DOMRpcService rpc,
                 final NetconfDeviceNotificationService newNotificationService) {
             onTopologyDeviceConnected(initialCtx, broker, rpc, newNotificationService, null);
         }
 
-        public synchronized void onTopologyDeviceConnected(final SchemaContext initialCtx,
+        public synchronized void onTopologyDeviceConnected(final EffectiveModelContext initialCtx,
                 final DOMDataBroker broker, final DOMRpcService rpc,
                 final NetconfDeviceNotificationService newNotificationService, final DOMActionService deviceAction) {
             requireNonNull(mountService, "Closed");