Fix Blocker/Critical sonar issues 89/11089/1
authorshashikanth <shashikanth.vh@huawei.com>
Fri, 8 Sep 2017 13:16:42 +0000 (18:46 +0530)
committershashikanth <shashikanth.vh@huawei.com>
Fri, 8 Sep 2017 13:16:53 +0000 (18:46 +0530)
Fix Blocker/Critical sonar issues in vnfapi module
https://sonar.onap.org/component_issues?id=org.onap.ccsdk.sli.plugins%3Accsdk-sli-plugins#resolved=false|severities=BLOCKER

Issue-Id: CCSDK-67
Change-Id: I6393ebbaf4bd6dc2dea4a325f2a7d106ba20dd81
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java

index 7ddeb42..1329574 100644 (file)
@@ -627,7 +627,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
     }
 
     public void postMessageOnUeb(Map<String, String> paramMap, SvcLogicContext ctx) throws SvcLogicException {
-        HttpResponse r = null;
+        HttpResponse r;
         try {
             UebParam p = getUebParameters(paramMap);
 
@@ -659,7 +659,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
             setResponseStatus(ctx, prefix, r);
         }
 
-        if (r != null && r.code >= 300)
+        if (r.code >= 300)
             throw new SvcLogicException(String.valueOf(r.code) + ": " + r.message);
     }