sal-common-impl: use lambdas 84/57184/2
authorStephen Kitt <skitt@redhat.com>
Tue, 16 May 2017 15:51:21 +0000 (17:51 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 16 May 2017 23:25:39 +0000 (23:25 +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: Ideb92bfb1504831895558607a7591eb8c00bc570
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/service/AbstractDataTransaction.java

index f83a778..b9df496 100644 (file)
@@ -25,11 +25,6 @@ public abstract class AbstractDataTransaction {
             Futures.immediateFuture(RpcResultBuilder.success(TransactionStatus.COMMITED).build());
 
     public static ListenableFuture<RpcResult<TransactionStatus>> convertToLegacyCommitFuture(final CheckedFuture<Void,TransactionCommitFailedException> from) {
-        return Futures.transform(from, new AsyncFunction<Void, RpcResult<TransactionStatus>>() {
-            @Override
-            public ListenableFuture<RpcResult<TransactionStatus>> apply(final Void input) {
-                return SUCCESS_FUTURE;
-            }
-        });
+        return Futures.transform(from, (AsyncFunction<Void, RpcResult<TransactionStatus>>) input -> SUCCESS_FUTURE);
     }
 }

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