Format java POLICY-SDK-APP
[policy/engine.git] / POLICY-SDK-APP / src / main / java / org / onap / policy / components / HumanPolicyComponent.java
index ea0dce2..60029f8 100644 (file)
@@ -2,7 +2,8 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Engine
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Bell Canada
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,7 +39,9 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+
 import javax.xml.bind.JAXBElement;
+
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionsType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType;
@@ -56,6 +59,7 @@ import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicySetType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.VariableReferenceType;
+
 import org.apache.commons.io.FilenameUtils;
 import org.json.JSONObject;
 import org.onap.policy.common.logging.flexlogger.FlexLogger;
@@ -65,8 +69,6 @@ import org.onap.policy.rest.jpa.FunctionDefinition;
 import org.onap.policy.xacml.api.XACMLErrorConstants;
 import org.onap.policy.xacml.util.XACMLPolicyScanner;
 
-
-
 public class HumanPolicyComponent {
 
     private static final Logger LOGGER = FlexLogger.getLogger(HumanPolicyComponent.class);
@@ -96,7 +98,6 @@ public class HumanPolicyComponent {
     public static final String EMPTY_STRING = "";
     private static final String ENTER = "ENTER";
 
-
     private static HtmlProcessor htmlProcessor;
 
     private static File policyFile;
@@ -218,8 +219,7 @@ class HtmlProcessor extends SimpleCallback {
             throw new IllegalArgumentException(msg);
         }
 
-        if (policyObject == null
-                || (!(policyObject instanceof PolicySetType) && !(policyObject instanceof PolicyType))) {
+        if ((!(policyObject instanceof PolicySetType) && !(policyObject instanceof PolicyType))) {
             String msg = "Invalid unmarshalled object: " + policyObject;
             LOGGER.error(XACMLErrorConstants.ERROR_SCHEMA_INVALID + msg);
             throw new IllegalArgumentException(msg);
@@ -359,7 +359,6 @@ class HtmlProcessor extends SimpleCallback {
         String id = "-";
         String version = "-";
 
-
         if (policySet.getPolicyCombiningAlgId() != null)
             combiningAlgorithm = extractLastIdentifier(policySet.getPolicyCombiningAlgId(), ":");
 
@@ -369,7 +368,6 @@ class HtmlProcessor extends SimpleCallback {
         if (policySet.getVersion() != null)
             version = policySet.getVersion();
 
-
         htmlOut.println("<" + htmlListElement + "><b>Policy Set ID</b>: <i>" + id + "</i>  (v" + version + ") " + "</"
                 + htmlListElement + ">");
 
@@ -443,7 +441,6 @@ class HtmlProcessor extends SimpleCallback {
         String id = "-";
         String version = "-";
 
-
         if (policy.getRuleCombiningAlgId() != null)
             combiningAlgorithm = extractLastIdentifier(policy.getRuleCombiningAlgId(), ":");
 
@@ -479,7 +476,6 @@ class HtmlProcessor extends SimpleCallback {
         }
     }
 
-
     @Override
     public CallbackResult onPreVisitRule(PolicyType parent, RuleType rule) {
         if (LOGGER.isTraceEnabled())