diff options
Diffstat (limited to 'logo/src/xlogo/storage/JSONSerializer.java')
-rw-r--r-- | logo/src/xlogo/storage/JSONSerializer.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/logo/src/xlogo/storage/JSONSerializer.java b/logo/src/xlogo/storage/JSONSerializer.java index 2766da4..0711b8d 100644 --- a/logo/src/xlogo/storage/JSONSerializer.java +++ b/logo/src/xlogo/storage/JSONSerializer.java @@ -11,11 +11,13 @@ public abstract class JSONSerializer<T> implements Serializer<T>{ @Override
public T deserialize(String json) {
- return deserialize(new JSONObject(json));
+ return deserialize(new JSONObject(json.trim()));
}
@Override
public String serialize2String(T target) {
- return serialize2JSON(target).toString();
+ JSONObject json = serialize2JSON(target);
+ String serialized = json.toString();
+ return serialized;
}
}
|