Merge "Swap StringBuilder with string where makes sense"
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 2080be1..396784a 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,51 +42,15 @@
 		if (asdcNotification == null) {
 			return "NULL";
 		}
-		StringBuilder buffer = new StringBuilder("ASDC Notification:");
-		buffer.append(System.lineSeparator());
-
-		buffer.append("DistributionID:");
-		buffer.append(testNull(asdcNotification.getDistributionID()));
-		buffer.append(System.lineSeparator());
-
-
-		buffer.append("ServiceName:");
-		buffer.append(testNull(asdcNotification.getServiceName()));
-		buffer.append(System.lineSeparator());
-
-
-		buffer.append("ServiceVersion:");
-		buffer.append(testNull(asdcNotification.getServiceVersion()));
-		buffer.append(System.lineSeparator());
-
-
-		buffer.append("ServiceUUID:");
-		buffer.append(testNull(asdcNotification.getServiceUUID()));
-		buffer.append(System.lineSeparator());
-
-
-		buffer.append("ServiceInvariantUUID:");
-		buffer.append(testNull(asdcNotification.getServiceInvariantUUID()));
-		buffer.append(System.lineSeparator());
-
-
-		buffer.append("ServiceDescription:");
-		buffer.append(testNull(asdcNotification.getServiceDescription()));
-		buffer.append(System.lineSeparator());
-
-
-		buffer.append("Service Artifacts List:");
-		buffer.append(System.lineSeparator());
-		buffer.append(testNull(dumpArtifactInfoList(asdcNotification.getServiceArtifacts())));
-		buffer.append(System.lineSeparator());
-
-		buffer.append("Resource Instances List:");
-		buffer.append(System.lineSeparator());
-		buffer.append(testNull(dumpASDCResourcesList(asdcNotification)));
-		buffer.append(System.lineSeparator());
-
-
-		return buffer.toString();
+        return "ASDC Notification:" + System.lineSeparator() +
+            "DistributionID:" + testNull(asdcNotification.getDistributionID()) + System.lineSeparator() +
+            "ServiceName:" + testNull(asdcNotification.getServiceName()) + System.lineSeparator() +
+            "ServiceVersion:" + testNull(asdcNotification.getServiceVersion()) + System.lineSeparator() +
+            "ServiceUUID:" + testNull(asdcNotification.getServiceUUID()) + System.lineSeparator() +
+            "ServiceInvariantUUID:" + testNull(asdcNotification.getServiceInvariantUUID()) + System.lineSeparator() +
+            "ServiceDescription:" + testNull(asdcNotification.getServiceDescription()) + System.lineSeparator() +
+            "Service Artifacts List:" + System.lineSeparator() + testNull(dumpArtifactInfoList(asdcNotification.getServiceArtifacts())) + System.lineSeparator() +
+            "Resource Instances List:" + System.lineSeparator() + testNull(dumpASDCResourcesList(asdcNotification)) + System.lineSeparator();
 	}
 
 	public static String dumpCSARNotification(INotificationData asdcNotification, ToscaResourceStructure toscaResourceStructure) {
@@ -418,52 +382,17 @@
 			return null;
 		}
 
-		StringBuilder buffer = new StringBuilder("Resource Instance Info:");
-		buffer.append(System.lineSeparator());
-
-		buffer.append("ResourceInstanceName:");
-		buffer.append(testNull(resourceInstance.getResourceInstanceName()));
-		buffer.append(System.lineSeparator());
-
-		buffer.append("ResourceCustomizationUUID:");
-		buffer.append(testNull(resourceInstance.getResourceCustomizationUUID()));
-		buffer.append(System.lineSeparator());
-
-		buffer.append("ResourceInvariantUUID:");
-		buffer.append(testNull(resourceInstance.getResourceInvariantUUID()));
-		buffer.append(System.lineSeparator());
-
-		buffer.append("ResourceName:");
-		buffer.append(testNull(resourceInstance.getResourceName()));
-		buffer.append(System.lineSeparator());
-
-		buffer.append("ResourceType:");
-		buffer.append(testNull(resourceInstance.getResourceType()));
-		buffer.append(System.lineSeparator());
-
-		buffer.append("ResourceUUID:");
-		buffer.append(testNull(resourceInstance.getResourceUUID()));
-		buffer.append(System.lineSeparator());
-
-		buffer.append("ResourceVersion:");
-		buffer.append(testNull(resourceInstance.getResourceVersion()));
-		buffer.append(System.lineSeparator());
-
-		buffer.append("Category:");
-		buffer.append(testNull(resourceInstance.getCategory()));
-		buffer.append(System.lineSeparator());
-
-		buffer.append("SubCategory:");
-		buffer.append(testNull(resourceInstance.getSubcategory()));
-		buffer.append(System.lineSeparator());
-
-		buffer.append("Resource Artifacts List:");
-		buffer.append(System.lineSeparator());
-		buffer.append(testNull(dumpArtifactInfoList(resourceInstance.getArtifacts())));
-		buffer.append(System.lineSeparator());
-
-		return buffer.toString();
-
+        return "Resource Instance Info:" + System.lineSeparator() +
+            "ResourceInstanceName:" + testNull(resourceInstance.getResourceInstanceName()) + System.lineSeparator() +
+            "ResourceCustomizationUUID:" + testNull(resourceInstance.getResourceCustomizationUUID()) + System.lineSeparator() +
+            "ResourceInvariantUUID:" + testNull(resourceInstance.getResourceInvariantUUID()) + System.lineSeparator() +
+            "ResourceName:" + testNull(resourceInstance.getResourceName()) + System.lineSeparator() +
+            "ResourceType:" + testNull(resourceInstance.getResourceType()) + System.lineSeparator() +
+            "ResourceUUID:" + testNull(resourceInstance.getResourceUUID()) + System.lineSeparator() +
+            "ResourceVersion:" + testNull(resourceInstance.getResourceVersion()) + System.lineSeparator() +
+            "Category:" + testNull(resourceInstance.getCategory()) + System.lineSeparator() +
+            "SubCategory:" + testNull(resourceInstance.getSubcategory()) + System.lineSeparator() +
+            "Resource Artifacts List:" + System.lineSeparator() + testNull(dumpArtifactInfoList(resourceInstance.getArtifacts())) + System.lineSeparator();
 	}
 
 
diff --git a/common/src/main/java/org/openecomp/mso/properties/MsoJsonProperties.java b/common/src/main/java/org/openecomp/mso/properties/MsoJsonProperties.java
index 8da155f..ec0b54a 100644
--- a/common/src/main/java/org/openecomp/mso/properties/MsoJsonProperties.java
+++ b/common/src/main/java/org/openecomp/mso/properties/MsoJsonProperties.java
@@ -159,15 +159,9 @@
 
 	@Override
 	public String toString() {
-		StringBuilder response = new StringBuilder();
-		response.append("Config file ").append(propertiesFileName).append("(Timer:").append(automaticRefreshInMinutes)
-            .append("mins):").append(System.getProperty("line.separator"));
-		response.append(this.jsonRootNode.toString());
-		response.append(System.getProperty("line.separator"));
-		response.append(System.getProperty("line.separator"));
-		return response.toString();
-
+		return "Config file " + propertiesFileName + "(Timer:" + automaticRefreshInMinutes + "mins):" + System
+			.getProperty("line.separator") + this.jsonRootNode.toString() + System.getProperty("line.separator")
+			+ System.getProperty("line.separator");
 	}
 
-
 }
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 97e1443..6b27c50 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
@@ -1175,14 +1175,11 @@
      * @return VnfRecipe object or null if none found
      */
     public VnfRecipe getVnfRecipeByNameVersion(String modelName, String modelVersion, String action) {
-        StringBuilder hql = new StringBuilder("FROM VnfRecipe WHERE vnfType = :vnfType AND version= :version AND action = :action ");
 
         long startTime = System.currentTimeMillis();
-        LOGGER.debug("Catalog database - get VNF recipe with name " + modelName
-                                      + " and action "
-                                      + action);
+        LOGGER.debug("Catalog database - get VNF recipe with name " + modelName + " and action " + action);
 
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM VnfRecipe WHERE vnfType = :vnfType AND version= :version AND action = :action ");
         query.setParameter(VNF_TYPE, modelName);
         query.setParameter(MODEL_VERSION, modelVersion);
         query.setParameter(ACTION, action);
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ArRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ArRecipe.java
index b4c1f05..e22d1eb 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ArRecipe.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ArRecipe.java
@@ -37,10 +37,6 @@
 
     @Override
 	public String toString () {
-		StringBuilder sb = new StringBuilder();
-		sb.append(super.toString());
-		sb.append(",modelName=").append(modelName);
-		sb.append(",arParamXSD=").append(getParamXSD());
-		return sb.toString();
+		return super.toString() + ",modelName=" + modelName + ",arParamXSD=" + getParamXSD();
 	}
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java
index b211dbd..cb5bf64 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java
@@ -179,21 +179,17 @@
 
 	@Override
 	public String toString() {
-		StringBuilder sb = new StringBuilder("VnfResourceCustomization: ");
-		sb.append("ModelCustUuid=").append(this.modelCustomizationUuid);
-		sb.append(", ModelInstanceName=").append(this.modelInstanceName);
-		sb.append(", vnfResourceModelUuid=").append(this.vnfResourceModelUUID);
-		sb.append(", creationTimestamp=").append(this.created);
-		sb.append(", minInstances=").append(this.minInstances);
-		sb.append(", maxInstances=").append(this.maxInstances);
-		sb.append(", availabilityZoneMaxCount=").append(this.availabilityZoneMaxCount);
-//		sb.append(", vnfResource:\n" + this.vnfResource == null ? "null" : this.vnfResource.toString());
-		sb.append(", nfFunction=").append(this.nfFunction);
-		sb.append(", nfType=").append(this.nfType);
-		sb.append(", nfRole=").append(this.nfRole);
-		sb.append(", nfNamingCode=").append(this.nfNamingCode);
-		
-		return sb.toString();
+        return "VnfResourceCustomization: " + "ModelCustUuid=" + this.modelCustomizationUuid +
+            ", ModelInstanceName=" + this.modelInstanceName +
+            ", vnfResourceModelUuid=" + this.vnfResourceModelUUID +
+            ", creationTimestamp=" + this.created +
+            ", minInstances=" + this.minInstances +
+            ", maxInstances=" + this.maxInstances +
+            ", availabilityZoneMaxCount=" + this.availabilityZoneMaxCount +
+            ", nfFunction=" + this.nfFunction +
+            ", nfType=" + this.nfType +
+            ", nfRole=" + this.nfRole +
+            ", nfNamingCode=" + this.nfNamingCode;
 	}
 
 }