X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ECOMP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcomponents%2FAutoPushPolicy.java;h=b658483d2e90d1d67f6820bcc476b1cb70d6bcf5;hb=fc5c07705edc4dcb7083b39116a43844bb6a1490;hp=4d4859349a4d0b9960150c8111c00803e543d67d;hpb=e0addf5b588a1244f9679becd90999dfcb4c3a94;p=policy%2Fengine.git diff --git a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/AutoPushPolicy.java b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/AutoPushPolicy.java index 4d4859349..b658483d2 100644 --- a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/AutoPushPolicy.java +++ b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/AutoPushPolicy.java @@ -72,7 +72,7 @@ public class AutoPushPolicy { * @param papEngine */ public Set checkGroupsToPush(String policyToCreateUpdate, PAPPolicyEngine papEngine) { - Set changedGroups= new HashSet(); + Set changedGroups= new HashSet<>(); // Check if the file has been modified. then re-load the properties file. newModified = propFile.lastModified(); try { @@ -135,10 +135,8 @@ public class AutoPushPolicy { StdPDPPolicy policy = new StdPDPPolicy(policyId, true, policyName, null); //Get the current policies from the Group and Add the new one Set currentPoliciesInGroup = pdpGroup.getPolicies(); - Set policies = new HashSet(); - if(policy!=null){ - policies.add(policy); - } + Set policies = new HashSet<>(); + policies.add(policy); pdpGroup.copyPolicyToFile(policyId, new FileInputStream(Paths.get(policyToCreateUpdate).toFile())); //If the selected policy is in the group we must remove it because the name is default Iterator policyIterator = policies.iterator();