From: Tom Pantelis Date: Wed, 26 Oct 2016 11:30:26 +0000 (-0400) Subject: Fix FindBugs warnings in sal-cluster-admin and enable enforcement X-Git-Tag: release/carbon~418 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=78efa22e4e7b70a468fcbaf120f8613598c36b5b;ds=sidebyside Fix FindBugs warnings in sal-cluster-admin and enable enforcement Change-Id: I14db0675fd5e48555a61bfde0517615474a0c8c3 Signed-off-by: Tom Pantelis --- diff --git a/opendaylight/md-sal/sal-cluster-admin/pom.xml b/opendaylight/md-sal/sal-cluster-admin/pom.xml index 14ccea2972..37a20bee6b 100644 --- a/opendaylight/md-sal/sal-cluster-admin/pom.xml +++ b/opendaylight/md-sal/sal-cluster-admin/pom.xml @@ -181,6 +181,13 @@ checkstyle.violationSeverity=error + + org.codehaus.mojo + findbugs-maven-plugin + + true + + diff --git a/opendaylight/md-sal/sal-cluster-admin/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java b/opendaylight/md-sal/sal-cluster-admin/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java index a55eca1b83..3667131a81 100644 --- a/opendaylight/md-sal/sal-cluster-admin/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java +++ b/opendaylight/md-sal/sal-cluster-admin/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java @@ -20,6 +20,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; import java.io.FileOutputStream; +import java.io.IOException; import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; import java.util.HashMap; @@ -393,7 +394,7 @@ public class ClusterAdminRpcService implements ClusterAdminService { returnFuture.set(newSuccessfulResult()); LOG.info("Successfully backed up datastore to file {}", fileName); - } catch (Exception e) { + } catch (IOException | RuntimeException e) { onDatastoreBackupFailure(fileName, returnFuture, e); } }