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%2FCreateBrmsRawPolicy.java;h=a0f13ec02b2b6d8758f44ad800942a54426504cd;hb=fc5c07705edc4dcb7083b39116a43844bb6a1490;hp=dfd647c6eaa06cb020ad5fc469be7e633806da4d;hpb=a330af579866dacbe595e2e4ad1dd29cd3c96945;p=policy%2Fengine.git diff --git a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/CreateBrmsRawPolicy.java b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/CreateBrmsRawPolicy.java index dfd647c6e..a0f13ec02 100644 --- a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/CreateBrmsRawPolicy.java +++ b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/CreateBrmsRawPolicy.java @@ -117,7 +117,7 @@ public class CreateBrmsRawPolicy extends Policy { @Override public Map savePolicies() throws Exception { - Map successMap = new HashMap(); + Map successMap = new HashMap<>(); if(isPolicyExists()){ successMap.put("EXISTS", "This Policy already exist on the PAP"); return successMap; @@ -131,13 +131,9 @@ public class CreateBrmsRawPolicy extends Policy { Path newPolicyPath = null; newPolicyPath = Paths.get(policyAdapter.getNewFileName()); - Boolean dbIsUpdated = true; - - successMap = new HashMap(); - if (dbIsUpdated) { - successMap = createPolicy(newPolicyPath, - getCorrectPolicyDataObject()); - } else { + successMap = createPolicy(newPolicyPath, getCorrectPolicyDataObject()); + if (successMap == null) { + successMap = new HashMap<>(); PolicyLogger.error("Failed to Update the Database Dictionary Tables."); successMap.put("error", "DB UPDATE"); } @@ -405,7 +401,7 @@ public class CreateBrmsRawPolicy extends Policy { // Adding Dependencies. if(policyAdapter.getBrmsDependency()!=null){ BRMSDictionaryController brmsDicitonaryController = new BRMSDictionaryController(); - ArrayList dependencies = new ArrayList(); + ArrayList dependencies = new ArrayList<>(); StringBuilder key = new StringBuilder(); for(String dependencyName: policyAdapter.getBrmsDependency()){ dependencies.add(brmsDicitonaryController.getDependencyDataByID(dependencyName).getDependency());