Simplify code using Java 8 features
[mdsal.git] / common / mdsal-common-api / src / main / java / org / opendaylight / mdsal / common / api / TransactionCommitDeadlockException.java
index b251de1021a05986c5cb7f8ce0d11c5fd30cdab9..4a215b770a275d9f1cbf39d1e965ffa6a373a1b2 100644 (file)
@@ -37,12 +37,8 @@ public class TransactionCommitDeadlockException extends TransactionCommitFailedE
     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);