Sonar major issues 19/58219/1
authorSumapriya Sarvepalli <ss00493505@techmahindra.com>
Tue, 31 Jul 2018 10:44:09 +0000 (16:14 +0530)
committerSumapriya Sarvepalli <ss00493505@techmahindra.com>
Tue, 31 Jul 2018 10:51:39 +0000 (16:21 +0530)
 Replace with a single equalsIgnoreCase call
Sonar Link:
https://sonar.onap.org/project/issues?assigned=false&fileUuids=AWHCr-EdEU5FCDfKtlun&id=org.onap.so%3Aso&open=AWHCr-dlEU5FCDfKtmL0&resolved=false&severities=MAJOR
Location: src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java

Line No: L110 L115 L120 L124

Change-Id: I36a727a5acf6a911e3f9ad4ca8b548b4c7f1f732
Issue-ID: SO-776
Signed-off-by: Sumapriya Sarvepalli <ss00493505@techmahindra.com>
adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java

index 4d2bf59..9b00e4e 100644 (file)
@@ -107,21 +107,21 @@ public class RestfulUtil {
 
             HttpClient client = HttpClientBuilder.create().build();
 
-            if("POST".equals(methodType.toUpperCase())) {
+            if("POST".equalsIgnoreCase(methodType)) {
                 HttpPost httpPost = new HttpPost(msbUrl);
                 httpPost.setConfig(requestConfig);
                 httpPost.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON));
                 method = httpPost;
-            } else if("PUT".equals(methodType.toUpperCase())) {
+            } else if("PUT".equalsIgnoreCase(methodType)) {
                 HttpPut httpPut = new HttpPut(msbUrl);
                 httpPut.setConfig(requestConfig);
                 httpPut.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON));
                 method = httpPut;
-            } else if("GET".equals(methodType.toUpperCase())) {
+            } else if("GET".equalsIgnoreCase(methodType)) {
                 HttpGet httpGet = new HttpGet(msbUrl);
                 httpGet.setConfig(requestConfig);
                 method = httpGet;
-            } else if("DELETE".equals(methodType.toUpperCase())) {
+            } else if("DELETE".equalsIgnoreCase(methodType)) {
                 HttpDelete httpDelete = new HttpDelete(msbUrl);
                 httpDelete.setConfig(requestConfig);
                 method = httpDelete;