config-persister-feature4-adapter: use lambdas 69/57169/2
authorStephen Kitt <skitt@redhat.com>
Tue, 16 May 2017 15:48:43 +0000 (17:48 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 16 May 2017 23:28:42 +0000 (23:28 +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: I0bf3614763eadd55e40753a02b121c103a400228
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/config/config-persister-feature4-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/FeatureServiceCustomizer.java

index 91c1a93..68ae3d3 100644 (file)
@@ -16,7 +16,6 @@ import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesListener;
 import org.apache.karaf.features.FeaturesService;
 import org.opendaylight.controller.config.persist.api.ConfigPusher;
-import org.opendaylight.controller.config.persist.storage.file.xml.FeatureListProvider;
 import org.opendaylight.controller.config.persist.storage.file.xml.XmlFileStorageAdapter;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -50,12 +49,7 @@ public class FeatureServiceCustomizer implements ServiceTrackerCustomizer<Featur
                 LOG.error("Error listing installed features", e);
             }
 
-            currentPersister.get().setFeaturesService(new FeatureListProvider() {
-                @Override
-                public Set<String> listFeatures() {
-                    return installedFeatureIds;
-                }
-            });
+            currentPersister.get().setFeaturesService(() -> installedFeatureIds);
         }
         ConfigFeaturesListener configFeaturesListener = new ConfigFeaturesListener(configPusher, featureService);
         registration = bc.registerService(FeaturesListener.class.getCanonicalName(), configFeaturesListener, null);

©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.