summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/StackInfo.java4
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java14
2 files changed, 8 insertions, 10 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/StackInfo.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/StackInfo.java
index 600985e310..506b62994d 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/StackInfo.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/StackInfo.java
@@ -67,10 +67,8 @@ public class StackInfo {
if (stack.getStackStatus() == null) {
this.status = HeatStatus.INIT;
- } else if (heatStatusMap.containsKey(stack.getStackStatus())) {
- this.status = heatStatusMap.get(stack.getStackStatus());
} else {
- this.status = HeatStatus.UNKNOWN;
+ this.status = heatStatusMap.getOrDefault(stack.getStackStatus(), HeatStatus.UNKNOWN);
}
if (stack.getOutputs() != null) {
this.outputs = new HashMap<>();
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java
index a74cf07b89..4a8233bb03 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java
@@ -46,21 +46,21 @@ public abstract class CatalogQuery {
}
protected String setTemplate(String template, Map<String, String> valueMap) {
- LOGGER.debug ("CatalogQuery setTemplate");
+ LOGGER.debug("CatalogQuery setTemplate");
StringBuffer result = new StringBuffer();
String pattern = "<.*>";
Pattern r = Pattern.compile(pattern);
Matcher m = r.matcher(template);
- LOGGER.debug ("CatalogQuery template:"+ template);
- while(m.find()) {
- String key = template.substring(m.start()+1, m.end()-1);
- LOGGER.debug ("CatalogQuery key:"+ key+ " contains key? "+ valueMap.containsKey(key));
- m.appendReplacement(result, valueMap.containsKey(key)? valueMap.get(key): "\"TBD\"");
+ LOGGER.debug("CatalogQuery template:" + template);
+ while (m.find()) {
+ String key = template.substring(m.start() + 1, m.end() - 1);
+ LOGGER.debug("CatalogQuery key:" + key + " contains key? " + valueMap.containsKey(key));
+ m.appendReplacement(result, valueMap.getOrDefault(key, "\"TBD\""));
}
m.appendTail(result);
- LOGGER.debug ("CatalogQuery return:"+ result.toString());
+ LOGGER.debug("CatalogQuery return:" + result.toString());
return result.toString();
}