NIFI-2684 - Change AbstractConfigurableComponent to use displayName when available

This commit is contained in:
Andre F de Miranda 2016-09-11 21:45:02 +10:00 committed by Matt Burgess
parent 8f928e5d6e
commit ef2c50577d
1 changed files with 3 additions and 1 deletions

View File

@ -91,7 +91,9 @@ public abstract class AbstractConfigurableComponent implements ConfigurableCompo
value = descriptor.getDefaultValue();
}
if (value == null && descriptor.isRequired()) {
results.add(new ValidationResult.Builder().valid(false).input(null).subject(descriptor.getName()).explanation(descriptor.getName() + " is required").build());
ValidationResult.Builder builder = new ValidationResult.Builder().valid(false).input(null).subject(descriptor.getDisplayName());
builder = (descriptor.getDisplayName() != null) ? builder.explanation(descriptor.getDisplayName() + " is required") : builder.explanation(descriptor.getName() + " is required");
results.add(builder.build());
continue;
} else if (value == null) {
continue;