I have to use cls variable to some method.
Class<CommonResult<Cat>> cls = (Class<CommonResult<Cat>>) ((Class) CommonResult.class);
but, this code line displays this warnings.
- Class is a raw type. References to generic type Class should be parameterized
- Type safety: Unchecked cast from Class to
CommonResult is generic class. I want to remove these warnings. what is the best modification to remove this warnings? I want to know a method to fix it in code level not in annotation.