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

前端 未结 4 2004
轻奢々
轻奢々 2021-02-20 17:41

I have the following methods:

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

public <         


        
4条回答
  •  粉色の甜心
    2021-02-20 18:23

    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.

提交回复
热议问题