Fix checkstyle reported by odlparent-3.0.0
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / jmx / mbeans / shard / OnDemandShardStateCache.java
index 230da28e9a660a12894fc81de27fe04b89c0f212..ba00d0b7a5acee32b0c4db1e9b58e764e8d4bfa7 100644 (file)
@@ -12,12 +12,8 @@ import akka.pattern.Patterns;
 import akka.util.Timeout;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Stopwatch;
-import com.google.common.base.Throwables;
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
-import com.google.common.util.concurrent.ExecutionError;
-import com.google.common.util.concurrent.UncheckedExecutionException;
-import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import org.opendaylight.controller.cluster.datastore.messages.OnDemandShardState;
 import org.opendaylight.controller.cluster.raft.client.messages.GetOnDemandRaftState;
@@ -36,7 +32,7 @@ class OnDemandShardStateCache {
     private final String shardName;
     private volatile String stateRetrievalTime;
 
-    OnDemandShardStateCache(String shardName, ActorRef shardActor) {
+    OnDemandShardStateCache(final String shardName, final ActorRef shardActor) {
         this.shardName = Preconditions.checkNotNull(shardName);
         this.shardActor = shardActor;
     }
@@ -46,16 +42,7 @@ class OnDemandShardStateCache {
             return OnDemandShardState.newBuilder().build();
         }
 
-        try {
-            return ONDEMAND_SHARD_STATE_CACHE.get(shardName, this::retrieveState);
-        } catch (ExecutionException | UncheckedExecutionException | ExecutionError e) {
-            if (e.getCause() != null) {
-                Throwables.propagateIfPossible(e.getCause(), Exception.class);
-                throw new RuntimeException("unexpected", e.getCause());
-            }
-
-            throw e;
-        }
+        return ONDEMAND_SHARD_STATE_CACHE.get(shardName, this::retrieveState);
     }
 
     String getStatRetrievaelTime() {