Fixed the sonar issues in ONAP-REST.
[policy/engine.git] / ONAP-REST / src / main / java / org / onap / policy / rest / util / PolicyValidationRequestWrapper.java
index 4267ff9..f197739 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Engine
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -231,10 +231,10 @@ public class PolicyValidationRequestWrapper {
                    
                    ArrayList<Object> attributeList = new ArrayList<>();
                    if (matching != null) {
-                           for (String keyField : matching.keySet()) {
+                           for (Map.Entry<String, String> entry : matching.entrySet()) {
                                                LinkedHashMap<String, String> attributeMap = new LinkedHashMap<>();
-                                               String key = keyField;
-                                               String value = matching.get(keyField);
+                                               String key = entry.getKey();
+                                               String value = entry.getValue();
                                                attributeMap.put("key", key);
                                                attributeMap.put("value", value);
                                                attributeList.add(attributeMap);