You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2020/05/20 14:50:01 UTC

[nifi] branch master updated: NIFI-7471 fix bug with property validation

This is an automated email from the ASF dual-hosted git repository.

markap14 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/master by this push:
     new 7034d7e  NIFI-7471 fix bug with property validation
7034d7e is described below

commit 7034d7e44c0644fb126136b503da4c11d6c41aff
Author: KovalevIV <El...@yandex.ru>
AuthorDate: Tue May 19 21:57:47 2020 +0300

    NIFI-7471 fix bug with property validation
---
 .../controller/state/manager/StandardStateManagerProvider.java     | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/manager/StandardStateManagerProvider.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/manager/StandardStateManagerProvider.java
index a8d96a3..a43728d 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/manager/StandardStateManagerProvider.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/manager/StandardStateManagerProvider.java
@@ -197,6 +197,7 @@ public class StandardStateManagerProvider implements StateManagerProvider{
         final ParameterParser parser = new ExpressionLanguageAwareParameterParser();
         final Map<PropertyDescriptor, PropertyValue> propertyMap = new HashMap<>();
         final Map<PropertyDescriptor, PropertyConfiguration> propertyStringMap = new HashMap<>();
+        //set default configuration
         for (final PropertyDescriptor descriptor : provider.getPropertyDescriptors()) {
             propertyMap.put(descriptor, new StandardPropertyValue(descriptor.getDefaultValue(),null, parameterLookup, variableRegistry));
 
@@ -205,12 +206,12 @@ public class StandardStateManagerProvider implements StateManagerProvider{
 
             propertyStringMap.put(descriptor, configuration);
         }
-
+        //set properties from actual configuration
         for (final Map.Entry<String, String> entry : providerConfig.getProperties().entrySet()) {
             final PropertyDescriptor descriptor = provider.getPropertyDescriptor(entry.getKey());
 
-            final ParameterTokenList references = parser.parseTokens(descriptor.getDefaultValue());
-            final PropertyConfiguration configuration = new PropertyConfiguration(descriptor.getDefaultValue(), references, references.toReferenceList());
+            final ParameterTokenList references = parser.parseTokens(entry.getValue());
+            final PropertyConfiguration configuration = new PropertyConfiguration(entry.getValue(), references, references.toReferenceList());
 
             propertyStringMap.put(descriptor, configuration);
             propertyMap.put(descriptor, new StandardPropertyValue(entry.getValue(),null, parameterLookup, variableRegistry));