Skip to content

Commit 82ec38b

Browse files
cmcquillentonygermano
authored andcommitted
Preserve order in HTTP parameter Map
The HttpUtil.getTableMap method creates and returns a copy of a Map. This commit changes the new Map instance from a HashMap to a LinkedHashMap in order to preserve the iteration order of the original Map being copied. Issue: nextgenhealthcare/connect#6276 Original-pull-request: nextgenhealthcare/connect#6296 Signed-off-by: Tony Germano <tony@germano.name>
1 parent 141e612 commit 82ec38b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎server/src/com/mirth/connect/util/HttpUtil.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
importjava.nio.charset.Charset;
1313
importjava.util.ArrayList;
14-
importjava.util.HashMap;
14+
importjava.util.LinkedHashMap;
1515
importjava.util.List;
1616
importjava.util.Map;
1717
importjava.util.Map.Entry;
@@ -104,7 +104,7 @@ public static Map<String, List<String>> getTableMap(boolean useVariable, String
104104
}
105105

106106
publicstaticMap<String, List<String>> getTableMap(StringmapVariable, MessageMapsmessageMaps, ConnectorMessageconnectorMessage) {
107-
Map<String, List<String>> map = newHashMap<String, List<String>>();
107+
Map<String, List<String>> map = newLinkedHashMap<String, List<String>>();
108108

109109
try {
110110
Map<?, ?> source = (Map<?, ?>) messageMaps.get(mapVariable, connectorMessage);

0 commit comments

Comments
 (0)