Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
keep order in returned Map entries
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangsa committed Mar 22, 2023
1 parent d9c5946 commit d73106f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/io/zenwave360/jhipster/jdl/JDLParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -66,7 +67,7 @@ public static String jdlToMermaid(String JDL, Map<String, String> configuration)

private static Object copy(Object source) {
if(source instanceof Map) {
source = new HashMap<>((Map) source);
source = new LinkedHashMap<>((Map) source);
((HashMap<String, Object>) source).entrySet().forEach(e -> e.setValue(copy(e.getValue())));
} else if(source instanceof List) {
source = new ArrayList<>((List) source);
Expand Down

0 comments on commit d73106f

Please sign in to comment.