From 1beaa908abebcb3d0f5a8ac7e80e3604d5b9f638 Mon Sep 17 00:00:00 2001 From: Munir Ahmad Date: Sat, 24 Feb 2018 12:34:32 -0500 Subject: Swap StringBuffer with StringBuilder everywhere Change-Id: Ia1f8d3ebc4026179bf08cdb0bd71c4480b8481df Issue-ID: SO-437 Signed-off-by: Munir Ahmad --- .../openecomp/mso/asdc/client/ASDCGlobalController.java | 2 +- .../openecomp/mso/asdc/installer/ASDCElementInfo.java | 2 +- .../openecomp/mso/asdc/installer/BigDecimalVersion.java | 2 +- .../mso/asdc/installer/heat/ToscaResourceInstaller.java | 2 +- .../mso/asdc/installer/heat/VfResourceInstaller.java | 2 +- .../openecomp/mso/asdc/util/ASDCNotificationLogging.java | 16 ++++++++-------- .../org/openecomp/mso/asdc/util/NotificationLogging.java | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'asdc-controller/src/main/java') diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCGlobalController.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCGlobalController.java index c0056e0573..251888e9e2 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCGlobalController.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCGlobalController.java @@ -49,7 +49,7 @@ public class ASDCGlobalController { List controllerNames = ASDCConfiguration.getAllDefinedControllers(); - StringBuffer controllerListLog = new StringBuffer("List of controllers loaded:"); + StringBuilder controllerListLog = new StringBuilder("List of controllers loaded:"); for (String controllerName : controllerNames) { controllers.put(controllerName, new ASDCController(controllerName)); controllerListLog.append(controllerName); diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/ASDCElementInfo.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/ASDCElementInfo.java index 3c262c6c90..29144a9884 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/ASDCElementInfo.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/ASDCElementInfo.java @@ -109,7 +109,7 @@ public class ASDCElementInfo { */ @Override public final String toString() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); List aggregatedElements = new ArrayList<>(); for (Entry entry : this.getElementInfoMap().entrySet()) { aggregatedElements.add(entry.getKey() + ": " + entry.getValue()); diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/BigDecimalVersion.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/BigDecimalVersion.java index 5547bb1189..c2faf1c0e8 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/BigDecimalVersion.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/BigDecimalVersion.java @@ -34,7 +34,7 @@ public class BigDecimalVersion { public static BigDecimal castAndCheckNotificationVersion(String version) { // Truncate the version if bad type String[] splitVersion = version.split("\\."); - StringBuffer newVersion = new StringBuffer(); + StringBuilder newVersion = new StringBuilder(); if (splitVersion.length > 1) { newVersion.append(splitVersion[0]); newVersion.append("."); diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java index b998be9a69..f22debce1e 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java @@ -636,7 +636,7 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller { return body; } - StringBuffer sb = new StringBuffer(body.length()); + StringBuilder sb = new StringBuilder(body.length()); int currentIndex = 0; int startIndex = 0; diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/VfResourceInstaller.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/VfResourceInstaller.java index bd20eb0bf1..0ae58dad41 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/VfResourceInstaller.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/VfResourceInstaller.java @@ -631,7 +631,7 @@ public class VfResourceInstaller implements IVfResourceInstaller { return body; } - StringBuffer sb = new StringBuffer(body.length()); + StringBuilder sb = new StringBuilder(body.length()); int currentIndex = 0; int startIndex = 0; diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/ASDCNotificationLogging.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/ASDCNotificationLogging.java index 28f5dbdee5..a7ba01354d 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/ASDCNotificationLogging.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/ASDCNotificationLogging.java @@ -42,7 +42,7 @@ public class ASDCNotificationLogging { if (asdcNotification == null) { return "NULL"; } - StringBuffer buffer = new StringBuffer("ASDC Notification:"); + StringBuilder buffer = new StringBuilder("ASDC Notification:"); buffer.append(System.lineSeparator()); buffer.append("DistributionID:"); @@ -96,7 +96,7 @@ public class ASDCNotificationLogging { } - StringBuffer buffer = new StringBuffer("CSAR Notification:"); + StringBuilder buffer = new StringBuilder("CSAR Notification:"); buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); @@ -286,7 +286,7 @@ public class ASDCNotificationLogging { return null; } - StringBuffer buffer = new StringBuffer("VfModuleMetaData List:"); + StringBuilder buffer = new StringBuilder("VfModuleMetaData List:"); buffer.append(System.lineSeparator()); buffer.append("{"); @@ -311,7 +311,7 @@ public class ASDCNotificationLogging { return "NULL"; } - StringBuffer buffer = new StringBuffer("VfModuleMetaData:"); + StringBuilder buffer = new StringBuilder("VfModuleMetaData:"); buffer.append(System.lineSeparator()); buffer.append("VfModuleModelName:"); @@ -395,7 +395,7 @@ public class ASDCNotificationLogging { return null; } - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("{"); for (IResourceInstance resourceInstanceElem:asdcNotification.getResources()) { @@ -418,7 +418,7 @@ public class ASDCNotificationLogging { return null; } - StringBuffer buffer = new StringBuffer("Resource Instance Info:"); + StringBuilder buffer = new StringBuilder("Resource Instance Info:"); buffer.append(System.lineSeparator()); buffer.append("ResourceInstanceName:"); @@ -473,7 +473,7 @@ public class ASDCNotificationLogging { return null; } - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("{"); for (IArtifactInfo artifactInfoElem:artifactsList) { buffer.append(System.lineSeparator()); @@ -495,7 +495,7 @@ public class ASDCNotificationLogging { return null; } - StringBuffer buffer = new StringBuffer("Service Artifacts Info:"); + StringBuilder buffer = new StringBuilder("Service Artifacts Info:"); buffer.append(System.lineSeparator()); buffer.append("ArtifactName:"); diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/NotificationLogging.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/NotificationLogging.java index 9b38a50daf..126114d2d6 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/NotificationLogging.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/NotificationLogging.java @@ -82,7 +82,7 @@ public class NotificationLogging implements InvocationHandler { return "EMPTY"; // No declared methods in this class !!! } - StringBuffer buffer = new StringBuffer("ASDC Notification:"); + StringBuilder buffer = new StringBuilder("ASDC Notification:"); buffer.append(System.lineSeparator()); for (Method m : declaredMethods) { -- cgit 1.2.3-korg