From c16c8db4594e977320a2fc8c29501ac40933ec87 Mon Sep 17 00:00:00 2001 From: Richard Miskin Date: Tue, 26 Jan 2016 05:35:07 +0000 Subject: [PATCH] NIFI-1421 Make namespace ordering deterministic in SplitXML --- .../java/org/apache/nifi/processors/standard/SplitXml.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitXml.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitXml.java index cfe923bdd1..b503f9bef5 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitXml.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitXml.java @@ -21,11 +21,12 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.TreeMap; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; @@ -195,7 +196,7 @@ public class SplitXml extends AbstractProcessor { private final int splitDepth; private final StringBuilder sb = new StringBuilder(XML_PROLOGUE); private int depth = 0; - private HashMap prefixMap = new HashMap<>(); + private Map prefixMap = new TreeMap<>(); public XmlSplitterSaxParser(XmlElementNotifier notifier, int splitDepth) { this.notifier = notifier;