Fix major sonar issues 95/15095/1
authorshashikanth <shashikanth.vh@huawei.com>
Mon, 25 Sep 2017 14:05:50 +0000 (19:35 +0530)
committershashikanth <shashikanth.vh@huawei.com>
Mon, 25 Sep 2017 14:07:45 +0000 (19:37 +0530)
Move the "filter" string literal on the left side of this string comparison

Issue-Id:SO-118
Change-Id: Ib9078c10ffac5cb54e74e4c4565d413f4908f532
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java

index 8ee106e..9b975fa 100644 (file)
@@ -586,20 +586,20 @@ public class MsoRequest {
     public Map<String, List<String>> getOrchestrationFilters (MultivaluedMap<String, String> queryParams) throws ValidationException {
 
         String queryParam = null;
-        Map<String, List<String>> orchestrationFilterParams = new HashMap<String, List<String>>();
+        Map<String, List<String>> orchestrationFilterParams = new HashMap<>();
 
 
         for (Entry<String,List<String>> entry : queryParams.entrySet()) {
             queryParam = entry.getKey();
 
             try{
-                 if(queryParam.equalsIgnoreCase("filter")){
+                 if("filter".equalsIgnoreCase(queryParam)){
                          for(String value : entry.getValue()) {
                                  StringTokenizer st = new StringTokenizer(value, ":");
        
                                  int counter=0;
                                  String mapKey=null;
-                                 List<String> orchestrationList = new ArrayList<String>();
+                                 List<String> orchestrationList = new ArrayList<>();
                                  while (st.hasMoreElements()) {
                                          if(counter == 0){
                                                  mapKey = st.nextElement() + "";