From 3fc42e430b3f1cf95e48aa8f744edb9d823fff86 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Thu, 26 Apr 2018 15:31:17 +0530 Subject: Combine hierarchy if statements Issue-ID: CLI-100 Change-Id: I744ffefb28bf292b98a7e1465fb58e55b7bf1aeb Signed-off-by: Kanagaraj Manickam k00365106 --- .../main/java/org/onap/cli/fw/input/OnapCommandParameter.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'framework/src') diff --git a/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java b/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java index 23263c12..618c321c 100644 --- a/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java +++ b/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java @@ -301,13 +301,10 @@ public class OnapCommandParameter { throw new OnapCommandInvalidParameterValue(this.getName()); } } else if (OnapCommandParameterType.BOOL.equals(parameterType)) { - if (!(value instanceof Boolean)) { - if (value instanceof String) { - value = Boolean.valueOf((String)value); - } else { - throw new OnapCommandInvalidParameterValue(this.getName()); - } - + if (value instanceof String) { + value = Boolean.valueOf((String)value); + } else if (!(value instanceof Boolean)) { + throw new OnapCommandInvalidParameterValue(this.getName()); } } this.value = value; -- cgit 1.2.3-korg