aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksandr Moliavko <o.moliavko@samsung.com>2019-08-16 09:53:30 +0300
committerLukasz Muszkieta <lukasz.muszkieta@nokia.com>2019-08-16 10:31:14 +0000
commitbbc6905e9618190a11a7d7f143b87edf75a3854b (patch)
tree09925703de2b2c27226e82accf9278e7af3abeff
parent0e57a09647ea8ab7736cbbc322e876c84cbcb346 (diff)
Replaced string concatenations in a loop with
StringBuffer appends to remove static analyzer warning about inefficient string operations Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko <o.moliavko@samsung.com> Change-Id: I89e0e5b599a8263882b0f91fb0f9191734a04ec1
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
index c0e065c298..153de2fb12 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
@@ -1477,13 +1477,19 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
}
if (subnet.getAllocationPools() != null) {
- curR = curR + " allocation_pools:\n";
+ StringBuilder tempBuf = new StringBuilder();
+ tempBuf.append(curR);
+ tempBuf.append(" allocation_pools:\n");
for (Pool pool : subnet.getAllocationPools()) {
if (!commonUtils.isNullOrEmpty(pool.getStart()) && !commonUtils.isNullOrEmpty(pool.getEnd())) {
- curR = curR + " - start: " + pool.getStart() + "\n";
- curR = curR + " end: " + pool.getEnd() + "\n";
+ tempBuf.append(" - start: ");
+ tempBuf.append(pool.getStart());
+ tempBuf.append("\n end: ");
+ tempBuf.append(pool.getEnd());
+ tempBuf.append("\n");
}
}
+ curR = tempBuf.toString();
}
resourcesBuf.append(curR);
@@ -1492,7 +1498,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
curO = curO.replace("%subnetId%", subnet.getSubnetId());
outputsBuf.append(curO);
-
}
// append resources and outputs in heatTemplate
logger.debug("Tempate initial:{}", heatTemplate);