mcgilman commented on code in PR #10782:
URL: https://github.com/apache/nifi/pull/10782#discussion_r2708550380


##########
nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/components/validation/ValidationState.java:
##########
@@ -17,17 +17,29 @@
 
 package org.apache.nifi.components.validation;
 
-import java.util.Collection;
-
 import org.apache.nifi.components.ValidationResult;
 
+import java.util.Collection;
+import java.util.Collections;
+
 public class ValidationState {
     private final ValidationStatus status;
     private final Collection<ValidationResult> validationErrors;
 
-    public ValidationState(final ValidationStatus status, final 
Collection<ValidationResult> validationErrors) {
+    public ValidationState(final ValidationStatus status, final 
Collection<ValidationResult> validationResults) {
         this.status = status;
-        this.validationErrors = validationErrors;
+        // Ensure that if we are provided any valid results, they are filtered 
out because we only want to store validation failures.
+        this.validationErrors = removeValidResults(validationResults);

Review Comment:
   With this change, do we still need to filter out valid results in 
`StandardConnectorNode.createStartAction` and `StandardConnectorNode.verify`?



##########
nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractComponentNode.java:
##########
@@ -892,7 +892,7 @@ public final ValidationStatus performValidation() {
     }
 
     protected Collection<ValidationResult> computeValidationErrors(final 
ValidationContext validationContext) {
-        Throwable failureCause = null;
+        Throwable failureCause;

Review Comment:
   This comment isn't about this line but this is the closest I could comment 
on it. Above in `performValidation` we have the following line:
   
   `final ValidationStatus status = results.isEmpty() ? ValidationStatus.VALID 
: ValidationStatus.INVALID;`
   
   I _think_ a Connector with only valid results would be incorrectly marked as 
`INVALID`.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to