aboutsummaryrefslogtreecommitdiffstats
path: root/profiles/command/src/main/java
diff options
context:
space:
mode:
authorjitendra007 <jitendra.sharma1@huawei.com>2020-06-18 16:25:39 +0530
committerpriyanka.akhade <priyanka.akhade@huawei.com>2020-07-09 13:06:31 +0530
commit5f23e02caa5ab128a4c01866dec91eaea8dc7cee (patch)
treeca3c4f31dc56ce64aa9c0165b8cac4dab8e70b7c /profiles/command/src/main/java
parentc3391bef9e04c2ad38ed96bd28a5c43ab6d961de (diff)
Fixed sonarcloud issues
Issue-ID: CLI-270 Signed-off-by: jitendra007 <jitendra.sharma1@huawei.com> Change-Id: Ibb52afb2fe8fe7c9be4299d1a1cb1e3d32ab0eca
Diffstat (limited to 'profiles/command/src/main/java')
-rw-r--r--profiles/command/src/main/java/org/onap/cli/fw/cmd/cmd/OpenCommandShellCmd.java16
-rw-r--r--profiles/command/src/main/java/org/onap/cli/fw/cmd/schema/OnapCommandSchemaCmdLoader.java1
2 files changed, 9 insertions, 8 deletions
diff --git a/profiles/command/src/main/java/org/onap/cli/fw/cmd/cmd/OpenCommandShellCmd.java b/profiles/command/src/main/java/org/onap/cli/fw/cmd/cmd/OpenCommandShellCmd.java
index dd2c26cd..3bb2606a 100644
--- a/profiles/command/src/main/java/org/onap/cli/fw/cmd/cmd/OpenCommandShellCmd.java
+++ b/profiles/command/src/main/java/org/onap/cli/fw/cmd/cmd/OpenCommandShellCmd.java
@@ -163,32 +163,32 @@ public class OpenCommandShellCmd extends OnapCommand {
//Process command
String []cmd = commandLine.toArray(new String []{});
String cwd = this.getWd();
- List <String> envs = new ArrayList<>();
+ List <String> envList = new ArrayList<>();
//add current process environments to sub process
for (Map.Entry<String, String> env: System.getenv().entrySet()) { //NOSONAR
- envs.add(env.getKey() + "=" + env.getValue());
+ envList.add(env.getKey() + "=" + env.getValue());
}
//add oclip specific environment variables
if (this.getExecutionContext() != null) {
- envs.add("OPEN_CLI_REQUEST_ID=" + this.getExecutionContext().getRequestId());
+ envList.add("OPEN_CLI_REQUEST_ID=" + this.getExecutionContext().getRequestId());
if (this.getExecutionContext().getProfile() != null) {
- envs.add("OPEN_CLI_PROFILE=" + this.getExecutionContext().getProfile());
+ envList.add("OPEN_CLI_PROFILE=" + this.getExecutionContext().getProfile());
}
if (OnapCommandRegistrar.getRegistrar().getHost() != null) {
- envs.add("OPEN_CLI_RPC_HOST=" + OnapCommandRegistrar.getRegistrar().getHost());
- envs.add("OPEN_CLI_RPC_PORT=" + OnapCommandRegistrar.getRegistrar().getPort());
+ envList.add("OPEN_CLI_RPC_HOST=" + OnapCommandRegistrar.getRegistrar().getHost());
+ envList.add("OPEN_CLI_RPC_PORT=" + OnapCommandRegistrar.getRegistrar().getPort());
}
}
for (String env: this.getEnvs().keySet()) {
- envs.add(env + "=" + this.getEnvs().get(env));
+ envList.add(env + "=" + this.getEnvs().get(env));
}
ProcessRunner pr = new ProcessRunner(
cmd,
- (!envs.isEmpty()) ? envs.toArray(new String []{}) : null,
+ (!envList.isEmpty()) ? envList.toArray(new String []{}) : null,
cwd);
FileOutputStream stdoutStream = null;
FileOutputStream stderrStream = null;
diff --git a/profiles/command/src/main/java/org/onap/cli/fw/cmd/schema/OnapCommandSchemaCmdLoader.java b/profiles/command/src/main/java/org/onap/cli/fw/cmd/schema/OnapCommandSchemaCmdLoader.java
index 1eeadecc..2d408065 100644
--- a/profiles/command/src/main/java/org/onap/cli/fw/cmd/schema/OnapCommandSchemaCmdLoader.java
+++ b/profiles/command/src/main/java/org/onap/cli/fw/cmd/schema/OnapCommandSchemaCmdLoader.java
@@ -98,6 +98,7 @@ public class OnapCommandSchemaCmdLoader {
case OnapCommandCmdConstants.PASS_CODE:
cmd.setPassCodes((ArrayList) valMap.get(key1));
break;
+ default : // Do nothing
}
}
}