Browse Source

SpEL correctly handles "is" accessors with Boolean return type

Issue: SPR-10091
3.1.x
Juergen Hoeller 13 years ago
parent
commit
8abe1f055e
  1. 2
      org.springframework.expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java

2
org.springframework.expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java

@ -325,7 +325,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor { @@ -325,7 +325,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
getterName = "is" + StringUtils.capitalize(propertyName);
for (Method method : ms) {
if (!method.isBridge() && method.getName().equals(getterName) && method.getParameterTypes().length == 0 &&
boolean.class.equals(method.getReturnType()) &&
(boolean.class.equals(method.getReturnType()) || Boolean.class.equals(method.getReturnType())) &&
(!mustBeStatic || Modifier.isStatic(method.getModifiers()))) {
return method;
}

Loading…
Cancel
Save