Skip to content

Commit

Permalink
Using LinkedHashMap to preserve property order.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmccullough committed Sep 8, 2014
1 parent 8114b97 commit 700f767
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions JSONObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ of this software and associated documentation files (the "Software"), to deal
import java.lang.reflect.Modifier;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
Expand Down Expand Up @@ -152,7 +152,7 @@ public String toString() {
* Construct an empty JSONObject.
*/
public JSONObject() {
this.map = new HashMap<String, Object>();
this.map = new LinkedHashMap<String, Object>();
}

/**
Expand Down Expand Up @@ -243,7 +243,7 @@ public JSONObject(JSONTokener x) throws JSONException {
* @throws JSONException
*/
public JSONObject(Map<String, Object> map) {
this.map = new HashMap<String, Object>();
this();
if (map != null) {
Iterator<Entry<String, Object>> i = map.entrySet().iterator();
while (i.hasNext()) {
Expand Down

0 comments on commit 700f767

Please sign in to comment.