Closed GoogleCodeExporter closed 9 years ago
In hindsight, this is a bad idea. The only advantage of GenericData over Map
is that it allows you to mix reflected fields with an arbitrary map. But if we
add a type parameter, there is no compile-time checking of field types matches
the type parameter. For example, even though this is clearly wrong, it would
compile without warning and likely cause problems at runtime:
public class A extends GenericData<String> {
@Key Integer num;
}
So really what we want developers to do for the above case:
public class Entry {
@Key Map<String, List<Link>> links;
}
This should already be supported now.
Original comment by yan...@google.com
on 13 Apr 2011 at 12:18
Original issue reported on code.google.com by
yan...@google.com
on 13 Apr 2011 at 1:33