Fix FindBugs warnings in sal-cluster-admin and enable enforcement 00/47600/3
authorTom Pantelis <tpanteli@brocade.com>
Wed, 26 Oct 2016 11:30:26 +0000 (07:30 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Wed, 26 Oct 2016 16:31:05 +0000 (16:31 +0000)
Change-Id: I14db0675fd5e48555a61bfde0517615474a0c8c3
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-cluster-admin/pom.xml
opendaylight/md-sal/sal-cluster-admin/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java

index 14ccea2972a60e508407218cfeccc8198f33e6c4..37a20bee6b96d65409b286b84098bf5a7b8e4c9f 100644 (file)
           <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
         </configuration>
       </plugin>
           <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>findbugs-maven-plugin</artifactId>
+        <configuration>
+          <failOnError>true</failOnError>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>
     </plugins>
   </build>
 </project>
index a55eca1b8363d07f922367d13d3f6eb841cf5070..3667131a81262ba17e2d1273783c8827029e44fa 100644 (file)
@@ -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 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;
 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);
 
             returnFuture.set(newSuccessfulResult());
             LOG.info("Successfully backed up datastore to file {}", fileName);
-        } catch (Exception e) {
+        } catch (IOException | RuntimeException e) {
             onDatastoreBackupFailure(fileName, returnFuture, e);
         }
     }
             onDatastoreBackupFailure(fileName, returnFuture, e);
         }
     }