Moved field creation to the field declaration to avoid inadvertent change from LinkedHashMap to something else.
This commit is contained in:
parent
9531c662da
commit
61b9a2cb17
@ -36,13 +36,12 @@ public final class JsonObject extends JsonElement {
|
|||||||
// the order in which elements are inserted. This is needed to ensure
|
// 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
|
// that the fields of an object are inserted in the order they were
|
||||||
// defined in the class.
|
// defined in the class.
|
||||||
private final Map<String, JsonElement> members;
|
private final Map<String, JsonElement> members = new LinkedHashMap<String, JsonElement>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an empty JsonObject.
|
* Creates an empty JsonObject.
|
||||||
*/
|
*/
|
||||||
public JsonObject() {
|
public JsonObject() {
|
||||||
members = new LinkedHashMap<String, JsonElement>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user