I was able to reproduce the bug using hibernates own test classes: In org/hibernate/orm/test/sql/exec/SmokeTests.java replace
public static class BasicSetterBasedDto {
private String code;
private String value;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
with
public static class BasicSetterBasedDto<T> {
private T code;
private T value;
public BasicSetterBasedDto() {
}
public BasicSetterBasedDto(T code, T value) {
this.code = code;
this.value = value;
}
public T getCode() {
return code;
}
public void setCode(T code) {
this.code = code;
}
public T getValue() {
return value;
}
public void setValue(T value) {
this.value = value;
}
}
and one test will fail with: java.lang.ClassCastException: class sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to class java.lang.reflect.ParameterizedType (sun.reflect.generics.reflectiveObjects.TypeVariableImpl and java.lang.reflect.ParameterizedType are in module java.base of loader 'bootstrap') Removing the constructors avoids the problem. |