Support Boolean property in BindingReflectionHintsRegistrar

Closes gh-33380
This commit is contained in:
Sébastien Deleuze
2024-08-16 14:37:12 +02:00
parent 1634e63506
commit 46c29b9175
2 changed files with 7 additions and 4 deletions

View File

@@ -107,7 +107,8 @@ public class BindingReflectionHintsRegistrar {
registerPropertyHints(hints, seen, method, 0);
}
else if ((methodName.startsWith("get") && method.getParameterCount() == 0 && method.getReturnType() != void.class) ||
(methodName.startsWith("is") && method.getParameterCount() == 0 && method.getReturnType() == boolean.class)) {
(methodName.startsWith("is") && method.getParameterCount() == 0
&& ClassUtils.resolvePrimitiveIfNecessary(method.getReturnType()) == Boolean.class)) {
registerPropertyHints(hints, seen, method, -1);
}
}