Fix technical debt and reduce lines
[policy/engine.git] / POLICY-SDK-APP / src / main / java / org / onap / policy / controller / DecisionPolicyController.java
index 49496cd..6f8eea8 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;
 
@@ -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