Cache capitalized name in SpEL's ReflectivePropertyAccessor

This commit is contained in:
Sam Brannen 2025-03-12 14:01:19 +01:00
parent 2c05e991b5
commit 71716e848d
1 changed files with 3 additions and 2 deletions

View File

@ -624,11 +624,12 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
} }
if (this.member instanceof Method method) { if (this.member instanceof Method method) {
String getterName = "get" + StringUtils.capitalize(name); String capitalizedName = StringUtils.capitalize(name);
String getterName = "get" + capitalizedName;
if (getterName.equals(method.getName())) { if (getterName.equals(method.getName())) {
return true; return true;
} }
getterName = "is" + StringUtils.capitalize(name); getterName = "is" + capitalizedName;
if (getterName.equals(method.getName())) { if (getterName.equals(method.getName())) {
return true; return true;
} }