From d73106f1f677d547695b70607a155a5ea1099a67 Mon Sep 17 00:00:00 2001 From: Ivan Garcia Sainz-Aja Date: Wed, 22 Mar 2023 18:21:36 +0100 Subject: [PATCH] keep order in returned Map entries --- src/main/java/io/zenwave360/jhipster/jdl/JDLParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/zenwave360/jhipster/jdl/JDLParser.java b/src/main/java/io/zenwave360/jhipster/jdl/JDLParser.java index 028047e..0e8d264 100644 --- a/src/main/java/io/zenwave360/jhipster/jdl/JDLParser.java +++ b/src/main/java/io/zenwave360/jhipster/jdl/JDLParser.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -66,7 +67,7 @@ public static String jdlToMermaid(String JDL, Map configuration) private static Object copy(Object source) { if(source instanceof Map) { - source = new HashMap<>((Map) source); + source = new LinkedHashMap<>((Map) source); ((HashMap) source).entrySet().forEach(e -> e.setValue(copy(e.getValue()))); } else if(source instanceof List) { source = new ArrayList<>((List) source);