You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by kd...@apache.org on 2019/06/06 14:45:53 UTC
[nifi-registry] branch master updated: NIFIREG-275 Making
FlowComparator compare PGs when both have no coordinates,
or when they both have coordinates and are different
This is an automated email from the ASF dual-hosted git repository.
kdoran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-registry.git
The following commit(s) were added to refs/heads/master by this push:
new 71a42fd NIFIREG-275 Making FlowComparator compare PGs when both have no coordinates, or when they both have coordinates and are different
71a42fd is described below
commit 71a42fd2fff2902e655de011b359e7c58d951fff
Author: Bryan Bende <bb...@apache.org>
AuthorDate: Tue May 28 16:41:41 2019 -0400
NIFIREG-275 Making FlowComparator compare PGs when both have no coordinates, or when they both have coordinates and are different
This closes #192.
Signed-off-by: Kevin Doran <kd...@apache.org>
---
.../org/apache/nifi/registry/flow/diff/StandardFlowComparator.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/nifi-registry-core/nifi-registry-flow-diff/src/main/java/org/apache/nifi/registry/flow/diff/StandardFlowComparator.java b/nifi-registry-core/nifi-registry-flow-diff/src/main/java/org/apache/nifi/registry/flow/diff/StandardFlowComparator.java
index 82c00e5..c38faef 100644
--- a/nifi-registry-core/nifi-registry-flow-diff/src/main/java/org/apache/nifi/registry/flow/diff/StandardFlowComparator.java
+++ b/nifi-registry-core/nifi-registry-flow-diff/src/main/java/org/apache/nifi/registry/flow/diff/StandardFlowComparator.java
@@ -20,6 +20,7 @@ package org.apache.nifi.registry.flow.diff;
import org.apache.nifi.registry.flow.VersionedComponent;
import org.apache.nifi.registry.flow.VersionedConnection;
import org.apache.nifi.registry.flow.VersionedControllerService;
+import org.apache.nifi.registry.flow.VersionedFlowCoordinates;
import org.apache.nifi.registry.flow.VersionedFunnel;
import org.apache.nifi.registry.flow.VersionedLabel;
import org.apache.nifi.registry.flow.VersionedPort;
@@ -303,7 +304,11 @@ public class StandardFlowComparator implements FlowComparator {
addIfDifferent(differences, DifferenceType.VERSIONED_FLOW_COORDINATES_CHANGED, groupA, groupB, VersionedProcessGroup::getVersionedFlowCoordinates);
- if (groupA.getVersionedFlowCoordinates() == null && groupB.getVersionedFlowCoordinates() == null) {
+ final VersionedFlowCoordinates groupACoordinates = groupA.getVersionedFlowCoordinates();
+ final VersionedFlowCoordinates groupBCoordinates = groupB.getVersionedFlowCoordinates();
+
+ if ((groupACoordinates == null && groupBCoordinates == null)
+ || (groupACoordinates != null && groupBCoordinates != null && !groupACoordinates.equals(groupBCoordinates)) ) {
differences.addAll(compareComponents(groupA.getConnections(), groupB.getConnections(), this::compare));
differences.addAll(compareComponents(groupA.getProcessors(), groupB.getProcessors(), this::compare));
differences.addAll(compareComponents(groupA.getControllerServices(), groupB.getControllerServices(), this::compare));