diff --git a/src/main/java/org/bdware/sc/memory/MemoryDump.java b/src/main/java/org/bdware/sc/memory/MemoryDump.java index 87ee216..b6de25e 100644 --- a/src/main/java/org/bdware/sc/memory/MemoryDump.java +++ b/src/main/java/org/bdware/sc/memory/MemoryDump.java @@ -34,10 +34,7 @@ public class MemoryDump implements Serializable { } public static MemoryDump loadFromStr(String memDump) { - JsonElement jo = new com.google.gson.JsonParser().parse(memDump); -// JsonElement objs = jo.getAsJsonObject().get("objects"); -// JsonObject map = objs.getAsJsonObject(); - JsonObject map = jo.getAsJsonObject(); + JsonObject map = JsonUtil.parseString(memDump); MemoryDump ret = new MemoryDump(); for (Entry entry : map.entrySet()) { long id = Long.parseLong(entry.getKey()); @@ -66,7 +63,7 @@ public class MemoryDump implements Serializable { mo = JsonUtil.fromJson(obj, MemoryObject.class); break; default: - System.out.println("[MemoryDump] todo, missing type:" + type.toString()); + System.out.println("[MemoryDump] todo, missing type:" + type); break; } ret.objects.put(id, mo); @@ -221,7 +218,7 @@ public class MemoryDump implements Serializable { obj = Double.parseDouble(mo.data.toString()); break; default: - System.out.println("[MemoryDump] todo, missing type:" + mo.type.toString()); + System.out.println("[MemoryDump] todo, missing type:" + mo.type); break; }