X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-XACML%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fxacml%2Fstd%2Fpap%2FStdEngine.java;h=d3dc7ae18ba344436a9419106fb7ff58f540b4b2;hb=eef3c224cb6cad4b82a96938ade1e42ca881eea2;hp=4399f715fab7bf97eb5f81393f68934661229a47;hpb=6a44b2926f33b427904c2f3e7962d0dfc360c482;p=policy%2Fengine.git diff --git a/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdEngine.java b/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdEngine.java index 4399f715f..d3dc7ae18 100644 --- a/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdEngine.java +++ b/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdEngine.java @@ -180,18 +180,8 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE // We don't have the default group, create it // String defaultId = properties.getProperty(PROP_PAP_GROUPS_DEFAULT, PROP_PAP_GROUPS_DEFAULT_NAME); - if(defaultId == null){ - defaultId = PROP_PAP_GROUPS_DEFAULT_NAME; - } - if("".equals(defaultId)){ - defaultId = PROP_PAP_GROUPS_DEFAULT_NAME; - } - //we're going to check one more time in case the PROP_PAP_GROUPS_DEFAULT_NAME doesn't exist - if(defaultId == null){ - defaultId = "default"; - } if("".equals(defaultId)){ - defaultId = "default"; + defaultId = PROP_PAP_GROUPS_DEFAULT_NAME; } logger.warn("Default group does NOT exist, creating " + defaultId); Path defaultPath = Paths.get(this.repository.toString(), defaultId); @@ -320,7 +310,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE // If it exists already // if (Files.exists(groupPath)) { - logger.warn(addGroup + id + " directory exists" + groupPath.toString()); + logger.warn(addGroup + id + " directory exists"); } else { try { // @@ -338,7 +328,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE Path policyProperties = Paths.get(groupPath.toString(), "xacml.policy.properties"); if (Files.exists(policyProperties)) { - logger.warn(addGroup + id + " file exists: " + policyProperties.toString()); + logger.warn(addGroup + id + " file exists"); } else { Properties props = new Properties(); props.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, ""); @@ -349,7 +339,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE props.store(os, ""); } } catch (IOException e) { - PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "StdEngine", "Failed to create " + policyProperties); + PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "StdEngine", "Failed to create policyProperties"); throw new PAPException("Failed to create " + id); } } @@ -359,7 +349,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE Path pipProperties = Paths.get(groupPath.toString(), "xacml.pip.properties"); Properties props = new Properties(); if (Files.exists(pipProperties)) { - logger.warn(addGroup + id + " file exists: " + pipProperties.toString()); + logger.warn(addGroup + id + " file exists."); } else { try { props = setPIPProperties(props); @@ -368,7 +358,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE props.store(os, ""); } } catch (IOException e) { - PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE, e, "StdEngine", "Failed to create " + pipProperties); + PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE, e, "StdEngine", "Failed to create pipProperties"); throw new PAPException("Failed to create " + id); }