提交 61f23710 编写于 作者: J Juergen Hoeller

relaxed warning about ambiguous setters to only be logged in case of actual write access (SPR-6399)

上级 27e06425
......@@ -1060,7 +1060,9 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
}
pv.getOriginalPropertyValue().conversionNecessary = (valueToApply != originalValue);
}
final Method writeMethod = pd.getWriteMethod();
final Method writeMethod = (pd instanceof GenericTypeAwarePropertyDescriptor ?
((GenericTypeAwarePropertyDescriptor) pd).getWriteMethodForActualAccess() :
pd.getWriteMethod());
if (!Modifier.isPublic(writeMethod.getDeclaringClass().getModifiers()) && !writeMethod.isAccessible()) {
if (System.getSecurityManager()!= null) {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
......
......@@ -100,6 +100,10 @@ class GenericTypeAwarePropertyDescriptor extends PropertyDescriptor {
@Override
public Method getWriteMethod() {
return this.writeMethod;
}
public Method getWriteMethodForActualAccess() {
Set<Method> ambiguousCandidates = this.ambiguousWriteMethods;
if (ambiguousCandidates != null) {
this.ambiguousWriteMethods = null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册