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 2019/06/25 17:49:47 UTC

[GitHub] [nifi] mcgilman commented on a change in pull request #3544: NIFI-6028: Updates to ignore changes between local version of a flow …

mcgilman commented on a change in pull request #3544: NIFI-6028: Updates to ignore changes between local version of a flow …
URL: https://github.com/apache/nifi/pull/3544#discussion_r297312170
 
 

 ##########
 File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/FlowDifferenceFilters.java
 ##########
 @@ -113,4 +117,145 @@ public static boolean isIgnorableVersionedFlowCoordinateChange(final FlowDiffere
 
         return false;
     }
+
+
+    public static boolean isNewPropertyWithDefaultValue(final FlowDifference fd, final FlowManager flowManager) {
+        if (fd.getDifferenceType() != DifferenceType.PROPERTY_ADDED) {
+            return false;
+        }
+
+        final VersionedComponent componentB = fd.getComponentB();
+
+        if (componentB instanceof InstantiatedVersionedProcessor) {
+            final InstantiatedVersionedProcessor instantiatedProcessor = (InstantiatedVersionedProcessor) componentB;
+            final ProcessorNode processorNode = flowManager.getProcessorNode(instantiatedProcessor.getInstanceId());
+            return isNewPropertyWithDefaultValue(fd, processorNode);
+        } else if (componentB instanceof InstantiatedVersionedControllerService) {
+            final InstantiatedVersionedControllerService instantiatedControllerService = (InstantiatedVersionedControllerService) componentB;
+            final ControllerServiceNode controllerService = flowManager.getControllerServiceNode(instantiatedControllerService.getInstanceId());
+            return isNewPropertyWithDefaultValue(fd, controllerService);
+        }
+
+        return false;
+    }
+
+    private static boolean isNewPropertyWithDefaultValue(final FlowDifference fd, final ProcessorNode processorNode) {
 
 Review comment:
   This method appears to be overloaded below. However, the parameter that differs shares a common ancestor interface. I _think_ we can update the args to use a `ComponentNode` and remove the duplicated code.

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


With regards,
Apache Git Services