summaryrefslogtreecommitdiffstats
path: root/adapters/mso-adapter-utils/src/main/java
diff options
context:
space:
mode:
authorMunir Ahmad <munir.ahmad@bell.ca>2018-02-24 13:12:56 -0500
committerMunir Ahmad <munir.ahmad@bell.ca>2018-02-27 00:40:10 +0000
commit40bb7adfbbe26be4e459e269bfd277436deb21cf (patch)
treedda603845f2ffac80079e5b1c9aa8451edbb2db0 /adapters/mso-adapter-utils/src/main/java
parent250de788c5cf40cc8a73c7aad4dc2f482f821768 (diff)
Make use of append instead of string concatenation
Change-Id: I94ad658026f165ba8b5a74352095188a27ee50e5 Issue-ID: SO-437 Signed-off-by: Munir Ahmad <munir.ahmad@bell.ca>
Diffstat (limited to 'adapters/mso-adapter-utils/src/main/java')
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigFactory.java4
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java16
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtilsWithUpdate.java8
3 files changed, 14 insertions, 14 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigFactory.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigFactory.java
index 8da3b212d9..2d6d0271f8 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigFactory.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigFactory.java
@@ -185,12 +185,12 @@ public class CloudConfigFactory implements Serializable {
StringBuffer response = new StringBuffer ();
response.append ("Cloud Sites:\n");
for (CloudSite site : cloudConfig.getCloudSites ().values ()) {
- response.append (site.toString () + "\n");
+ response.append(site.toString()).append("\n");
}
response.append ("\n\nCloud Identity Services:\n");
for (CloudIdentity identity : cloudConfig.getIdentityServices ().values ()) {
- response.append (identity.toString () + "\n");
+ response.append(identity.toString()).append("\n");
}
return Response.status (200).entity (response).build ();
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java
index 20535e93c8..9fe2d4c786 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java
@@ -1217,18 +1217,18 @@ public class MsoHeatUtils extends MsoCommonUtils {
} else {
for (String key : params.keySet()) {
if (params.get(key) instanceof String) {
- sb.append("\n" + key + "=" + (String) params.get(key));
+ sb.append("\n").append(key).append("=").append((String) params.get(key));
} else if (params.get(key) instanceof JsonNode) {
String jsonStringOut = this.convertNode((JsonNode)params.get(key));
- sb.append("\n" + key + "=" + jsonStringOut);
+ sb.append("\n").append(key).append("=").append(jsonStringOut);
} else if (params.get(key) instanceof Integer) {
String integerOut = "" + params.get(key);
- sb.append("\n" + key + "=" + integerOut);
+ sb.append("\n").append(key).append("=").append(integerOut);
} else {
try {
String str = params.get(key).toString();
- sb.append("\n" + key + "=" + str);
+ sb.append("\n").append(key).append("=").append(str);
} catch (Exception e) {
LOGGER.debug("Exception :",e);
}
@@ -1272,16 +1272,16 @@ public class MsoHeatUtils extends MsoCommonUtils {
int counter = 0;
sb.append("OUTPUTS:\n");
for (String key : outputs.keySet()) {
- sb.append("outputs[" + counter++ + "]: " + key + "=");
+ sb.append("outputs[").append(counter++).append("]: ").append(key).append("=");
Object obj = outputs.get(key);
if (obj instanceof String) {
- sb.append((String)obj +" (a string)");
+ sb.append((String) obj).append(" (a string)");
} else if (obj instanceof JsonNode) {
- sb.append(this.convertNode((JsonNode)obj) + " (a JsonNode)");
+ sb.append(this.convertNode((JsonNode) obj)).append(" (a JsonNode)");
} else if (obj instanceof java.util.LinkedHashMap) {
try {
String str = JSON_MAPPER.writeValueAsString(obj);
- sb.append(str + " (a java.util.LinkedHashMap)");
+ sb.append(str).append(" (a java.util.LinkedHashMap)");
} catch (Exception e) {
LOGGER.debug("Exception :",e);
sb.append("(a LinkedHashMap value that would not convert nicely)");
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtilsWithUpdate.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtilsWithUpdate.java
index 2465b30eca..0e0b9cb70d 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtilsWithUpdate.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtilsWithUpdate.java
@@ -365,16 +365,16 @@ public class MsoHeatUtilsWithUpdate extends MsoHeatUtils {
int counter = 0;
sb.append("OUTPUTS:\n");
for (String key : outputs.keySet()) {
- sb.append("outputs[" + counter++ + "]: " + key + "=");
+ sb.append("outputs[").append(counter++).append("]: ").append(key).append("=");
Object obj = outputs.get(key);
if (obj instanceof String) {
- sb.append((String)obj +" (a string)");
+ sb.append((String) obj).append(" (a string)");
} else if (obj instanceof JsonNode) {
- sb.append(this.convertNode((JsonNode)obj) + " (a JsonNode)");
+ sb.append(this.convertNode((JsonNode) obj)).append(" (a JsonNode)");
} else if (obj instanceof java.util.LinkedHashMap) {
try {
String str = JSON_MAPPER.writeValueAsString(obj);
- sb.append(str + " (a java.util.LinkedHashMap)");
+ sb.append(str).append(" (a java.util.LinkedHashMap)");
} catch (Exception e) {
LOGGER.debug("Exception :", e);
sb.append("(a LinkedHashMap value that would not convert nicely)");