diff options
Diffstat (limited to 'adapters/mso-adapter-utils/src/main')
5 files changed, 24 insertions, 16 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/IdentityAuthenticationTypeJsonSerializer.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/IdentityAuthenticationTypeJsonSerializer.java index 0777c60278..052f09ab85 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/IdentityAuthenticationTypeJsonSerializer.java +++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/IdentityAuthenticationTypeJsonSerializer.java @@ -22,17 +22,15 @@ package org.openecomp.mso.cloud; import java.io.IOException;
import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;
-import org.openecomp.mso.cloud.CloudIdentity.IdentityServerType;
public class IdentityAuthenticationTypeJsonSerializer extends JsonSerializer<IdentityAuthenticationTypeAbstract> {
@Override
public void serialize(IdentityAuthenticationTypeAbstract tmpObj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
- throws IOException, JsonProcessingException {
+ throws IOException {
jsonGenerator.writeObject(tmpObj.toString());
}
}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java index ff1cd43b05..b8a7a5571c 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java +++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java @@ -61,6 +61,6 @@ public abstract class MsoException extends Exception if (this.context == null) return getMessage(); else - return ("[" + context + "] " + getMessage()); + return "[" + context + "] " + getMessage(); } } diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java index a62339d0f4..8aa8d3f5e8 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java +++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java @@ -71,7 +71,13 @@ public class MsoOpenstackException extends MsoException @Override public String toString () { - String error = "" + statusCode + " " + statusMessage + ": " + errorDetail; - return error; + StringBuilder error = new StringBuilder(); + error.append(""); + error.append(statusCode); + error.append(" "); + error.append(statusMessage); + error.append(": "); + error.append(errorDetail); + return error.toString(); } } diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResource.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResource.java index 31e2fca4c1..a2e605f897 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResource.java +++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResource.java @@ -56,10 +56,18 @@ public class MsoHeatEnvironmentResource { public void setValue(String value) { this.value = value; } + + @Override public String toString() { - return "\"" + this.name + "\": " + this.value; + StringBuilder str = new StringBuilder(); + str.append("\""); + str.append(this.name); + str.append("\": "); + str.append(this.value); + return str.toString(); } - + + @Override public boolean equals(Object o) { if (!(o instanceof MsoHeatEnvironmentResource)) { return false; @@ -74,7 +82,8 @@ public class MsoHeatEnvironmentResource { } return false; } - + + @Override public int hashCode() { int result = 0; try { diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoYamlEditorWithEnvt.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoYamlEditorWithEnvt.java index bd649e867f..c227d72f0c 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoYamlEditorWithEnvt.java +++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoYamlEditorWithEnvt.java @@ -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); |