From 5c2df42be32d9baee518fcc9bb0e47b25ab93882 Mon Sep 17 00:00:00 2001 From: Mark Bean Date: Wed, 14 Apr 2021 16:33:34 +0000 Subject: [PATCH] NIFI-8431: remove redundant validation of dynamic properties removed unused variable Signed-off-by: Matthew Burgess This closes #5045 --- .../components/AbstractConfigurableComponent.java | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/nifi-api/src/main/java/org/apache/nifi/components/AbstractConfigurableComponent.java b/nifi-api/src/main/java/org/apache/nifi/components/AbstractConfigurableComponent.java index 1daeb43e95..a14dcfcb20 100644 --- a/nifi-api/src/main/java/org/apache/nifi/components/AbstractConfigurableComponent.java +++ b/nifi-api/src/main/java/org/apache/nifi/components/AbstractConfigurableComponent.java @@ -20,7 +20,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.Set; public abstract class AbstractConfigurableComponent implements ConfigurableComponent { @@ -93,7 +92,6 @@ public abstract class AbstractConfigurableComponent implements ConfigurableCompo // goes through context properties, should match supported properties + supported dynamic properties final Collection results = new ArrayList<>(); final Set contextDescriptors = context.getProperties().keySet(); - final List supportedDescriptors = getSupportedPropertyDescriptors(); for (final PropertyDescriptor descriptor : contextDescriptors) { // If the property descriptor's dependency is not satisfied, the property does not need to be considered, as it's not relevant to the @@ -126,19 +124,6 @@ public abstract class AbstractConfigurableComponent implements ConfigurableCompo } } - // validate any dynamic properties - for (final Map.Entry entry : context.getProperties().entrySet()) { - final PropertyDescriptor descriptor = entry.getKey(); - final String value = entry.getValue(); - - if (supportedDescriptors != null && !supportedDescriptors.contains(descriptor)) { - final ValidationResult result = descriptor.validate(value, context); - if (!result.isValid()) { - results.add(result); - } - } - } - // only run customValidate if regular validation is successful. This allows Processor developers to not have to check // if values are null or invalid so that they can focus only on the interaction between the properties, etc. if (results.isEmpty()) {