Make bean property method accessible as well (for non-public types)

See gh-19877
This commit is contained in:
Juergen Hoeller 2023-07-25 18:10:43 +02:00
parent 019c34f480
commit 021161ea38
1 changed files with 1 additions and 0 deletions

View File

@ -132,6 +132,7 @@ public class SimpleErrors implements Errors, Serializable {
PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(this.target.getClass(), field);
if (pd != null && pd.getReadMethod() != null) {
ReflectionUtils.makeAccessible(pd.getReadMethod());
return ReflectionUtils.invokeMethod(pd.getReadMethod(), this.target);
}