You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/06/18 22:11:18 UTC

[GitHub] [nifi] exceptionfactory commented on a change in pull request #5147: NIFI-8683 support Expression Language for the Truststore/Keystore pro…

exceptionfactory commented on a change in pull request #5147:
URL: https://github.com/apache/nifi/pull/5147#discussion_r654694783



##########
File path: nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-service/src/main/java/org/apache/nifi/ssl/StandardSSLContextService.java
##########
@@ -185,14 +191,24 @@ public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, S
             }
         }
 
-        results.addAll(validateStore(validationContext.getProperties(), KeystoreValidationGroup.KEYSTORE));
-        results.addAll(validateStore(validationContext.getProperties(), KeystoreValidationGroup.TRUSTSTORE));
+        final Map<PropertyDescriptor, String> properties = evaluateProperties(validationContext.getProperties(), validationContext);
+        results.addAll(validateStore(properties, KeystoreValidationGroup.KEYSTORE));
+        results.addAll(validateStore(properties, KeystoreValidationGroup.TRUSTSTORE));
 
         isValidated = results.isEmpty();
 
         return results;
     }
 
+    private Map<PropertyDescriptor, String> evaluateProperties(final Map<PropertyDescriptor, String> properties, final PropertyContext context) {

Review comment:
       Is there a reason for passing the Map of properties as a separate parameter from the PropertyContext as opposed to just passing the PropertyContext and then calling getProperties() in this method?

##########
File path: nifi-nar-bundles/nifi-standard-services/nifi-ssl-context-bundle/nifi-ssl-context-service/src/main/java/org/apache/nifi/ssl/StandardSSLContextService.java
##########
@@ -582,6 +598,6 @@ public String toString() {
             allowableValues.add(new AllowableValue(supportedProtocol, supportedProtocol, description));
         }
 
-        return allowableValues.toArray(new AllowableValue[allowableValues.size()]);
+        return allowableValues.toArray(new AllowableValue[0]);

Review comment:
       Is there a reason for changing the AllowableValue array size to 0 here?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org