dev@jsr311.java.net

GenericEntity can only support one parameter

From: Bill Burke <bburke_at_redhat.com>
Date: Wed, 20 Aug 2008 15:59:39 -0400

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