These are pointed out by upgraded spotbugs, fix them up.
Change-Id: I520c8be21d69c73c0ca9b51d15e63df158fd242a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
commit(tx, device.key());
}
commit(tx, device.key());
}
- private static void commit(WriteTransaction tx, DeviceKey device) {
+ private static void commit(final WriteTransaction tx, final DeviceKey device) {
tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(CommitInfo result) {
+ public void onSuccess(final CommitInfo result) {
LOG.debug("Device {} committed", device);
}
@Override
LOG.debug("Device {} committed", device);
}
@Override
- public void onFailure(Throwable cause) {
+ public void onFailure(final Throwable cause) {
LOG.warn("Failed to commit device {}", device, cause);
}
}, MoreExecutors.directExecutor());
LOG.warn("Failed to commit device {}", device, cause);
}
}, MoreExecutors.directExecutor());
try {
return devicesFuture.get().orElse(null);
} catch (ExecutionException | InterruptedException e) {
try {
return devicesFuture.get().orElse(null);
} catch (ExecutionException | InterruptedException e) {
- LOG.error("Error trying to read the whitelist devices: {}", e);
+ LOG.error("Error trying to read the whitelist devices", e);
readAndUpdateStatus(confDevice);
}
} catch (ExecutionException | InterruptedException e) {
readAndUpdateStatus(confDevice);
}
} catch (ExecutionException | InterruptedException e) {
- LOG.error("Error trying to read the whitelist devices: {}", e);
+ LOG.error("Error trying to read the whitelist devices", e);
opTx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
opTx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(CommitInfo result) {
+ public void onSuccess(final CommitInfo result) {
LOG.debug("Device deletions committed");
}
@Override
LOG.debug("Device deletions committed");
}
@Override
- public void onFailure(Throwable cause) {
+ public void onFailure(final Throwable cause) {
LOG.warn("Failed to commit device deletions", cause);
}
}, MoreExecutors.directExecutor());
LOG.warn("Failed to commit device deletions", cause);
}
}, MoreExecutors.directExecutor());
return devicesFuture.get().map(AllowedDevices::getDevice).orElse(Collections.emptyList());
}
return devicesFuture.get().map(AllowedDevices::getDevice).orElse(Collections.emptyList());
}
- private void readAndUpdateStatus(Device cfgDevice) throws InterruptedException, ExecutionException {
+ private void readAndUpdateStatus(final Device cfgDevice) throws InterruptedException, ExecutionException {
InstanceIdentifier<Device> deviceIID = InstanceIdentifier.create(NetconfCallhomeServer.class)
.child(AllowedDevices.class).child(Device.class, new DeviceKey(cfgDevice.getUniqueId()));
InstanceIdentifier<Device> deviceIID = InstanceIdentifier.create(NetconfCallhomeServer.class)
.child(AllowedDevices.class).child(Device.class, new DeviceKey(cfgDevice.getUniqueId()));
.setUniqueId(cfgDevice.getUniqueId()).build());
tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
.setUniqueId(cfgDevice.getUniqueId()).build());
tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(CommitInfo result) {
+ public void onSuccess(final CommitInfo result) {
LOG.debug("Device {} status update committed", cfgDevice.key());
}
@Override
LOG.debug("Device {} status update committed", cfgDevice.key());
}
@Override
- public void onFailure(Throwable cause) {
+ public void onFailure(final Throwable cause) {
LOG.warn("Failed to commit device {} status update", cfgDevice.key(), cause);
}
}, MoreExecutors.directExecutor());
LOG.warn("Failed to commit device {} status update", cfgDevice.key(), cause);
}
}, MoreExecutors.directExecutor());
// We do not support actions in clustered topology yet
if (domActionService != null) {
LOG.warn("{}: YANG 1.1 actions are not supported in clustered netconf topology, "
// We do not support actions in clustered topology yet
if (domActionService != null) {
LOG.warn("{}: YANG 1.1 actions are not supported in clustered netconf topology, "
- + "DOMActionService will not be exposed for the device");
+ + "DOMActionService will not be exposed for the device", id);
}
onDeviceConnected(remoteSchemaContext, sessionPreferences, domRpcService);
}
onDeviceConnected(remoteSchemaContext, sessionPreferences, domRpcService);
@Override
public void onComplete(final Throwable failure, final Object success) {
if (failure != null) {
@Override
public void onComplete(final Throwable failure, final Object success) {
if (failure != null) {
- LOG.error("Failed to refresh master actor data: {}", failure);
+ LOG.error("Failed to refresh master actor data", failure);
return;
}
remoteDeviceConnector.startRemoteDeviceConnection(newMasterSalFacade());
return;
}
remoteDeviceConnector.startRemoteDeviceConnection(newMasterSalFacade());
@Override
public void onFailure(final Throwable throwable) {
@Override
public void onFailure(final Throwable throwable) {
- LOG.error("Unable to initialize netconf-topology, {}", throwable);
+ LOG.error("Unable to initialize netconf-topology", throwable);
}
}, MoreExecutors.directExecutor());
}
}, MoreExecutors.directExecutor());
@Override
public void onFailure(final Throwable throwable) {
@Override
public void onFailure(final Throwable throwable) {
- LOG.error("Unable to initialize netconf-topology, {}", throwable);
+ LOG.error("Unable to initialize netconf-topology", throwable);
}
}, MoreExecutors.directExecutor());
}
}, MoreExecutors.directExecutor());