Skip to content

Commit 431c7ff

Browse files
committed
SpEL correctly handles "is" accessors with Boolean return type
Issue: SPR-10091
1 parent bda0705 commit 431c7ff

File tree

2 files changed

+194
-146
lines changed

2 files changed

+194
-146
lines changed

spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ protected Method findGetterForProperty(String propertyName, Class<?> clazz, bool
330330
getterName = "is" + propertyWriteMethodSuffix;
331331
for (Method method : ms) {
332332
if (!method.isBridge() && method.getName().equals(getterName) && method.getParameterTypes().length == 0 &&
333-
boolean.class.equals(method.getReturnType()) &&
333+
(boolean.class.equals(method.getReturnType()) || Boolean.class.equals(method.getReturnType())) &&
334334
(!mustBeStatic || Modifier.isStatic(method.getModifiers()))) {
335335
return method;
336336
}

0 commit comments

Comments
 (0)