X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fadmin%2FCheckPDP.java;h=3febbed44ad6ee77b7ec3a129772174b4a66e379;hb=94eaa7529fa3dd60eda311ac14da93b57f31f1e2;hp=f983c6650fdc5f2b544d437e57c7ab2060ea1a8c;hpb=073cc188efe9abb4c010cf674e34e2cf46ef1c52;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/CheckPDP.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/CheckPDP.java index f983c6650..3febbed44 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/CheckPDP.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/CheckPDP.java @@ -61,12 +61,11 @@ public class CheckPDP { return false; } // Check ID - return (pdpMap.containsKey(id))? true: false; + return pdpMap.containsKey(id); } private static void readFile(){ String pdpFile = null; - Long newModified = null; try{ pdpFile = XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_IDFILE); }catch (Exception e){ @@ -90,7 +89,7 @@ public class CheckPDP { } // Check if File is updated recently else { - newModified = pdpPath.toFile().lastModified(); + Long newModified = pdpPath.toFile().lastModified(); if (!newModified.equals(oldModified)) { // File has been updated. readProps(); @@ -100,7 +99,7 @@ public class CheckPDP { @SuppressWarnings({ "unchecked", "rawtypes" }) private static void readProps() { - Properties pdpProp = null; + Properties pdpProp; pdpProp = new Properties(); try { InputStream in = new FileInputStream(pdpPath.toFile()); @@ -126,15 +125,15 @@ public class CheckPDP { private static void loadPDPProperties(String propKey, Properties pdpProp){ if (propKey.startsWith("PDP_URL")) { - String check_val = pdpProp.getProperty(propKey); - if (check_val == null) { + String checkVal = pdpProp.getProperty(propKey); + if (checkVal == null) { LOGGER.error("Properties file doesn't have the PDP_URL parameter"); } - if (check_val != null && check_val.contains(";")) { - List pdp_default = new ArrayList<>(Arrays.asList(check_val.split("\\s*;\\s*"))); + if (checkVal != null && checkVal.contains(";")) { + List pdpDefault = new ArrayList<>(Arrays.asList(checkVal.split("\\s*;\\s*"))); int pdpCount = 0; - while (pdpCount < pdp_default.size()) { - String pdpVal = pdp_default.get(pdpCount); + while (pdpCount < pdpDefault.size()) { + String pdpVal = pdpDefault.get(pdpCount); readPDPParam(pdpVal); pdpCount++; }