From 02fa7b3c5a6726902ff76bcce50a1b239969a8e2 Mon Sep 17 00:00:00 2001 From: Taka Date: Wed, 20 Dec 2017 13:07:21 -0500 Subject: Fix sonar issues for APPC Change-Id: I386f6794215eb69b8547fa06193ad78f951b327b Issue-ID: APPC-323 Signed-off-by: Taka --- .../appc/adapter/ansible/model/AnsibleResult.java | 36 +++++++++++----------- .../adapter/ansible/model/AnsibleResultCodes.java | 10 +++--- .../ansible/model/AnsibleServerEmulator.java | 3 -- 3 files changed, 23 insertions(+), 26 deletions(-) (limited to 'appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src') diff --git a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResult.java b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResult.java index a4bbcbef8..6b7369cfb 100644 --- a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResult.java +++ b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResult.java @@ -27,59 +27,59 @@ package org.onap.appc.adapter.ansible.model; /* Simple class to store code and message returned by POST/GET to an Ansible Server */ public class AnsibleResult{ - private int StatusCode; - private String StatusMessage; - private String Results; + private int statusCode; + private String statusMessage; + private String results; public AnsibleResult(){ - StatusCode = -1; - StatusMessage = "UNKNOWN"; - Results = "UNKNOWN"; + statusCode = -1; + statusMessage = "UNKNOWN"; + results = "UNKNOWN"; } // constructor public AnsibleResult(int code, String message, String result){ - StatusCode = code; - StatusMessage = message; - Results = result; + statusCode = code; + statusMessage = message; + results = result; } //************************************************* // Various set methods public void setStatusCode(int code){ - this.StatusCode = code; + this.statusCode = code; } public void setStatusMessage(String message){ - this.StatusMessage = message; + this.statusMessage = message; } public void setResults(String results){ - this.Results = results; + this.results = results; } void set(int code, String message, String results){ - this.StatusCode = code; - this.StatusMessage = message; - this.Results = results; + this.statusCode = code; + this.statusMessage = message; + this.results = results; } //********************************************* // Various get methods public int getStatusCode(){ - return this.StatusCode; + return this.statusCode; } public String getStatusMessage(){ - return this.StatusMessage; + return this.statusMessage; } public String getResults(){ - return this.Results; + return this.results; } diff --git a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResultCodes.java b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResultCodes.java index 986ad3e6a..5d44f6dae 100644 --- a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResultCodes.java +++ b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResultCodes.java @@ -53,9 +53,9 @@ public enum AnsibleResultCodes{ INITRESPONSE(0), FINALRESPONSE(1); - private final Set InitCodes = new HashSet(Arrays.asList(100, 101)); - private final Set FinalCodes = new HashSet(Arrays.asList(200, 500)); - private final ArrayList>CodeSets = new ArrayList>(Arrays.asList(InitCodes, FinalCodes)); + private final Set initCodes = new HashSet(Arrays.asList(100, 101)); + private final Set finalCodes = new HashSet(Arrays.asList(200, 500)); + private final ArrayList>codeSets = new ArrayList>(Arrays.asList(initCodes, finalCodes)); private final Set MessageSet = new HashSet(Arrays.asList("PENDING", "FINISHED", "TERMINATED")); @@ -72,7 +72,7 @@ public enum AnsibleResultCodes{ public boolean checkValidCode(int Type, int Code){ - SetCodeSet = CodeSets.get(Type); + SetCodeSet = codeSets.get(Type); if (CodeSet.contains(Code)){ return true; } @@ -83,7 +83,7 @@ public enum AnsibleResultCodes{ public String getValidCodes(int Type){ - SetCodeSet = CodeSets.get(Type); + SetCodeSet = codeSets.get(Type); Iterator iter = CodeSet.iterator(); String ValidCodes = "[ "; diff --git a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java index c430743ad..7b7d95580 100644 --- a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java +++ b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java @@ -35,12 +35,9 @@ package org.onap.appc.adapter.ansible.model; import java.util.*; import java.util.regex.Pattern; import java.util.regex.Matcher; -import com.google.common.base.Strings; import org.json.JSONObject; -import org.json.JSONArray; import org.json.JSONException; -import org.onap.appc.exceptions.APPCException; import org.onap.appc.adapter.ansible.model.AnsibleResult; public class AnsibleServerEmulator { -- cgit 1.2.3-korg