I have the following methods:
public T fromJson( Reader jsonData, Class clazz ) {
return fromJson( jsonData, (Type)clazz );
}
public <
This seems like a failure of inference. The first method clearly intends to call the second method with the type argument being the same type parameter T
that it has. But probably the compiler can't figure it out because its inference system is not good enough.
In any case, you should be able to explicitly specify the type argument and it should get rid of the error:
public T fromJson( Reader jsonData, Class clazz ) {
return this.fromJson( jsonData, (Type)clazz );
}