Skip to content

Commit 021161e

Browse files
committed
Make bean property method accessible as well (for non-public types)
See gh-19877
1 parent 019c34f commit 021161e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spring-context/src/main/java/org/springframework/validation/SimpleErrors.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public Object getFieldValue(String field) {
132132

133133
PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(this.target.getClass(), field);
134134
if (pd != null && pd.getReadMethod() != null) {
135+
ReflectionUtils.makeAccessible(pd.getReadMethod());
135136
return ReflectionUtils.invokeMethod(pd.getReadMethod(), this.target);
136137
}
137138

0 commit comments

Comments
 (0)