summaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorMunir Ahmad <munir.ahmad@bell.ca>2018-02-24 13:38:07 -0500
committerMunir Ahmad <munir.ahmad@bell.ca>2018-03-06 08:00:11 -0500
commit5b17ffb73bdbf1fdd6e41b287013af7d1e4a7e62 (patch)
tree572766ca9cad26939e10a71a05a07717e02b6caf /adapters
parent61d12d7316fd6ca53375712e038c599702d102b1 (diff)
Replace StringBuilder with String & inline return
Resolved merge conflicts Change-Id: I1a8c8b6fd801c1eb7719ea3d17f029972e2ba84f Issue-ID: SO-437 Signed-off-by: Munir Ahmad <munir.ahmad@bell.ca>
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudIdentity.java31
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java16
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java17
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntry.java8
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResource.java10
-rw-r--r--adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java24
6 files changed, 42 insertions, 64 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudIdentity.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudIdentity.java
index ba9a7d5007..3dd4cbfc9c 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudIdentity.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudIdentity.java
@@ -227,29 +227,18 @@ public class CloudIdentity {
public void setIdentityAuthenticationType(IdentityAuthenticationType identityAuthenticationType) {
this.identityAuthenticationType = identityAuthenticationType;
}
-
+
@Override
public String toString () {
- StringBuilder stringBuilder = new StringBuilder ();
- stringBuilder.append ("Cloud Identity Service: id=")
- .append (id)
- .append (", identityUrl=")
- .append (this.identityUrl)
- .append (", msoId=")
- .append (msoId)
- .append (", adminTenant=")
- .append (adminTenant)
- .append (", memberRole=")
- .append (memberRole)
- .append (", tenantMetadata=")
- .append (tenantMetadata)
- .append (", identityServerType=")
- .append (identityServerType == null ? "null" : identityServerType.toString())
- .append (", identityAuthenticationType=")
- .append (identityAuthenticationType == null ? "null" : identityAuthenticationType.toString());
-
- return stringBuilder.toString ();
- }
+ return "Cloud Identity Service: id=" + id +
+ ", identityUrl=" + this.identityUrl +
+ ", msoId=" + msoId +
+ ", adminTenant=" + adminTenant +
+ ", memberRole=" + memberRole +
+ ", tenantMetadata=" + tenantMetadata +
+ ", identityServerType=" + (identityServerType == null ? "null" : identityServerType.toString()) +
+ ", identityAuthenticationType=" + (identityAuthenticationType == null ? "null" : identityAuthenticationType.toString());
+ }
public static String encryptPassword (String msoPass) {
try {
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java
index 2cda8f99e2..64460b20bb 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java
@@ -139,15 +139,13 @@ public class NetworkInfo {
@Override
public String toString() {
- final StringBuilder sb = new StringBuilder("NetworkInfo{");
- sb.append("name='").append(name).append('\'');
- sb.append(", id='").append(id).append('\'');
- sb.append(", status=").append(status);
- sb.append(", provider='").append(provider).append('\'');
- sb.append(", vlans=").append(vlans);
- sb.append(", subnets=").append(subnets);
- sb.append('}');
- return sb.toString();
+ return "NetworkInfo{" + "name='" + name + '\'' +
+ ", id='" + id + '\'' +
+ ", status=" + status +
+ ", provider='" + provider + '\'' +
+ ", vlans=" + vlans +
+ ", subnets=" + subnets +
+ '}';
}
}
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 8aa8d3f5e8..eead8439d4 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
@@ -68,16 +68,13 @@ public class MsoOpenstackException extends MsoException
this.statusMessage = message;
this.errorDetail = detail;
}
-
+
@Override
- public String toString () {
- StringBuilder error = new StringBuilder();
- error.append("");
- error.append(statusCode);
- error.append(" ");
- error.append(statusMessage);
- error.append(": ");
- error.append(errorDetail);
- return error.toString();
+ public String toString() {
+ return statusCode +
+ " " +
+ statusMessage +
+ ": " +
+ errorDetail;
}
}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntry.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntry.java
index 69da437797..04dbf523d0 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntry.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntry.java
@@ -65,11 +65,9 @@ public class MsoHeatEnvironmentEntry {
@Override
public String toString() {
- final StringBuilder sb = new StringBuilder("MsoHeatEnvironmentEntry{");
- sb.append("parameters=").append(parameters);
- sb.append(", resourceRegistryEntryRaw='").append(resourceRegistryEntryRaw).append('\'');
- sb.append('}');
- return sb.toString();
+ return "MsoHeatEnvironmentEntry{" + "parameters=" + parameters +
+ ", resourceRegistryEntryRaw='" + resourceRegistryEntryRaw + '\'' +
+ '}';
}
public String getRawEntry() {
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 a2e605f897..a0c9b7a105 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
@@ -59,12 +59,10 @@ public class MsoHeatEnvironmentResource {
@Override
public String toString() {
- StringBuilder str = new StringBuilder();
- str.append("\"");
- str.append(this.name);
- str.append("\": ");
- str.append(this.value);
- return str.toString();
+ return "\"" +
+ this.name +
+ "\": " +
+ this.value;
}
@Override
diff --git a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java
index 95e62a0e2d..9131309ab5 100644
--- a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java
+++ b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java
@@ -1442,19 +1442,17 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String serviceName = VNF_ADAPTER_SERVICE_NAME + methodName;
MsoLogger.setServiceName (serviceName);
- StringBuilder sbInit = new StringBuilder();
- sbInit.append("updateVfModule: \n");
- sbInit.append("cloudSiteId=").append(cloudSiteId).append("\n");
- sbInit.append("tenantId=").append(tenantId).append("\n");
- sbInit.append("vnfType=").append(vnfType).append("\n");
- sbInit.append("vnfVersion=").append(vnfVersion).append("\n");
- sbInit.append("vnfName=").append(vnfName).append("\n");
- sbInit.append("requestType=").append(requestType).append("\n");
- sbInit.append("volumeGroupHeatStackId=").append(volumeGroupHeatStackId).append("\n");
- sbInit.append("baseVfHeatStackId=").append(baseVfHeatStackId).append("\n");
- sbInit.append("vfModuleStackId=").append(vfModuleStackId).append("\n");
- sbInit.append("modelCustomizationUuid=").append(modelCustomizationUuid).append("\n");
- LOGGER.debug(sbInit.toString());
+ String strInit = "updateVfModule: cloudSiteId=" + cloudSiteId +
+ ",tenantId=" + tenantId +
+ ",vnfType=" + vnfType +
+ ",vnfVersion=" + vnfVersion +
+ ",vnfName=" + vnfName +
+ ",requestType=" + requestType +
+ ",volumeGroupHeatStackId=" + volumeGroupHeatStackId +
+ ",baseVfHeatStackId=" + baseVfHeatStackId +
+ ",vfModuleStackId=" + vfModuleStackId +
+ ",modelCustomizationUuid=" + modelCustomizationUuid;
+ LOGGER.debug(strInit);
String mcu = modelCustomizationUuid;
boolean useMCUuid = false;