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=b687a23edb87b2357403ff50b8e83452b7497356;hp=87ed1fec961a400f317a5956c97e2cc9623ac624;hpb=65f1e2bfc7d34ed125055f5c881d44bd4f5d38d0;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 87ed1fec9..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 @@ -66,7 +66,6 @@ public class CheckPDP { 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++; }