Skip to content

Commit 71716e8

Browse files
committed
Cache capitalized name in SpEL's ReflectivePropertyAccessor
1 parent 2c05e99 commit 71716e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,12 @@ public boolean canRead(EvaluationContext context, @Nullable Object target, Strin
624624
}
625625

626626
if (this.member instanceof Method method) {
627-
String getterName = "get" + StringUtils.capitalize(name);
627+
String capitalizedName = StringUtils.capitalize(name);
628+
String getterName = "get" + capitalizedName;
628629
if (getterName.equals(method.getName())) {
629630
return true;
630631
}
631-
getterName = "is" + StringUtils.capitalize(name);
632+
getterName = "is" + capitalizedName;
632633
if (getterName.equals(method.getName())) {
633634
return true;
634635
}

0 commit comments

Comments
 (0)