-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
Marko Umek opened SPR-11209 and commented
In release 3.2.4 BeanUtils.copyProperties() ignores invalid property definirions like these:
public class InvalidBean {
public String getValue() {...}
public void setValue(int intValue) {...}
}The culprit lies in class GenericTypeAwarePropertyDescriptor line 72, 73:
Method candidate = ClassUtils.getMethodIfAvailable(
this.beanClass, "set" + StringUtils.capitalize(getName()), (Class<?>[]) null); // < Missing return type (!)
if (candidate != null && candidate.getParameterTypes().length == 1) {
writeMethodToUse = candidate;
}
versus
writeMethodToUse = ClassUtils.getMethodIfAvailable(this.beanClass,
"set" + StringUtils.capitalize(getName(), readMethodToUse.getReturnType());
Affects: 3.2.5
Referenced from: commits bc5affa, bfcfbe4
Backported to: 3.2.6
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug