diff options
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src')
6 files changed, 28 insertions, 28 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java index 9f709140ec..a1bc08599b 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java @@ -40,7 +40,7 @@ public abstract class CatalogQueryExceptionCommon { public String toJsonString() { try { - String jsonString = null; + String jsonString; ObjectMapper mapper = new ObjectMapper(); mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE); jsonString = mapper.writeValueAsString(this); diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java index 75262e3597..9a82ed2c6e 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java @@ -54,7 +54,7 @@ public class QueryAllottedResourceCustomization extends CatalogQuery { "\t}"; // "\t}}"; - public QueryAllottedResourceCustomization() { super(); allottedResourceCustomization = new ArrayList<AllottedResourceCustomization>(); } + public QueryAllottedResourceCustomization() { super(); allottedResourceCustomization = new ArrayList<>(); } public QueryAllottedResourceCustomization(List<AllottedResourceCustomization> vlist) { allottedResourceCustomization = vlist; } public List<AllottedResourceCustomization> getServiceAllottedResources(){ return this.allottedResourceCustomization; } @@ -62,7 +62,7 @@ public class QueryAllottedResourceCustomization extends CatalogQuery { @Override public String toString () { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); boolean first = true; int i = 1; @@ -76,10 +76,10 @@ public class QueryAllottedResourceCustomization extends CatalogQuery { @Override public String JSON2(boolean isArray, boolean isEmbed) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (!isEmbed && isArray) buf.append("{ "); if (isArray) buf.append("\"serviceAllottedResources\": ["); - Map<String, String> valueMap = new HashMap<String, String>(); + Map<String, String> valueMap = new HashMap<>(); String sep = ""; boolean first = true; @@ -114,4 +114,4 @@ public class QueryAllottedResourceCustomization extends CatalogQuery { return buf.toString(); } -}
\ No newline at end of file +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java index 0e2aa714f6..e5147671f3 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java @@ -60,8 +60,8 @@ public class QueryServiceMacroHolder extends CatalogQuery { Service service = serviceMacroHolder.getService(); if (service == null) return "\"serviceResources\": null"; - StringBuffer buf = new StringBuffer(); - Map<String, String> valueMap = new HashMap<String, String>(); + StringBuilder buf = new StringBuilder(); + Map<String, String> valueMap = new HashMap<>(); put(valueMap, "SERVICE_MODEL_NAME", service.getModelName()); //getServiceModelName()); put(valueMap, "SERVICE_MODEL_UUID", service.getModelUUID()); //getServiceModelUuid()); @@ -84,4 +84,4 @@ public class QueryServiceMacroHolder extends CatalogQuery { return buf.toString(); } -}
\ No newline at end of file +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java index 42b6b651ef..59c601ef19 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java @@ -51,10 +51,10 @@ public class QueryServiceNetworks extends CatalogQuery { "\t}"; // "\t}}"; - public QueryServiceNetworks() { super(); serviceNetworks = new ArrayList<NetworkResourceCustomization>(); } + public QueryServiceNetworks() { super(); serviceNetworks = new ArrayList<>(); } public QueryServiceNetworks(List<NetworkResourceCustomization> vlist) { LOGGER.debug ("QueryServiceNetworks:"); - serviceNetworks = new ArrayList<NetworkResourceCustomization>(); + serviceNetworks = new ArrayList<>(); for (NetworkResourceCustomization o : vlist) { LOGGER.debug (o.toString()); serviceNetworks.add(o); @@ -67,7 +67,7 @@ public class QueryServiceNetworks extends CatalogQuery { @Override public String toString () { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); boolean first = true; int i = 1; @@ -81,11 +81,11 @@ public class QueryServiceNetworks extends CatalogQuery { @Override public String JSON2(boolean isArray, boolean isEmbed) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (!isEmbed && isArray) buf.append("{ "); if (isArray) buf.append("\"serviceNetworks\": ["); //if (isArray) buf.append("["); - Map<String, String> valueMap = new HashMap<String, String>(); + Map<String, String> valueMap = new HashMap<>(); String sep = ""; boolean first = true; @@ -112,4 +112,4 @@ public class QueryServiceNetworks extends CatalogQuery { if (!isEmbed && isArray) buf.append("}"); return buf.toString(); } -}
\ No newline at end of file +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java index ee3c86ab94..cfbb781ae8 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java @@ -55,10 +55,10 @@ public class QueryServiceVnfs extends CatalogQuery { "\t}"; // "\t}}"; - public QueryServiceVnfs() { super(); serviceVnfs = new ArrayList<VnfResourceCustomization>(); } + public QueryServiceVnfs() { super(); serviceVnfs = new ArrayList<>(); } public QueryServiceVnfs(List<VnfResourceCustomization> vlist) { LOGGER.debug ("QueryServiceVnfs:"); - serviceVnfs = new ArrayList<VnfResourceCustomization>(); + serviceVnfs = new ArrayList<>(); for (VnfResourceCustomization o : vlist) { LOGGER.debug ("-- o is a serviceVnfs ----"); LOGGER.debug (o.toString()); @@ -72,7 +72,7 @@ public class QueryServiceVnfs extends CatalogQuery { @Override public String toString () { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); boolean first = true; int i = 1; @@ -86,10 +86,10 @@ public class QueryServiceVnfs extends CatalogQuery { @Override public String JSON2(boolean isArray, boolean isEmbed) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (!isEmbed && isArray) buf.append("{ "); if (isArray) buf.append("\"serviceVnfs\": ["); - Map<String, String> valueMap = new HashMap<String, String>(); + Map<String, String> valueMap = new HashMap<>(); String sep = ""; boolean first = true; @@ -121,4 +121,4 @@ public class QueryServiceVnfs extends CatalogQuery { if (!isEmbed && isArray) buf.append("}"); return buf.toString(); } -}
\ No newline at end of file +} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java index 4675858936..309aa0641a 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java @@ -50,10 +50,10 @@ public class QueryVfModule extends CatalogQuery { "\t}"; // "\t}}"; - public QueryVfModule() { super(); vfModules = new ArrayList<VfModuleCustomization>(); } + public QueryVfModule() { super(); vfModules = new ArrayList<>(); } public QueryVfModule(List<VfModuleCustomization> vlist) { LOGGER.debug ("QueryVfModule:"); - vfModules = new ArrayList<VfModuleCustomization>(); + vfModules = new ArrayList<>(); if (vlist != null) { for (VfModuleCustomization o : vlist) { LOGGER.debug ("-- o is a vfModules ----"); @@ -69,7 +69,7 @@ public class QueryVfModule extends CatalogQuery { @Override public String toString () { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); boolean first = true; int i = 1; @@ -83,9 +83,9 @@ public class QueryVfModule extends CatalogQuery { @Override public String JSON2(boolean isArray, boolean x) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (isArray) buf.append("\"vfModules\": ["); - Map<String, String> valueMap = new HashMap<String, String>(); + Map<String, String> valueMap = new HashMap<>(); String sep = ""; boolean first = true; @@ -95,7 +95,7 @@ public class QueryVfModule extends CatalogQuery { boolean vfNull = o.getVfModule() == null ? true : false; boolean hasVolumeGroup = false; String envt = o.getHeatEnvironmentArtifactUuid(); - if (envt != null && !envt.equals("")) { + if (envt != null && !"".equals(envt)) { hasVolumeGroup = true; } @@ -116,4 +116,4 @@ public class QueryVfModule extends CatalogQuery { if (isArray) buf.append("]"); return buf.toString(); } -}
\ No newline at end of file +} |