NIFI-10682: When determining effective property values, ensure that we always use the up-to-date version of Property Descriptors (#6567)

This closes #6567
This commit is contained in:
markap14 2022-10-24 09:59:16 -04:00 committed by GitHub
parent f23318a361
commit d64574b565
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -580,11 +580,15 @@ public abstract class AbstractComponentNode implements ComponentNode {
final Map<PropertyDescriptor, String> props = new LinkedHashMap<>();
for (final PropertyDescriptor descriptor : supported) {
if (descriptor != null) {
props.put(descriptor, descriptor.getDefaultValue());
final PropertyDescriptor upToDateDescriptor = getPropertyDescriptor(descriptor.getName());
props.put(upToDateDescriptor, upToDateDescriptor.getDefaultValue());
}
}
properties.forEach((descriptor, config) -> props.put(getPropertyDescriptor(descriptor.getName()), valueFunction.apply(descriptor, config)));
properties.forEach((descriptor, config) -> {
final PropertyDescriptor upToDateDescriptor = getPropertyDescriptor(descriptor.getName());
props.put(upToDateDescriptor, valueFunction.apply(upToDateDescriptor, config));
});
return props;
}
}