Fix Sonar Issues
authorsurya-huawei <a.u.surya@huawei.com>
Tue, 12 Sep 2017 05:37:35 +0000 (11:07 +0530)
committerSURYA A U <a.u.surya@huawei.com>
Wed, 13 Sep 2017 04:32:34 +0000 (04:32 +0000)
few major issues in sli/core module

Issue-Id: CCSDK-87
Change-Id: I1fb86f084d270906dcf61d33701da54a82f2c3a4
Signed-off-by: surya-huawei <a.u.surya@huawei.com>
sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/DME2.java
sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/SvcLogicContextList.java

index 326490d..6bdd87e 100644 (file)
@@ -124,7 +124,7 @@ public class DME2 implements SvcLogicJavaPlugin {
             sb.append("&dme2.partner=" + this.partner);
         }
         sb.append("&dme2.allowhttpcode=true");
-        return (sb.toString());
+        return sb.toString();
     }
 
     public synchronized String acquireHostName() {
index aa25fe3..32e1aeb 100644 (file)
@@ -60,7 +60,7 @@ public class SvcLogicContextList {
 
         // Initialize list
         int capacity = getCtxListLength(ctx, prefix);
-        this.list = new ArrayList<HashMap<String, String>>(capacity);
+        this.list = new ArrayList<>(capacity);
         for( int i = 0; i < capacity; i++ ) {
             this.list.add(i, new HashMap<String,String>());
         }
@@ -158,7 +158,7 @@ public class SvcLogicContextList {
 
         for( int i = 0; i < this.list.size(); i++ ) {
             for( Map.Entry<String,String> entry : this.list.get(i).entrySet() ) {
-                if( entry.getKey().equals("") ) {
+                if("".equals(entry.getKey())) {
                     ctx.setAttribute(prefix + '[' + i + ']', entry.getValue());
                 } else {
                     ctx.setAttribute(prefix + '[' + i + "]." + entry.getKey(), entry.getValue());