Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing type arguments for generic class Class<T> where T is a type-variable

I use Oracle JDK 7 and when I build project I get that message:

missing type arguments for generic class Class<T> where T is a type-variable: 
T extends Object declared in class Class

Here is the class:

public class Among {
private static final Class<?>[] EMPTY_PARAMS = new Class[0]; //warning line

Any ideas how to solve it. It is used at many places and I have many warnings.

like image 232
kamaci Avatar asked Apr 04 '13 20:04

kamaci


1 Answers

private static final Class<?>[] EMPTY_PARAMS = new Class<?>[0];

Note the <?> at the instantiation of the array.

like image 93
pholser Avatar answered Oct 25 '22 07:10

pholser