Browse Source

GsonProvider

pull/55/head
Kalle Stenflo 10 years ago
parent
commit
0c68aa8615
  1. 5
      json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/GsonProvider.java

5
json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/GsonProvider.java

@ -23,7 +23,6 @@ public class GsonProvider extends AbstractJsonProvider {
private static final JsonParser parser = new JsonParser(); private static final JsonParser parser = new JsonParser();
private static final Gson gson = new Gson(); private static final Gson gson = new Gson();
public Object unwrap(Object o){ public Object unwrap(Object o){
if(o == null){ if(o == null){
return null; return null;
@ -90,7 +89,7 @@ public class GsonProvider extends AbstractJsonProvider {
@Override @Override
public String toJson(Object obj) { public String toJson(Object obj) {
return ((JsonElement)obj).toString(); return obj.toString();
} }
@Override @Override
@ -113,6 +112,7 @@ public class GsonProvider extends AbstractJsonProvider {
return toJsonArray(obj).get(idx); return toJsonArray(obj).get(idx);
} }
@Override @Override
public Object getMapValue(Object obj, String key) { public Object getMapValue(Object obj, String key) {
Object o = toJsonObject(obj).get(key); Object o = toJsonObject(obj).get(key);
@ -140,7 +140,6 @@ public class GsonProvider extends AbstractJsonProvider {
} else { } else {
array.set(index, toJsonElement(value)); array.set(index, toJsonElement(value));
} }
} }
} }

Loading…
Cancel
Save