config-manager: use lambdas 65/57165/2
authorStephen Kitt <skitt@redhat.com>
Tue, 16 May 2017 15:48:27 +0000 (17:48 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 16 May 2017 23:18:52 +0000 (23:18 +0000)
This series of patches uses lambdas instead of anonymous classes for
functional interfaces when possible. Lambdas are replaced with method
references when appropriate.

Change-Id: I7a6f08ed63c251a5a2097321e17ab734bab0c73c
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java

index 369e7ed..dd6ccde 100644 (file)
@@ -47,7 +47,6 @@ import org.opendaylight.controller.config.manager.impl.factoriesresolver.ModuleF
 import org.opendaylight.controller.config.manager.impl.jmx.BaseJMXRegistrator;
 import org.opendaylight.controller.config.manager.impl.jmx.ModuleJMXRegistrator;
 import org.opendaylight.controller.config.manager.impl.jmx.RootRuntimeBeanRegistratorImpl;
-import org.opendaylight.controller.config.manager.impl.jmx.TransactionJMXRegistrator;
 import org.opendaylight.controller.config.manager.impl.osgi.BeanToOsgiServiceManager;
 import org.opendaylight.controller.config.manager.impl.osgi.BeanToOsgiServiceManager.OsgiRegistration;
 import org.opendaylight.controller.config.manager.impl.osgi.mapping.BindingContextProvider;
@@ -196,12 +195,8 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
         versionCounter++;
         final String transactionName = "ConfigTransaction-" + version + "-" + versionCounter;
 
-        TransactionJMXRegistratorFactory factory = new TransactionJMXRegistratorFactory() {
-            @Override
-            public TransactionJMXRegistrator create() {
-                return baseJMXRegistrator.createTransactionJMXRegistrator(transactionName);
-            }
-        };
+        TransactionJMXRegistratorFactory factory =
+                () -> baseJMXRegistrator.createTransactionJMXRegistrator(transactionName);
 
         Map<String, Map.Entry<ModuleFactory, BundleContext>> allCurrentFactories = new HashMap<>(
                 resolver.getAllFactories());

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.