From b945dbd30ae86f01797a710acb29fb75b5199bd5 Mon Sep 17 00:00:00 2001 From: Ramanjaneya-Huawei Date: Thu, 19 Oct 2017 11:23:29 +0530 Subject: Use StringBuilder Change-Id: I13d2856530776cdf57c41f12c0bf522988bea29a Issue-id: SO-224 Signed-off-by: Ramanjaneya-Huawei --- .../org/openecomp/mso/openstack/exceptions/MsoException.java | 2 +- .../mso/openstack/exceptions/MsoOpenstackException.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) 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(); } } -- cgit 1.2.3-korg