From 210a21cd8f13fd477a595dc6c83cffce0b6be3e0 Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Wed, 14 Jan 2015 12:19:50 -0500 Subject: [PATCH] NIFI-261: Sort processor properties before fingerprinting for templates --- .../org/apache/nifi/fingerprint/FingerprintFactory.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nar-bundles/framework-bundle/framework/core/src/main/java/org/apache/nifi/fingerprint/FingerprintFactory.java b/nar-bundles/framework-bundle/framework/core/src/main/java/org/apache/nifi/fingerprint/FingerprintFactory.java index 7bdf278373..85755691f2 100644 --- a/nar-bundles/framework-bundle/framework/core/src/main/java/org/apache/nifi/fingerprint/FingerprintFactory.java +++ b/nar-bundles/framework-bundle/framework/core/src/main/java/org/apache/nifi/fingerprint/FingerprintFactory.java @@ -29,6 +29,8 @@ import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; import java.util.UUID; import javax.xml.XMLConstants; @@ -57,7 +59,6 @@ import org.apache.nifi.web.api.dto.RemoteProcessGroupContentsDTO; import org.apache.nifi.web.api.dto.RemoteProcessGroupDTO; import org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO; import org.apache.nifi.web.api.dto.TemplateDTO; - import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -510,7 +511,8 @@ public final class FingerprintFactory { if (config.getProperties() == null) { builder.append("NO_PROPERTIES"); } else { - for (final Map.Entry entry : config.getProperties().entrySet()) { + final SortedMap sortedProps = new TreeMap<>(config.getProperties()); + for (final Map.Entry entry : sortedProps.entrySet()) { final String propName = entry.getKey(); final String propValue = entry.getValue(); if (propValue == null) {