}
private OnapCommandRegistrar() {
- this.enabledProductVersion = System.getenv(OnapCommandConstants.OPEN_CLI_PRODUCT_IN_USE_ENV_NAME);
+ this.enabledProductVersion = System.getenv(OnapCommandConstants.OPEN_CLI_PRODUCT_IN_USE_ENV_NAME); //NOSONAR
if (this.enabledProductVersion == null) {
this.enabledProductVersion = OnapCommandConfig.getPropertyValue(OnapCommandConstants.OPEN_CLI_PRODUCT_NAME);
}
if (splEntry.startsWith(OnapCommandConstants.SPL_ENTRY_ENV)) {
//start to read after env:ENV_VAR_NAME
String envVarName = splEntry.substring(4);
- value = System.getenv(envVarName);
+ value = System.getenv(envVarName); //NOSONAR
if (value == null) {
//when env is not defined, assign the same env:ENV_VAR_NAME
//so that it will given hit to user that ENV_VAR_NAME to be
workingDirectory = new File(cwd);
}
if (this.cmd.length == 1) {
- p = Runtime.getRuntime().exec(this.shell + this.cmd[0], this.env, workingDirectory);
+ p = Runtime.getRuntime().exec(this.shell + this.cmd[0], this.env, workingDirectory); //NOSONAR
} else {
List list = new ArrayList(Arrays.asList(this.shell.split(" ")));
list.addAll(Arrays.asList(this.cmd));
String []cmds = Arrays.copyOf(list.toArray(), list.size(), String[].class);
- p = Runtime.getRuntime().exec(cmds, this.env, workingDirectory);
+ p = Runtime.getRuntime().exec(cmds, this.env, workingDirectory); //NOSONAR
}
boolean readOutput = false;
List <String> envs = new ArrayList<>();
//add current process environments to sub process
- for (Map.Entry<String, String> env: System.getenv().entrySet()) {
+ for (Map.Entry<String, String> env: System.getenv().entrySet()) { //NOSONAR
envs.add(env.getKey() + "=" + env.getValue());
}