Sonar Major 71/12371/1
authorSwapnilPathak <SP00494485@techmahindra.com>
Thu, 14 Sep 2017 06:56:53 +0000 (12:26 +0530)
committerSwapnilPathak <SP00494485@techmahindra.com>
Thu, 14 Sep 2017 06:59:19 +0000 (12:29 +0530)
Merge this if statement with the enclosing one
Change-Id: I8086a6fc1dc24719c3ffd3785a12c086ab453ae8
Issue-ID: POLICY-233
Signed-off-by: SwapnilPathak <SP00494485@techmahindra.com>
POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java

index b481714..5525379 100644 (file)
@@ -736,8 +736,7 @@ public class PolicyManagerServlet extends HttpServlet {
                                        el.put("modifiedBy", getUserName(policy.getModifiedBy()));
                                        resultList.add(el);
                                }
-                       }else if(!scopes.isEmpty()){
-                               if(scopes.contains(scopeNameValue)){
+                       }else if(!scopes.isEmpty() && scopes.contains(scopeNameValue)){
                                        JSONObject el = new JSONObject();
                                        el.put("name", policy.getPolicyName().substring(policy.getPolicyName().lastIndexOf(File.separator)+1)); 
                                        el.put("date", policy.getModifiedDate());
@@ -747,7 +746,6 @@ public class PolicyManagerServlet extends HttpServlet {
                                        el.put("createdBy", getUserName(policy.getCreatedBy()));
                                        el.put("modifiedBy", getUserName(policy.getModifiedBy()));
                                        resultList.add(el);
-                               }
                        }
                }       
        }