-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
Fabio Grassi opened SPR-1823 and commented
Assignig a null value to an array property results in an array with a single null element. I think this is a regression, but was not able to determine exactly. Here is a test case:
public class ArrayBug {
public static void main(String[] args) {
BeanWrapper bw = new BeanWrapperImpl(BeanWithArrayProperty.class);
MutablePropertyValues pvs = new MutablePropertyValues();
pvs.addPropertyValue("elements", null);
bw.setPropertyValues(pvs);
BeanWithArrayProperty bwap = (BeanWithArrayProperty) bw.getWrappedInstance();
Assert.isNull(bwap.getElements());
}
public static class BeanWithArrayProperty {
private Integer[] elements;
public Integer[] getElements() {
return elements;
}
public void setElements(Integer[] elements) {
this.elements = elements;
}
}
}
Thanks in advance, Fabio.
Affects: 1.2.7
Issue Links:
- where a null->Object[] method parameter conversion was null, is now Object[] {null} (i.e. size 1) [SPR-1773] #6470 where a null->Object[] method parameter conversion was null, is now Object[] {null} (i.e. size 1) ("duplicates")
1 votes, 0 watchers
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug