From c1e3bd78655024f8954772f536d1f2eab5cf4b6b Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Fri, 11 Dec 2020 15:43:24 +0100 Subject: [PATCH] Fix checkstyle Upgraded checkstyle is catching a few errors, fix them up. Change-Id: Icae05de3e623523025f0b9f2a1635b9c923a49ca Signed-off-by: Robert Varga --- .../impl/NetconfNotificationManager.java | 16 +++++++--------- .../impl/OperationalDatastoreListenerTest.java | 4 ++-- .../impl/RemoteDeviceConnectorImpl.java | 11 +++++------ 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/impl/NetconfNotificationManager.java b/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/impl/NetconfNotificationManager.java index 63ea9be8c7..60221039d0 100644 --- a/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/impl/NetconfNotificationManager.java +++ b/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/impl/NetconfNotificationManager.java @@ -115,8 +115,7 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, LOG.trace("Notification listener registered for stream: {}", stream); - final GenericNotificationListenerReg genericNotificationListenerReg = - new GenericNotificationListenerReg(listener) { + final GenericNotificationListenerReg reg = new GenericNotificationListenerReg(listener) { @Override public void close() { synchronized (NetconfNotificationManager.this) { @@ -126,8 +125,8 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, } }; - notificationListeners.put(BASE_STREAM_NAME, genericNotificationListenerReg); - return genericNotificationListenerReg; + notificationListeners.put(BASE_STREAM_NAME, reg); + return reg; } @Override @@ -193,8 +192,7 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, availableStreams.add(streamName); - final GenericNotificationPublisherReg genericNotificationPublisherReg = - new GenericNotificationPublisherReg(this, streamName) { + final GenericNotificationPublisherReg reg = new GenericNotificationPublisherReg(this, streamName) { @Override public void close() { synchronized (NetconfNotificationManager.this) { @@ -203,10 +201,10 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, } }; - notificationPublishers.add(genericNotificationPublisherReg); + notificationPublishers.add(reg); notifyStreamAdded(stream); - return genericNotificationPublisherReg; + return reg; } @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", @@ -339,7 +337,7 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, } @Override - public void onYangLibraryUpdate(YangLibraryUpdate yangLibraryUpdate) { + public void onYangLibraryUpdate(final YangLibraryUpdate yangLibraryUpdate) { baseRegistration.onNotification(BASE_STREAM_NAME, transformUtil.transform(yangLibraryUpdate, YANG_LIBRARY_UPDATE_PATH)); } diff --git a/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/netconf/mdsal/notification/impl/OperationalDatastoreListenerTest.java b/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/netconf/mdsal/notification/impl/OperationalDatastoreListenerTest.java index ee7fd927f1..ee4cdda61f 100644 --- a/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/netconf/mdsal/notification/impl/OperationalDatastoreListenerTest.java +++ b/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/netconf/mdsal/notification/impl/OperationalDatastoreListenerTest.java @@ -37,10 +37,10 @@ public class OperationalDatastoreListenerTest { final DataTreeIdentifier testId = DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, instanceIdentifier); - final OperationalDatastoreListener op = - new OperationalDatastoreListener(instanceIdentifier) { + final var op = new OperationalDatastoreListener<>(instanceIdentifier) { @Override public void onDataTreeChanged(final Collection> collection) { + // no-op } }; doReturn(null).when(dataBroker).registerDataTreeChangeListener(any(), any()); diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java index 2945267306..244f39fe09 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java @@ -223,12 +223,11 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector { LOG.info("{}: Concurrent rpc limit is smaller than 1, no limit will be enforced.", remoteDeviceId); } - NetconfDeviceCommunicator netconfDeviceCommunicator = - userCapabilities.isPresent() ? new NetconfDeviceCommunicator(remoteDeviceId, device, - new UserPreferences(userCapabilities.get(), - node.getYangModuleCapabilities() == null ? false : node.getYangModuleCapabilities().isOverride(), - node.getNonModuleCapabilities() == null ? false : node.getNonModuleCapabilities().isOverride()), - rpcMessageLimit) + NetconfDeviceCommunicator netconfDeviceCommunicator = userCapabilities.isPresent() + ? new NetconfDeviceCommunicator(remoteDeviceId, device, new UserPreferences(userCapabilities.get(), + node.getYangModuleCapabilities() == null ? false : node.getYangModuleCapabilities().isOverride(), + node.getNonModuleCapabilities() == null ? false : node.getNonModuleCapabilities().isOverride()), + rpcMessageLimit) : new NetconfDeviceCommunicator(remoteDeviceId, device, rpcMessageLimit); if (salFacade instanceof KeepaliveSalFacade) { -- 2.36.6