summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints
diff options
context:
space:
mode:
authorBrinda Santh Muthuramalingam <brindasanth@in.ibm.com>2019-07-16 21:11:02 +0000
committerGerrit Code Review <gerrit@onap.org>2019-07-16 21:11:02 +0000
commit22494ac1155031e9df5860f6909eb630c1391ff9 (patch)
tree68327e4adb6647daf15580b30e06d12cd628f681 /ms/controllerblueprints
parent0cdea534624e251f8a7445b146e77a0f635755b8 (diff)
parentc15af9a019ae786bc6970fa1184361c1be96693a (diff)
Merge "Fixed bugs/vulnerabilities reported by SonarQube"
Diffstat (limited to 'ms/controllerblueprints')
-rw-r--r--ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/filters/ApplicationLoggingFilter.java2
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/cds/controllerblueprints/service/common/SwaggerGenerator.java13
2 files changed, 6 insertions, 9 deletions
diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/filters/ApplicationLoggingFilter.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/filters/ApplicationLoggingFilter.java
index 60837e8a7..331a44d83 100644
--- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/filters/ApplicationLoggingFilter.java
+++ b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/filters/ApplicationLoggingFilter.java
@@ -79,7 +79,7 @@ public class ApplicationLoggingFilter implements WebFilter {
header.add(BluePrintConstants.RESPONSE_HEADER_PATCH_VERSION, tokens[2]);
header.add(BluePrintConstants.RESPONSE_HEADER_LATEST_VERSION, appVersion);
} catch (Exception e) {
- e.printStackTrace();
+ log.error("*** Error ***", e);
}
return webFilterChain.filter(serverWebExchange);
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/cds/controllerblueprints/service/common/SwaggerGenerator.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/cds/controllerblueprints/service/common/SwaggerGenerator.java
index abf774981..38216a616 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/cds/controllerblueprints/service/common/SwaggerGenerator.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/cds/controllerblueprints/service/common/SwaggerGenerator.java
@@ -155,19 +155,16 @@ public class SwaggerGenerator {
defProperty = new StringProperty();
}
} else if (BluePrintTypes.validCollectionTypes().contains(propertyDefinition.getType())) {
- ArrayProperty arrayProperty = new ArrayProperty();
+ Optional<Property> innerType = Optional.empty();
if (propertyDefinition.getEntrySchema() != null) {
String entrySchema = propertyDefinition.getEntrySchema().getType();
if (!BluePrintTypes.validPrimitiveTypes().contains(entrySchema)) {
- Property innerType = new RefProperty("#/definitions/" + entrySchema);
- arrayProperty.setItems(innerType);
- } else {
- Property innerType = new StringProperty();
- arrayProperty.setItems(innerType);
+ innerType = Optional.of(new RefProperty("#/definitions/" + entrySchema));
}
- defProperty = arrayProperty;
}
-
+ ArrayProperty arrayProperty = new ArrayProperty();
+ arrayProperty.setItems(innerType.orElseGet(StringProperty::new));
+ defProperty = arrayProperty;
} else {
defProperty = new RefProperty("#/definitions/" + propertyDefinition.getType());
}