summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMunir Ahmad <munir.ahmad@bell.ca>2018-02-21 16:50:36 -0500
committerMunir Ahmad <munir.ahmad@bell.ca>2018-02-21 16:50:36 -0500
commitb5af6ca053e6df9d4c79eda7e56afcf51ab34cc2 (patch)
treee8e6323f4cfe7da539c505f6216374a8bb14b3ae
parent18b29b863206deeba869fcd2738ea8ffce20b962 (diff)
Make use of addAll instead of loop
Change-Id: Ia3afb3ecfec21e81982c4838bf019cc8e3ef55c1 Issue-ID: SO-437 Signed-off-by: Munir Ahmad <munir.ahmad@bell.ca>
-rw-r--r--asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfModuleStructure.java8
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java8
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java4
3 files changed, 5 insertions, 15 deletions
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfModuleStructure.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfModuleStructure.java
index f6ac480c93..be86574137 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfModuleStructure.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfModuleStructure.java
@@ -79,13 +79,9 @@ public final class VfModuleStructure {
artifactsList.addAll(artifactsMap.get(ASDCConfiguration.HEAT_ENV));
artifactsList.addAll(artifactsMap.get(ASDCConfiguration.HEAT_VOL));
- for (VfModuleArtifact artifact:(artifactsMap.get(ASDCConfiguration.HEAT_NESTED))) {
- artifactsList.add(artifact);
- }
+ artifactsList.addAll((artifactsMap.get(ASDCConfiguration.HEAT_NESTED)));
- for (VfModuleArtifact artifact:(artifactsMap.get(ASDCConfiguration.HEAT_ARTIFACT))) {
- artifactsList.add(artifact);
- }
+ artifactsList.addAll((artifactsMap.get(ASDCConfiguration.HEAT_ARTIFACT)));
artifactsList.addAll(artifactsMap.get(ASDCConfiguration.HEAT_VOL));
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
index aefe0d5a8b..891b0b27fb 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
@@ -2166,9 +2166,7 @@ public class CatalogDatabase implements Closeable {
String networkModelCustomizationUuid = stn.getResourceModelCustomizationUUID();
LOGGER.debug("Now searching for NetworkResourceCustomization for " + networkModelCustomizationUuid);
List<NetworkResourceCustomization> resultSet = this.getAllNetworksByNetworkModelCustomizationUuid(networkModelCustomizationUuid);
- for (NetworkResourceCustomization nrc : resultSet) {
- masterList.add(nrc);
- }
+ masterList.addAll(resultSet);
}
LOGGER.debug("Returning " + masterList.size() + " NRC records");
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllNetworksByServiceModelUuid", null);
@@ -2465,9 +2463,7 @@ public class CatalogDatabase implements Closeable {
String arModelCustomizationUuid = star.getResourceModelCustomizationUUID();
LOGGER.debug("Now searching for AllottedResourceCustomization for " + arModelCustomizationUuid);
List<AllottedResourceCustomization> resultSet = this.getAllAllottedResourcesByArModelCustomizationUuid(arModelCustomizationUuid);
- for (AllottedResourceCustomization arc : resultSet) {
- masterList.add(arc);
- }
+ masterList.addAll(resultSet);
}
LOGGER.debug("Returning " + masterList.size() + " ARC records");
LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllAllottedResourcesByServiceModelUuid", null);
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
index 0872f146ad..7495015cb9 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
@@ -226,9 +226,7 @@ public class VnfResource extends MavenLikeVersioning implements Serializable {
return null;
}
ArrayList<VfModule> list = new ArrayList<VfModule>();
- for (VfModule vfm : this.vfModules) {
- list.add(vfm);
- }
+ list.addAll(this.vfModules);
return list;
}