Why does GenericEntity only support one generic parameter? i.e.
List<String>? Why are we narrowing the superclass generic type to a
ParameterizedType and getting the first parameterized value? There's no
reason we couldn't have a Map as an entity object.
The constructor should really be:
protected GenericEntity(T entity)
{
if (entity == null)
{
throw new IllegalArgumentException("The entity must not be null");
}
this.entity = entity;
this.type = getClass().getGenericSuperclass();
this.rawType = entity.getClass();
}
Logged issue here:
https://jsr311.dev.java.net/issues/show_bug.cgi?id=47
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com