Hi everyone,
one never stops learning...
I've been using more and more embedded objects and collections with JSON serialization.
Some observations:
1) Arrays of Objects can be serialized but they fail to deserialize. Solution: use List instead of []
2) embedded collections can be persisted but if a generic type is set, they fail to deserialize. Example:
public Map<String, List> map1; // this works
public Map<String, List<String> map2; // this fails
The problem is in JsonSerializer, line 323:
map.put(key, deserialize(Util.getGenericClass(f, 1), data.get(key)));
In Util.getGenericClass(), this call here returns an array of types:
Type[] fieldArgTypes = aType.getActualTypeArguments();
If the generic type is added, the returned type is no longer a Class<?> but instead a ParametrizedTypeImpl.
I'm sure this thing can be fixed, but I can't be bothered for now.
Also, since I then re-serialize to JSON, it'd be nice to do something like Pascal does:
but without using Scala :-)
By the way, I've imported the history of Siena before GitHub from GoogleCode and I've managed to merge it locally.
The problem is that the tree structure doesn't match, so it's a pretty useless excercise.
I've tried to commit a change to the tree structure back in time (before the first GitHub commit) but that looks impossibile (I can change the authoring data but not the commit date). It'd be nice to have a full history of this project. If you have any suggestions, please let me know.