Merge "Addressing Technical Debt for ONAP-XACML"
[policy/engine.git] / POLICY-SDK-APP / src / main / java / org / onap / policy / controller / ActionPolicyController.java
index c8b7a96..88cb2e2 100644 (file)
@@ -29,9 +29,11 @@ import java.util.Map;
 
 import javax.xml.bind.JAXBElement;
 
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
 import org.onap.policy.rest.adapter.PolicyRestAdapter;
 import org.onap.policy.rest.jpa.PolicyEntity;
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.onap.portalsdk.core.controller.RestrictedBaseController;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 
@@ -48,8 +50,6 @@ import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationExpressionsType;
 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.TargetType;
-import org.onap.policy.common.logging.flexlogger.FlexLogger;
-import org.onap.policy.common.logging.flexlogger.Logger;
 
 @Controller
 @RequestMapping({ "/" })
@@ -77,7 +77,7 @@ public class ActionPolicyController extends RestrictedBaseController {
             PolicyType policy = (PolicyType) policyData;
             policyAdapter.setOldPolicyFileName(policyAdapter.getPolicyName());
             String policyNameValue = policyAdapter.getPolicyName()
-                    .substring(policyAdapter.getPolicyName().indexOf("_") + 1);
+                    .substring(policyAdapter.getPolicyName().indexOf('_') + 1);
             policyAdapter.setPolicyName(policyNameValue);
             String description = "";
             try {
@@ -210,7 +210,7 @@ public class ActionPolicyController extends RestrictedBaseController {
             if (LOGGER.isDebugEnabled()) {
                 LOGGER.debug("Prepopulating Compound rule algorithm: " + index);
             }
-            Map<String, String> rule = new HashMap<String, String>();
+            Map<String, String> rule = new HashMap<>();
             for (String key : PolicyController.getDropDownMap().keySet()) {
                 String keyValue = PolicyController.getDropDownMap().get(key);
                 if (keyValue.equals(actionApply.getFunctionId())) {
@@ -231,7 +231,7 @@ public class ActionPolicyController extends RestrictedBaseController {
     }
 
     private void prePopulateRuleAlgorithms(int index, ApplyType actionApply, List<JAXBElement<?>> jaxbActionTypes) {
-        Map<String, String> ruleMap = new HashMap<String, String>();
+        Map<String, String> ruleMap = new HashMap<>();
         ruleMap.put("id", "A" + (index + 1));
         // Populate combo box
         Map<String, String> dropDownMap = PolicyController.getDropDownMap();
@@ -257,7 +257,7 @@ public class ActionPolicyController extends RestrictedBaseController {
             ruleMap.put("dynamicRuleAlgorithmField2", attributeValue);
         }
         // Rule Attribute added as value
-        else if (((jaxbActionTypes.get(0).getValue()) instanceof AttributeValueType)) {
+        else if ((jaxbActionTypes.get(0).getValue()) instanceof AttributeValueType) {
             AttributeValueType actionConditionAttributeValue = (AttributeValueType) jaxbActionTypes.get(0).getValue();
             String attributeValue = (String) actionConditionAttributeValue.getContent().get(0);
             ruleMap.put("dynamicRuleAlgorithmField2", attributeValue);