diff --git a/JSONObject.java b/JSONObject.java index a1ed4901c..7dcff6d40 100644 --- a/JSONObject.java +++ b/JSONObject.java @@ -46,6 +46,7 @@ of this software and associated documentation files (the "Software"), to deal import java.util.ResourceBundle; import java.util.Set; import java.util.regex.Pattern; +import java.util.LinkedHashMap; /** * A JSONObject is an unordered collection of name/value pairs. Its external @@ -161,7 +162,7 @@ public String toString() { /** * The map where the JSONObject's properties are kept. */ - private final Map map; + protected final Map map; /** * It is sometimes more convenient and less ambiguous to have a @@ -181,7 +182,7 @@ public JSONObject() { // implementations to rearrange their items for a faster element // retrieval based on associative access. // Therefore, an implementation mustn't rely on the order of the item. - this.map = new HashMap(); + this.map = new LinkedHashMap(); } /**