The signature of om.google.api.client.util.Data#nullOf(Class) doesn't make
sense. The existing signature is:
<T> T nullOf(Class<?> objClass);
If the return type's class should always be the same as objClass, the signature
should be:
<T> T nullOf(Class<T> objClass);
If that isn't true, the signature should be:
Object nullOf(Class<T> objClass);
In the second case, callers can perform explicit casts as necessary. The
current behaviour results in an implicit unchecked cast at the callsite.
The existing signature also interacts badly with the improved target-type
inference in Java 8.
Original issue reported on code.google.com by cus...@google.com on 12 Nov 2014 at 11:52
Original issue reported on code.google.com by
cus...@google.com
on 12 Nov 2014 at 11:52