You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Might be related to #599, but the symptoms are different and the proposed workaround does not work. Take the example posted there, but with a static factory method:
public class RuleResponse<T> {
private T result;
@JsonbCreator
public static <T> RuleResponse<T> of(@JsonbProperty("result") T result) {
final RuleRespone<T> response = new RuleRespone<T>();
response.result = result;
return response;
}
public T getResult() {
return result;
}
}
Then,
JsonbBuilder.create().fromJson(
expectedJson,
new TypeLiteral<RuleResponse<Integer>>() {
private static final long serialVersionUID = 1L;
}
.getType()
);
attempts to set RuleResponse#result to a BigDecimal instead of an Integer.
This is caused by VariableTypeInheritanceSearch#searchRuntimeTypeArgument due to this block:
if (ReflectionUtils.getRawType(runtimeType) != typeVar.getGenericDeclaration()) {
return null;
}
typeVar.getGenericDeclaration() returns a Method, thus that test will always fail. It is unclear why this test is there. Simply removing it should result in correct resolution.
The text was updated successfully, but these errors were encountered:
Might be related to #599, but the symptoms are different and the proposed workaround does not work. Take the example posted there, but with a static factory method:
Then,
attempts to set
RuleResponse#result
to aBigDecimal
instead of anInteger
.This is caused by
VariableTypeInheritanceSearch#searchRuntimeTypeArgument
due to this block:typeVar.getGenericDeclaration()
returns aMethod
, thus that test will always fail. It is unclear why this test is there. Simply removing it should result in correct resolution.The text was updated successfully, but these errors were encountered: