sal-common-api: use lambdas 83/57183/2
authorStephen Kitt <skitt@redhat.com>
Tue, 16 May 2017 15:51:16 +0000 (17:51 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 16 May 2017 23:19:36 +0000 (23:19 +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: Id73e97d756b267aa70e8648f41aaa4e40df50fda
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionCommitDeadlockException.java

index 50952ea..99a92e5 100644 (file)
@@ -30,12 +30,8 @@ public class TransactionCommitDeadlockException extends TransactionCommitFailedE
             "result must be obtained asynchronously, e.g. via Futures#addCallback, to avoid deadlock.";
     private static final RpcError DEADLOCK_RPCERROR = RpcResultBuilder.newError(ErrorType.APPLICATION, "lock-denied", DEADLOCK_MESSAGE);
 
-    public static final Supplier<Exception> DEADLOCK_EXCEPTION_SUPPLIER = new Supplier<Exception>() {
-        @Override
-        public Exception get() {
-            return new TransactionCommitDeadlockException(DEADLOCK_MESSAGE, DEADLOCK_RPCERROR);
-        }
-    };
+    public static final Supplier<Exception> DEADLOCK_EXCEPTION_SUPPLIER =
+            () -> new TransactionCommitDeadlockException(DEADLOCK_MESSAGE, DEADLOCK_RPCERROR);
 
     public TransactionCommitDeadlockException(final String message, final RpcError... errors) {
         super(message, errors);

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