Fixed multiple so issues 93/19693/1
authorRamanjaneya-Huawei <ramanjaneya.palleti@huawei.com>
Thu, 19 Oct 2017 10:07:48 +0000 (15:37 +0530)
committerRamanjaneya-Huawei <ramanjaneya.palleti@huawei.com>
Thu, 19 Oct 2017 10:08:47 +0000 (15:38 +0530)
Change-Id: I4b73cdeeb2a636d42df7b1b156e27e958c828048
Issue-id: SO-224
Signed-off-by: Ramanjaneya-Huawei <ramanjaneya.palleti@huawei.com>
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoYamlEditorWithEnvt.java

index bd649e8..c227d72 100644 (file)
@@ -32,7 +32,6 @@ import java.util.Set;
 import java.util.Map.Entry;
 import org.openecomp.mso.db.catalog.beans.HeatTemplateParam;
 import org.codehaus.jackson.map.ObjectMapper;
-import java.util.LinkedHashMap;
 
 import org.yaml.snakeyaml.Yaml;
 
@@ -63,7 +62,7 @@ public class MsoYamlEditorWithEnvt {
        public synchronized Set <MsoHeatEnvironmentParameter> getParameterListFromEnvt() {
        // In an environment entry, the parameters section can only contain the name:value - 
        // not other attributes.
-       Set <MsoHeatEnvironmentParameter> paramSet = new HashSet<MsoHeatEnvironmentParameter>();
+       Set <MsoHeatEnvironmentParameter> paramSet = new HashSet<>();
        Map<String, Object> resourceMap = null;
        try {
                resourceMap = (Map<String,Object>) yml.get("parameters");
@@ -79,13 +78,9 @@ public class MsoYamlEditorWithEnvt {
        while (it.hasNext()) {
                MsoHeatEnvironmentParameter hep = new MsoHeatEnvironmentParameter();
                Map.Entry <String, Object> pair = it.next();
-               //Map<String, String> resourceEntry = (Map <String, String>) pair.getValue();
-               //String value = null;
-               String value = null;
+               String value;
                Object obj = pair.getValue();
                if (obj instanceof java.lang.String) {
-                       //value = (String) pair.getValue();
-                       // handle block scalar - literals and folded:
                        value = yaml.dump(obj);
                        // but this adds an extra '\n' at the end - which won't hurt - but we don't need it
                        value = value.substring(0, value.length() - 1);