X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FCreateFirewallController.java;fp=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FCreateFirewallController.java;h=f0681a3881a16c672487174611ca3a3abe866b18;hb=e44a43f3dbb1dbaa182122f66961c55d3b96b824;hp=5b34db455ac25055975001f071e3b66977556b8c;hpb=a6b8bc8875402ab721a8529926d01b2565d0f595;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateFirewallController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateFirewallController.java index 5b34db455..f0681a388 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateFirewallController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateFirewallController.java @@ -122,7 +122,7 @@ public class CreateFirewallController extends RestrictedBaseController { String jsonBody=""; termCollectorList = new ArrayList <>(); tagCollectorList = new ArrayList <>(); - if(policyData.getAttributes().size() > 0){ + if(! policyData.getAttributes().isEmpty()){ for(Object attribute : policyData.getAttributes()){ if(attribute instanceof LinkedHashMap){ String key = ((LinkedHashMap) attribute).get("key").toString(); @@ -321,7 +321,7 @@ public class CreateFirewallController extends RestrictedBaseController { mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); JsonNode root = mapper.readTree(request.getReader()); PolicyRestAdapter policyData = mapper.readValue(root.get("policyData").toString(), PolicyRestAdapter.class); - if(policyData.getAttributes().size() > 0){ + if(! policyData.getAttributes().isEmpty()){ for(Object attribute : policyData.getAttributes()){ if(attribute instanceof LinkedHashMap){ String key = ((LinkedHashMap) attribute).get("key").toString();