Sonar Fix: HttpMethod.java 75/74575/1
authorArundathi Patil <arundpil@in.ibm.com>
Wed, 12 Dec 2018 14:51:13 +0000 (20:21 +0530)
committerIBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com>
Wed, 12 Dec 2018 14:51:23 +0000 (20:21 +0530)
Fixed sonar issues/code-smells across this file.

Issue-ID: CCSDK-820
Change-Id: I495f35866607a1403536dfcebc366afd6d7c0ff7
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/HttpMethod.java

index 40dfa37..b2f618a 100644 (file)
@@ -4,6 +4,7 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
  *                     reserved.
+ *     Modifications Copyright © 2018 IBM.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,15 +28,15 @@ public enum HttpMethod {
     public static HttpMethod fromString(String s) {
         if (s == null)
             return null;
-        if (s.equalsIgnoreCase("get"))
+        if (("get").equalsIgnoreCase(s))
             return GET;
-        if (s.equalsIgnoreCase("post"))
+        if (("post").equalsIgnoreCase(s))
             return POST;
-        if (s.equalsIgnoreCase("put"))
+        if (("put").equalsIgnoreCase(s))
             return PUT;
-        if (s.equalsIgnoreCase("delete"))
+        if (("delete").equalsIgnoreCase(s))
             return DELETE;
-        if (s.equalsIgnoreCase("patch"))
+        if (("patch").equalsIgnoreCase(s))
             return PATCH;
         throw new IllegalArgumentException("Invalid value for HTTP Method: " + s);
     }