Fix (and suppress) some static code analysis warnings in blueprint
[controller.git] / opendaylight / blueprint / src / main / java / org / opendaylight / controller / blueprint / ext / DataStoreAppConfigMetadata.java
index 15e696225af3fb4a5c963ec40192fe375736a412..bc4ebe2a64ea9ff3bf58e71e0dcba7fc86e5e2a1 100644 (file)
@@ -150,12 +150,13 @@ public class DataStoreAppConfigMetadata extends AbstractDependentComponentFactor
         DataTreeIdentifier<DataObject> dataTreeId = new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
                 bindingContext.appConfigPath);
         appConfigChangeListenerReg = dataBroker.registerDataTreeChangeListener(dataTreeId,
-                (ClusteredDataTreeChangeListener<DataObject>) changes -> onAppConfigChanged(changes));
+                (ClusteredDataTreeChangeListener<DataObject>) this::onAppConfigChanged);
 
         readInitialAppConfig(dataBroker);
     }
 
     private void readInitialAppConfig(final DataBroker dataBroker) {
+        @SuppressWarnings("resource") // it's closed in the callback
         final ReadOnlyTransaction readOnlyTx = dataBroker.newReadOnlyTransaction();
         CheckedFuture<Optional<DataObject>, ReadFailedException> future = readOnlyTx.read(
                 LogicalDatastoreType.CONFIGURATION, bindingContext.appConfigPath);