-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
Koen Serneels opened SPR-10716 and commented
Expression that accesses a property having there second char upper cased are not found on the target object.
This is because a small bug in the property method matcher:
org.springframework.expression.spel.support.ReflectivePropertyAccessor#getPropertyMethodSuffix (L:368):
protected String getPropertyMethodSuffix(String propertyName) {
if (propertyName.length() > 1 && Character.isUpperCase(propertyName.charAt(1))) {
return propertyName;
}
else {
return StringUtils.capitalize(propertyName);
}
}
So this:
Character.isUpperCase(propertyName.charAt(1)))
Should become:
Character.isUpperCase(propertyName.charAt(0))
Affects: 3.2.3
Attachments:
- SpELTest.java (641 bytes)
Sub-tasks:
- Backport: Relax JavaBean rules for SpEL property access [SPR-11008] #15636 Backport: Relax JavaBean rules for SpEL property access
Issue Links:
- [SpEL] Problem with uppercase property names [SPR-9123] #13761 [SpEL] Problem with uppercase property names
- ReflectivePropertyAccessor should not consider "is" methods with non boolean returns [SPR-11142] #15768 ReflectivePropertyAccessor should not consider "is" methods with non boolean returns
Referenced from: commits b25e91a, f9f1069
2 votes, 4 watchers
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug