diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java index 5437d44956..792e06cc09 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java @@ -1556,8 +1556,8 @@ public final class DtoFactory { orderedProperties.putAll(sortedProperties); // build the descriptor and property dtos - dto.setDescriptors(new LinkedHashMap()); - dto.setProperties(new LinkedHashMap()); + dto.setDescriptors(new LinkedHashMap<>()); + dto.setProperties(new LinkedHashMap<>()); for (final Map.Entry entry : orderedProperties.entrySet()) { final PropertyDescriptor descriptor = entry.getKey(); @@ -1568,6 +1568,8 @@ public final class DtoFactory { String propertyValue = entry.getValue(); if (propertyValue != null && descriptor.isSensitive()) { propertyValue = SENSITIVE_VALUE_MASK; + } else if (propertyValue == null && descriptor.getDefaultValue() != null) { + propertyValue = descriptor.getDefaultValue(); } // set the property value @@ -1636,8 +1638,8 @@ public final class DtoFactory { orderedProperties.putAll(sortedProperties); // build the descriptor and property dtos - dto.setDescriptors(new LinkedHashMap()); - dto.setProperties(new LinkedHashMap()); + dto.setDescriptors(new LinkedHashMap<>()); + dto.setProperties(new LinkedHashMap<>()); for (final Map.Entry entry : orderedProperties.entrySet()) { final PropertyDescriptor descriptor = entry.getKey(); @@ -1649,6 +1651,8 @@ public final class DtoFactory { String propertyValue = entry.getValue(); if (propertyValue != null && descriptor.isSensitive()) { propertyValue = SENSITIVE_VALUE_MASK; + } else if (propertyValue == null && descriptor.getDefaultValue() != null) { + propertyValue = descriptor.getDefaultValue(); } // set the property value