Await.result() is throwing Exceptions we need to catch, raising
the ire of SpotBugs. Suppress that.
Change-Id: I1a880c86a8ab1759c5741dd27c8341d89452c7e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
32de58ddec79025c40342566a93fb8bf52077334)
import akka.util.Timeout;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import akka.util.Timeout;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collection;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.Collection;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
@VisibleForTesting
@SuppressWarnings("checkstyle:IllegalCatch")
@VisibleForTesting
@SuppressWarnings("checkstyle:IllegalCatch")
+ @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Akka's Await.result() API contract")
DataTree getLocalEntityOwnershipShardDataTree() {
if (localEntityOwnershipShardDataTree == null) {
try {
DataTree getLocalEntityOwnershipShardDataTree() {
if (localEntityOwnershipShardDataTree == null) {
try {
import akka.pattern.Patterns;
import akka.util.Timeout;
import com.google.common.base.Throwables;
import akka.pattern.Patterns;
import akka.util.Timeout;
import com.google.common.base.Throwables;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
}
@SuppressWarnings("checkstyle:IllegalCatch")
}
@SuppressWarnings("checkstyle:IllegalCatch")
- private static List<DataTreeListenerInfo> getListenerActorsInfo(Collection<ActorSelection> actors) {
+ @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Akka's Await.result() API contract")
+ private static List<DataTreeListenerInfo> getListenerActorsInfo(final Collection<ActorSelection> actors) {
final Timeout timeout = new Timeout(20, TimeUnit.SECONDS);
final List<Future<Object>> futureList = new ArrayList<>(actors.size());
for (ActorSelection actor: actors) {
final Timeout timeout = new Timeout(20, TimeUnit.SECONDS);
final List<Future<Object>> futureList = new ArrayList<>(actors.size());
for (ActorSelection actor: actors) {