Moved field creation to the field declaration to avoid inadvertent change from LinkedHashMap to something else.

This commit is contained in:
Inderjeet Singh 2011-05-30 09:01:45 +00:00
parent 9531c662da
commit 61b9a2cb17

View File

@ -36,13 +36,12 @@ public final class JsonObject extends JsonElement {
// the order in which elements are inserted. This is needed to ensure
// that the fields of an object are inserted in the order they were
// defined in the class.
private final Map<String, JsonElement> members;
private final Map<String, JsonElement> members = new LinkedHashMap<String, JsonElement>();
/**
* Creates an empty JsonObject.
*/
public JsonObject() {
members = new LinkedHashMap<String, JsonElement>();
}
/**