Deleted redundant try catch block
authorshashikanth <shashikanth.vh@huawei.com>
Tue, 26 Sep 2017 09:26:41 +0000 (14:56 +0530)
committerShashikanth VH <shashikanth.vh@huawei.com>
Tue, 26 Sep 2017 09:32:18 +0000 (09:32 +0000)
Extract this nested try block into a separate method.
https://sonar.onap.org/component_issues?id=org.onap.ccsdk.sli.northbound%3Accsdk-sli-northbound#resolved=false|severities=MAJOR|rules=squid%3AS1141

Issue-Id: CCSDK-87
Change-Id: I989791d876b5a199f75983ba5137770f80995ef1
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java

index 0664e82..9723ed4 100644 (file)
@@ -480,20 +480,13 @@ public class SdncUebCallback implements INotificationCallback {
 
         if (transformedFile != null) {
             try {
+                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+                DocumentBuilder db = dbf.newDocumentBuilder();
 
-                try {
-
-                    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-                    DocumentBuilder db = dbf.newDocumentBuilder();
-
-                    spoolDoc = db.parse(transformedFile);
-                } catch (Exception e) {
-                    LOG.error("Caught exception trying to parse transformed XML file {}",
-                                    transformedFile.getAbsolutePath(), e);
-                }
-
+                spoolDoc = db.parse(transformedFile);
             } catch (Exception e) {
-                LOG.error("Caught exception trying to deploy file", e);
+                LOG.error("Caught exception trying to parse transformed XML file {}",
+                          transformedFile.getAbsolutePath(), e);
             }
         }