ijokarumawak commented on a change in pull request #3305: NIFI-5950 Refactored 
shared logic for input and output port update
URL: https://github.com/apache/nifi/pull/3305#discussion_r268023883
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java
 ##########
 @@ -4716,16 +4740,21 @@ private void 
verifyNoDescendantsWithLocalModifications(final String action) {
 
                 if (modified) {
                     throw new IllegalStateException("Process Group cannot " + 
action + " because it contains a child or descendant Process Group that is 
under Version Control and "
-                        + "has local modifications. Each descendant Process 
Group that is under Version Control must first be reverted or have its changes 
pushed to the Flow Registry before "
-                        + "this action can be performed on the parent Process 
Group.");
+                            + "has local modifications. Each descendant 
Process Group that is under Version Control must first be reverted or have its 
changes pushed to the Flow Registry before "
+                            + "this action can be performed on the parent 
Process Group.");
                 }
 
                 if (flowState == VersionedFlowState.SYNC_FAILURE) {
                     throw new IllegalStateException("Process Group cannot " + 
action + " because it contains a child or descendant Process Group that is 
under Version Control and "
-                        + "is not synchronized with the Flow Registry. Each 
descendant Process Group must first be synchronized with the Flow Registry 
before this action can be "
-                        + "performed on the parent Process Group. NiFi will 
continue to attempt to communicate with the Flow Registry periodically in the 
background.");
+                            + "is not synchronized with the Flow Registry. 
Each descendant Process Group must first be synchronized with the Flow Registry 
before this action can be "
+                            + "performed on the parent Process Group. NiFi 
will continue to attempt to communicate with the Flow Registry periodically in 
the background.");
                 }
             }
         }
     }
 }
+
+@FunctionalInterface
+interface PortAdder<ProcessGroup, VersionedPort, String, Port> {
 
 Review comment:
   Currently `addInputPort` and `addOutputPort` still look identical.
   Also, `ProcessGroup destination` is always `this`. 
   We may be able to further refactor these, and if we do so, this `PortAdder` 
functional interface is not required.
   Here is my commit illustrating the idea. Please cherry-pick it if it looks 
good.
   
https://github.com/apache/nifi/commit/c18c075b257a751bf5f4c8393233dbd44ac23a33

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to