Enable spotbugs in mdsal-{common,binding,dom}-api
[mdsal.git] / common / mdsal-common-api / src / main / java / org / opendaylight / mdsal / common / api / TransactionCommitDeadlockException.java
index b251de1021a05986c5cb7f8ce0d11c5fd30cdab9..33e6d1c3c6e7e4907d31a596302def6c6ac51fec 100644 (file)
@@ -5,18 +5,13 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.mdsal.common.api;
 
-import com.google.common.base.Supplier;
-
+import java.util.function.Supplier;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
-
-
-
 /**
  * A type of TransactionCommitFailedException that indicates a situation that would result in a
  * threading deadlock. This can occur if a caller that submits a write transaction tries to perform
@@ -37,12 +32,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);