X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcomponents%2FPolicyDBDao.java;h=a8449e30716bfb8c9f0330ed8a6fb333b9af3450;hp=d1aef147ffd116e4578bd52a72cd0a3a2f3ebc76;hb=7a14106f07b1de10d9627ba4baa25587043be6e3;hpb=5fdc1c75fcea13ae0391668dd0edf7e954ae31f8 diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java index d1aef147f..a8449e307 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java @@ -127,7 +127,7 @@ public class PolicyDBDao { public static final String duplicatePolicyId = "Somehow, more than one policy with the id "; public static final String foundInDB = " were found in the database"; - public static boolean isJunit = false; + private static boolean isJunit = false; public static void setJunit(boolean isJunit) { PolicyDBDao.isJunit = isJunit; @@ -1250,6 +1250,9 @@ public class PolicyDBDao { for(PDPPolicy policy : policies){ try{ String[] stringArray = getNameScopeAndVersionFromPdpPolicy(policy.getId()); + if(stringArray == null) { + throw new IllegalArgumentException("Invalid input - policyID must contain name, scope and version"); + } List policyEntityList; Query getPolicyEntitiesQuery = em.createNamedQuery("PolicyEntity.findByNameAndScope"); getPolicyEntitiesQuery.setParameter("name", stringArray[0]);