From b720f1b77fe2c96e2afb1bafed5b02724ab50e37 Mon Sep 17 00:00:00 2001 From: shashikanth Date: Tue, 26 Sep 2017 14:56:41 +0530 Subject: Deleted redundant try catch block 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 --- .../ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java index 0664e8283..9723ed4d5 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java @@ -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); } } -- cgit 1.2.3-korg