Java generics: What is the compiler's issue here? (“no unique maximal instance”)

前端 未结 4 1371
无人及你
无人及你 2021-02-20 18:00

I have the following methods:

public  T fromJson( Reader jsonData, Class clazz ) {
    return fromJson( jsonData, (Type)clazz );
}

public <         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-20 18:21

    I encountered the same problem and found it was a bug (#6302954) in the JDK. It was fixed in jdk 6u25.

    I worked around one of the instances of this problem but decided to update the JDK version on the CI box instead.

提交回复
热议问题