Merge "Upgrade to latest elasticsearch"
[policy/engine.git] / POLICY-SDK-APP / src / main / java / org / onap / policy / controller / DecisionPolicyController.java
index 49496cd..5ff20b6 100644 (file)
@@ -27,6 +27,7 @@ import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 
 import javax.xml.bind.JAXBElement;
 
@@ -204,7 +205,7 @@ public class DecisionPolicyController extends RestrictedBaseController {
                                                                ApplyType decisionApply = (ApplyType) condition.getExpression().getValue();
                                                                decisionApply = (ApplyType) decisionApply.getExpression().get(0).getValue();
                                                                ruleAlgoirthmTracker = new LinkedList<>();
-                                                               if(policyAdapter.getRuleProvider()!=null && ("GUARD_YAML".equals(policyAdapter.getRuleProvider())||(policyAdapter.getRuleProvider().equals("GUARD_BL_YAML")))){
+                                                               if(policyAdapter.getRuleProvider()!=null && ("GUARD_YAML".equals(policyAdapter.getRuleProvider())||("GUARD_BL_YAML".equals(policyAdapter.getRuleProvider())))){
                                                                        YAMLParams yamlParams = new YAMLParams();
                                                                        for(int i=0; i<attributeList.size() ; i++){
                                                                                Map<String, String> map = (Map<String,String>)attributeList.get(i);
@@ -283,10 +284,9 @@ public class DecisionPolicyController extends RestrictedBaseController {
                Map<String, String> ruleMap = new HashMap<>();
                ruleMap.put("id", "A" + (index +1));
                Map<String, String> dropDownMap = PolicyController.getDropDownMap();
-               for (String key : dropDownMap.keySet()) {
-                       String keyValue = dropDownMap.get(key);
-                       if (keyValue.equals(decisionApply.getFunctionId())) {
-                               ruleMap.put("dynamicRuleAlgorithmCombo", key);
+               for (Entry<String, String> entry : dropDownMap.entrySet()) {
+                       if (entry.getValue().equals(decisionApply.getFunctionId())) {
+                               ruleMap.put("dynamicRuleAlgorithmCombo", entry.getKey());
                        }
                }
                // Populate the key and value fields