Fix Blocker/Critical sonar issues 05/13705/3
authorshashikanth <shashikanth.vh@huawei.com>
Wed, 20 Sep 2017 06:23:26 +0000 (11:53 +0530)
committerShashikanth VH <shashikanth.vh@huawei.com>
Thu, 21 Sep 2017 11:17:44 +0000 (11:17 +0000)
Fix Blocker/Critical sonar issues in aai/sparky-be module
https://sonar.onap.org/component_issues?id=org.openecomp.aai.sparky-be%3Asparky-be#resolved=false|severities=BLOCKER

Fixed NullPointerException might be thrown as 'output' is nullable here

Issue-Id:AAI-342
Change-Id: I816854cf784e9825c269110ea44c0c7ed745e946
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
src/main/java/org/openecomp/sparky/viewandinspect/services/VisualizationService.java

index 63d4e59..e3f57aa 100644 (file)
@@ -347,10 +347,9 @@ public class VisualizationService {
     try {
       output = transformer
           .generateVisualizationOutput((System.currentTimeMillis() - opStartTimeInMs), graphMeta);
-    } catch (JsonProcessingException exc) {
-      throw new ServletException("Caught an exception while generation visualization output", exc);
-    } catch (IOException exc) {
+    } catch (Exception exc) {
       LOG.error(AaiUiMsgs.FAILURE_TO_PROCESS_REQUEST, exc.getLocalizedMessage());
+      throw new ServletException("Caught an exception while generation visualization output", exc);
     }
 
     output.setInlineMessage(visContext.getInlineMessage());