diff options
author | Munir Ahmad <munir.ahmad@bell.ca> | 2018-02-24 12:42:55 -0500 |
---|---|---|
committer | Munir Ahmad <munir.ahmad@bell.ca> | 2018-02-25 01:09:53 +0000 |
commit | bb9cc6b851572a3b756f65738034e546bd33e17d (patch) | |
tree | 44cf17d1734a94b8716459fb4b10dc6df074d1a1 /asdc-controller/src/main/java/org/openecomp/mso/asdc | |
parent | e35347d6521133807e92f397820fa18a5412aee7 (diff) |
Swap while loops with foreach where applicable
Change-Id: Id3b54e8192f0e60657aa4c50af56c1ef98fbff5e
Issue-ID: SO-437
Signed-off-by: Munir Ahmad <munir.ahmad@bell.ca>
Diffstat (limited to 'asdc-controller/src/main/java/org/openecomp/mso/asdc')
-rw-r--r-- | asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java index f94e0a153b..a90fdeb8e6 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java @@ -82,12 +82,10 @@ public class YamlEditor { @SuppressWarnings("unchecked") Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("resources"); - Iterator <Entry <String, Object>> it = resourceMap.entrySet ().iterator (); - while (it.hasNext ()) { - Map.Entry <String, Object> pair = it.next (); + for (Entry<String, Object> pair : resourceMap.entrySet()) { @SuppressWarnings("unchecked") - Map <String, String> resourceEntry = (Map <String, String>) pair.getValue (); - typeList.add (resourceEntry.get ("type")); + Map<String, String> resourceEntry = (Map<String, String>) pair.getValue(); + typeList.add(resourceEntry.get("type")); } return typeList; } @@ -100,28 +98,27 @@ public class YamlEditor { Set <HeatTemplateParam> paramSet = new HashSet <HeatTemplateParam> (); @SuppressWarnings("unchecked") Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("parameters"); - Iterator <Entry <String, Object>> it = resourceMap.entrySet ().iterator (); - while (it.hasNext ()) { - HeatTemplateParam param = new HeatTemplateParam (); - Map.Entry <String, Object> pair = it.next (); + for (Entry<String, Object> stringObjectEntry : resourceMap.entrySet()) { + HeatTemplateParam param = new HeatTemplateParam(); + Entry<String, Object> pair = stringObjectEntry; @SuppressWarnings("unchecked") - Map <String, String> resourceEntry = (Map <String, String>) pair.getValue (); - - param.setParamName (pair.getKey ()); + Map<String, String> resourceEntry = (Map<String, String>) pair.getValue(); + + param.setParamName(pair.getKey()); // System.out.println(pair.getKey()+":"+type); if (resourceEntry.containsKey("default")) { - param.setRequired (false); + param.setRequired(false); } else { - param.setRequired (true); + param.setRequired(true); } // Now set the type - String value = resourceEntry.get ("type"); - param.setParamType (value); - + String value = resourceEntry.get("type"); + param.setParamType(value); + param.setHeatTemplateArtifactUuid(artifactUUID); - paramSet.add (param); + paramSet.add(param); } return paramSet; |