diff options
author | priyanka.akhade <priyanka.akhade@huawei.com> | 2020-05-13 18:08:23 +0000 |
---|---|---|
committer | priyanka.akhade <priyanka.akhade@huawei.com> | 2020-05-13 19:36:17 +0000 |
commit | 5f8784d570e719f4be3d50969f905bc1c31ed42c (patch) | |
tree | a162bcc24a12c33069fe01f51d01bdb0febe3343 | |
parent | 770b6c0c3637762de8ad73963167b7d12d72fded (diff) |
sonar code smells fix- Use the primitive boolean expression here
Signed-off-by: priyanka.akhade <priyanka.akhade@huawei.com>
Issue-ID: CLI-270
Change-Id: I3584db40fedae81ceb9bc067a17b012136553fc3
-rw-r--r-- | framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java b/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java index 6e224209..abd1dbcc 100644 --- a/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java +++ b/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java @@ -258,14 +258,14 @@ public abstract class OnapCommand { log.info("INPUT: {}", paramMap); // -h or --help is always higher precedence !, user can set this value to get help message - if ((Boolean)(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_HELP).getValue())) { + if (Boolean.TRUE.equals(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_HELP).getValue())) { this.cmdResult.setType(OnapCommandResultType.TEXT); this.cmdResult.setOutput(this.printHelp()); return this.cmdResult; } // -v or --version is next higher precedence !, user can set this value to get help message - if ((Boolean)(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_VERSION).getValue())) { + if (Boolean.TRUE.equals(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_VERSION).getValue())) { this.cmdResult.setType(OnapCommandResultType.TEXT); this.cmdResult.setOutput(this.printVersion()); return this.cmdResult; @@ -290,16 +290,16 @@ public abstract class OnapCommand { // -f or --format this.cmdResult.setType( OnapCommandResultType.get(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_FORMAT).getValue().toString())); - if ((Boolean)(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_ATTR_LONG).getValue())) { + if (Boolean.TRUE.equals(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_ATTR_LONG).getValue())) { this.cmdResult.setScope(OnapCommandResultAttributeScope.LONG); } // --no-title - if ((Boolean)paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_NO_TITLE).getValue()) { + if (Boolean.TRUE.equals(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_OUTPUT_NO_TITLE).getValue())) { this.cmdResult.setIncludeTitle(false); } // --debug - if ((Boolean)(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_DEBUG).getValue())) { + if (Boolean.TRUE.equals(paramMap.get(OnapCommandConstants.DEFAULT_PARAMETER_DEBUG).getValue())) { this.cmdResult.setDebug(true); } |