Fix checkstyle 17/94217/3
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 11 Dec 2020 14:43:24 +0000 (15:43 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 15 Dec 2020 19:10:08 +0000 (20:10 +0100)
Upgraded checkstyle is catching a few errors, fix them up.

Change-Id: Icae05de3e623523025f0b9f2a1635b9c923a49ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/impl/NetconfNotificationManager.java
netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/netconf/mdsal/notification/impl/OperationalDatastoreListenerTest.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java

index 63ea9be8c70dab5c4b30057d09dcf57be248110f..60221039d09df7d79a14899517f6dce440f872cf 100644 (file)
@@ -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));
         }
index ee7fd927f17e97c2c8793c15d79a5c85b90bb557..ee4cdda61f54e50f1203aea75bfa5c2912789e32 100644 (file)
@@ -37,10 +37,10 @@ public class OperationalDatastoreListenerTest {
         final DataTreeIdentifier<DataObject> testId =
                 DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, instanceIdentifier);
 
-        final OperationalDatastoreListener<DataObject> op =
-                new OperationalDatastoreListener<DataObject>(instanceIdentifier) {
+        final var op = new OperationalDatastoreListener<>(instanceIdentifier) {
             @Override
             public void onDataTreeChanged(final Collection<DataTreeModification<DataObject>> collection) {
+                // no-op
             }
         };
         doReturn(null).when(dataBroker).registerDataTreeChangeListener(any(), any());
index 2945267306713b42ea4cafa2e34c070363f955b1..244f39fe09bfc39b2fe848a3a21ecebf902b94d4 100644 (file)
@@ -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) {