Fix some of Java 8 IDE migration warnings 18/78418/4
authorJakub Morvay <jmorvay@frinx.io>
Tue, 4 Dec 2018 12:25:55 +0000 (13:25 +0100)
committerJakub Morvay <jmorvay@frinx.io>
Tue, 4 Dec 2018 15:45:03 +0000 (16:45 +0100)
- anonymous type can be replaced with lambda
- anonymous type can be replaced with method reference
- statement lambda can be replaced with expression lambda

Change-Id: Ie852df32bf6590e322655e8c983672914a139028
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
netconf/netconf-ssh/src/test/java/org/opendaylight/netconf/netty/ProxyServer.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java
netconf/netconf-util/src/test/java/org/opendaylight/netconf/util/CloseableUtilTest.java

index b465e381f2be3d862a59ba9dd1ce6353065205a0..9f471c4d562ccfc9488338cb6e7dd8de6cb83998 100644 (file)
@@ -69,12 +69,7 @@ public class ProxyServer implements Runnable {
     }
 
     public static void main(String[] args) {
-        ProxyHandlerFactory proxyHandlerFactory = new ProxyHandlerFactory() {
-            @Override
-            public ChannelHandler create(EventLoopGroup bossGroup, LocalAddress localAddress) {
-                return new ProxyServerHandler(bossGroup, localAddress);
-            }
-        };
+        ProxyHandlerFactory proxyHandlerFactory = ProxyServerHandler::new;
         start(proxyHandlerFactory);
     }
 
index 301cd4c7b4fedd2311ee3981633a9f1357820631..94e8f4b2f70cecc9127c64c47b542c3adf14c3c3 100644 (file)
@@ -659,9 +659,8 @@ public class MountPointEndToEndTest {
     }
 
     private DOMMountPoint awaitMountPoint(final DOMMountPointService mountPointService) {
-        await().atMost(5, TimeUnit.SECONDS).until(() -> {
-            return mountPointService.getMountPoint(yangNodeInstanceId).isPresent();
-        });
+        await().atMost(5, TimeUnit.SECONDS).until(() ->
+                mountPointService.getMountPoint(yangNodeInstanceId).isPresent());
 
         return mountPointService.getMountPoint(yangNodeInstanceId).get();
     }
index 907b2b45058c8dd0352e22d5251ee265dda7e3e7..43754e9ec69653e6f4d37c5d4dd5587e0731af97 100644 (file)
@@ -21,11 +21,8 @@ public class CloseableUtilTest {
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Test
     public void testCloseAllFail() throws Exception {
-        final AutoCloseable failingCloseable = new AutoCloseable() {
-            @Override
-            public void close() throws Exception {
-                throw new RuntimeException("testing failing close");
-            }
+        final AutoCloseable failingCloseable = () -> {
+            throw new RuntimeException("testing failing close");
         };
 
         try {