From 60be4e21f1ada02fbbdb39cc47ff1c69c098a00a Mon Sep 17 00:00:00 2001 From: vasraz Date: Wed, 20 Nov 2019 17:32:02 +0000 Subject: Fix Sonar issue Major SmellCode: Replace StringBuffer with StringBuilder Change-Id: I0283e5160e5c1f23423c66110015f18c8163411e Signed-off-by: Vasyl Razinkov Issue-ID: SDC-2670 --- .../org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java | 6 +++--- .../sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java | 2 +- .../openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java | 2 +- .../java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'test-apis-ci/src') diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java index 56502757de..fd1703bfcb 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java @@ -153,7 +153,7 @@ public class CsarUtilsTest extends ComponentBaseTest { String resourceYaml = null; byte[] buffer = new byte[1024]; ZipEntry nextEntry = zip.getNextEntry(); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); int len; while ((len = zip.read(buffer)) > 0) { @@ -203,7 +203,7 @@ public class CsarUtilsTest extends ComponentBaseTest { String resourceYaml = null; byte[] buffer = new byte[1024]; ZipEntry nextEntry = zip.getNextEntry(); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); int len; while ((len = zip.read(buffer)) > 0) { @@ -311,7 +311,7 @@ public class CsarUtilsTest extends ComponentBaseTest { String resourceYaml = null; byte[] buffer = new byte[1024]; ZipEntry nextEntry = zip.getNextEntry(); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); int len; while ((len = zip.read(buffer)) > 0) { diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java index 071624676f..eabf057715 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java @@ -631,7 +631,7 @@ public class CreateServiceMetadataApiTest extends ComponentBaseTest { // fill new service details ServiceReqDetails serviceDetails = ElementFactory.getDefaultService(); - StringBuffer tagBuffer = new StringBuffer(); + StringBuilder tagBuffer = new StringBuilder(); for (int i = 0; i < 1025; i++) { tagBuffer.append("a"); } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java index 8e5079db92..43c93e47a6 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java @@ -774,7 +774,7 @@ public final class AtomicOperationUtils { // Get the CSARs path String realFilePath = System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "CI" + File.separator + "csars" ; if (filePath != null && filePath.length > 0) { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); for(String currStr: filePath){ result.append(currStr); } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java index 56859ff56a..b8ec35f0ff 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java @@ -179,7 +179,7 @@ public class BaseRestUtils extends BaseValidationUtils { int statusCode = response.getStatusLine().getStatusCode(); postResponse.setErrorCode(statusCode); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); try { BufferedReader in = new BufferedReader(new InputStreamReader(responseEntity.getContent())); String inputLine; -- cgit 1.2.3-korg