summaryrefslogtreecommitdiffstats
path: root/restapi-call-node
diff options
context:
space:
mode:
authorsurya-huawei <a.u.surya@huawei.com>2017-10-12 13:40:39 +0530
committersurya-huawei <a.u.surya@huawei.com>2017-10-12 13:42:03 +0530
commit3cc6cc194791d9eedfe87fd671ee0db3e8e72897 (patch)
tree17319a56a3ca8a60fc067359e3119454e29a695a /restapi-call-node
parente83bb3719c410e1f3d5b9d1fa345672dec9f7f43 (diff)
Remove null check
*Move string literal to the left side of comparison Null check is performed by String.equalsIgnorecase hence removed Issue-Id: CCSDK-117 Change-Id: I48c8815f9f20a1c6e86c8b4af8966c9945d5b0c7 Signed-off-by: surya-huawei <a.u.surya@huawei.com>
Diffstat (limited to 'restapi-call-node')
-rw-r--r--restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java
index 573c85f7..776485af 100644
--- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java
+++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Format.java
@@ -25,11 +25,9 @@ public enum Format {
JSON, XML;
public static Format fromString(String s) {
- if (s == null)
- return null;
- if (s.equalsIgnoreCase("json"))
+ if ("json".equalsIgnoreCase(s))
return JSON;
- if (s.equalsIgnoreCase("xml"))
+ if ("xml".equalsIgnoreCase(s))
return XML;
throw new IllegalArgumentException("Invalid value for format: " + s);
}