Skip to content

Commit

Permalink
Create a LinkedTreeMap based on the LinkedHashTreeMap; however, remov…
Browse files Browse the repository at this point in the history
…ed all the hashing from it as resorted to a single tree. The insertion order is still preserved.
  • Loading branch information
joel-leitch committed May 3, 2013
1 parent 7c9fd53 commit f29d5bc
Show file tree
Hide file tree
Showing 5 changed files with 784 additions and 7 deletions.
6 changes: 3 additions & 3 deletions gson/src/main/java/com/google/gson/JsonObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.google.gson;

import com.google.gson.internal.LinkedHashTreeMap;
import com.google.gson.internal.LinkedTreeMap;

import java.util.Map;
import java.util.Set;
Expand All @@ -30,8 +30,8 @@
* @author Joel Leitch
*/
public final class JsonObject extends JsonElement {
private final LinkedHashTreeMap<String, JsonElement> members =
new LinkedHashTreeMap<String, JsonElement>();
private final LinkedTreeMap<String, JsonElement> members =
new LinkedTreeMap<String, JsonElement>();

@Override
JsonObject deepCopy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public T construct() {
} else {
return new ObjectConstructor<T>() {
public T construct() {
return (T) new LinkedHashTreeMap<String, Object>();
return (T) new LinkedTreeMap<String, Object>();
}
};
}
Expand All @@ -197,7 +197,6 @@ public T construct() {
return null;
}


private <T> ObjectConstructor<T> newUnsafeAllocator(
final Type type, final Class<? super T> rawType) {
return new ObjectConstructor<T>() {
Expand Down
Loading

0 comments on commit f29d5bc

Please sign in to comment.