From c3c435eb583ca80e3626a6811a0dce3ac7bd7411 Mon Sep 17 00:00:00 2001 From: Rupinder Date: Thu, 2 Apr 2020 12:51:23 +0530 Subject: removed code smells Reduced the code smells Issue-ID: CCSDK-2232 Change-Id: I30eec021ba50f28dc1df2fd554c4e349c4a76dd6 Signed-off-by: Rupinder --- .../main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/Resource.java | 4 +++- .../org/onap/ccsdk/sli/adaptors/util/expr/ExpressionEvaluator.java | 3 ++- .../src/main/java/org/onap/ccsdk/sli/adaptors/util/str/StrUtil.java | 3 ++- .../ccsdk/sli/adaptors/saltstack/model/SaltstackMessageParser.java | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/Resource.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/Resource.java index 4b0c82f9..6b764a7e 100644 --- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/Resource.java +++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/Resource.java @@ -24,7 +24,9 @@ package org.onap.ccsdk.sli.adaptors.rm.dao.jdbc; public class Resource { public long id; - public String assetId, name, type; + public String assetId; + public String name; + public String type; public long ltUsed; public String llLabel; public int llReferenceCount; diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/expr/ExpressionEvaluator.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/expr/ExpressionEvaluator.java index 8ba454bf..8092a751 100644 --- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/expr/ExpressionEvaluator.java +++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/expr/ExpressionEvaluator.java @@ -193,7 +193,8 @@ public class ExpressionEvaluator { int opl = op.length(); int sl = s.length(); String delimiters = " \0\t\r\n()"; - int pcount = 0, qcount = 0; + int pcount = 0; + int qcount = 0; for (int i = 0; i < sl; i++) { char c = s.charAt(i); if (c == '(' && qcount == 0) { diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/str/StrUtil.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/str/StrUtil.java index ef889f0d..126ec94e 100644 --- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/str/StrUtil.java +++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/str/StrUtil.java @@ -215,7 +215,8 @@ public class StrUtil { for (String s : str) { try { int i1 = s.indexOf('-'); - int start, end; + int start; + int end; if (i1 > 0) { String s1 = s.substring(0, i1); String s2 = s.substring(i1 + 1); diff --git a/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/SaltstackMessageParser.java b/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/SaltstackMessageParser.java index 50d08e23..3bb401ad 100644 --- a/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/SaltstackMessageParser.java +++ b/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/model/SaltstackMessageParser.java @@ -307,7 +307,8 @@ public class SaltstackMessageParser { public SaltstackResult parseResponse(SvcLogicContext ctx, String pfx, SaltstackResult saltstackResult, boolean slsExec) throws IOException { int code = saltstackResult.getStatusCode(); - boolean executionStatus = true, retCodeFound = false; + boolean executionStatus = true; + boolean retCodeFound = false; if (code != SaltstackResultCodes.SUCCESS.getValue()) { return saltstackResult; } -- cgit 1.2.3-korg