|
|
|
@ -787,8 +787,8 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra |
|
|
|
Class<?> mapKeyType = GenericCollectionTypeResolver.getMapKeyReturnType(pd.getReadMethod(), i + 1); |
|
|
|
Class<?> mapKeyType = GenericCollectionTypeResolver.getMapKeyReturnType(pd.getReadMethod(), i + 1); |
|
|
|
// IMPORTANT: Do not pass full property name in here - property editors
|
|
|
|
// IMPORTANT: Do not pass full property name in here - property editors
|
|
|
|
// must not kick in for map keys but rather only for map values.
|
|
|
|
// must not kick in for map keys but rather only for map values.
|
|
|
|
Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, |
|
|
|
TypeDescriptor typeDescriptor = mapKeyType != null ? TypeDescriptor.valueOf(mapKeyType) : TypeDescriptor.valueOf(Object.class); |
|
|
|
new PropertyTypeDescriptor(mapKeyType, new MethodParameter(pd.getReadMethod(), -1), pd)); |
|
|
|
Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, typeDescriptor); |
|
|
|
value = map.get(convertedMapKey); |
|
|
|
value = map.get(convertedMapKey); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
@ -935,8 +935,10 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra |
|
|
|
if (isExtractOldValueForEditor()) { |
|
|
|
if (isExtractOldValueForEditor()) { |
|
|
|
oldValue = Array.get(propValue, arrayIndex); |
|
|
|
oldValue = Array.get(propValue, arrayIndex); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
MethodParameter methodParameter = new MethodParameter(pd.getReadMethod(), -1); |
|
|
|
|
|
|
|
methodParameter.increaseNestingLevel(); |
|
|
|
Object convertedValue = convertIfNecessary(propertyName, oldValue, pv.getValue(), requiredType, |
|
|
|
Object convertedValue = convertIfNecessary(propertyName, oldValue, pv.getValue(), requiredType, |
|
|
|
new PropertyTypeDescriptor(requiredType, new MethodParameter(pd.getReadMethod(), -1), pd)); |
|
|
|
new PropertyTypeDescriptor(requiredType, methodParameter, pd)); |
|
|
|
Array.set(propValue, arrayIndex, convertedValue); |
|
|
|
Array.set(propValue, arrayIndex, convertedValue); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (IndexOutOfBoundsException ex) { |
|
|
|
catch (IndexOutOfBoundsException ex) { |
|
|
|
@ -954,8 +956,10 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra |
|
|
|
if (isExtractOldValueForEditor() && index < list.size()) { |
|
|
|
if (isExtractOldValueForEditor() && index < list.size()) { |
|
|
|
oldValue = list.get(index); |
|
|
|
oldValue = list.get(index); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
MethodParameter methodParameter = new MethodParameter(pd.getReadMethod(), -1); |
|
|
|
|
|
|
|
methodParameter.increaseNestingLevel(); |
|
|
|
Object convertedValue = convertIfNecessary(propertyName, oldValue, pv.getValue(), requiredType, |
|
|
|
Object convertedValue = convertIfNecessary(propertyName, oldValue, pv.getValue(), requiredType, |
|
|
|
new PropertyTypeDescriptor(requiredType, new MethodParameter(pd.getReadMethod(), -1), pd)); |
|
|
|
new PropertyTypeDescriptor(requiredType, methodParameter, pd)); |
|
|
|
if (index < list.size()) { |
|
|
|
if (index < list.size()) { |
|
|
|
list.set(index, convertedValue); |
|
|
|
list.set(index, convertedValue); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -983,17 +987,19 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra |
|
|
|
Map map = (Map) propValue; |
|
|
|
Map map = (Map) propValue; |
|
|
|
// IMPORTANT: Do not pass full property name in here - property editors
|
|
|
|
// IMPORTANT: Do not pass full property name in here - property editors
|
|
|
|
// must not kick in for map keys but rather only for map values.
|
|
|
|
// must not kick in for map keys but rather only for map values.
|
|
|
|
Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, |
|
|
|
TypeDescriptor typeDescriptor = mapKeyType != null ? TypeDescriptor.valueOf(mapKeyType) : TypeDescriptor.valueOf(Object.class); |
|
|
|
new PropertyTypeDescriptor(mapKeyType, new MethodParameter(pd.getReadMethod(), -1), pd)); |
|
|
|
Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, typeDescriptor); |
|
|
|
Object oldValue = null; |
|
|
|
Object oldValue = null; |
|
|
|
if (isExtractOldValueForEditor()) { |
|
|
|
if (isExtractOldValueForEditor()) { |
|
|
|
oldValue = map.get(convertedMapKey); |
|
|
|
oldValue = map.get(convertedMapKey); |
|
|
|
} |
|
|
|
} |
|
|
|
// Pass full property name and old value in here, since we want full
|
|
|
|
// Pass full property name and old value in here, since we want full
|
|
|
|
// conversion ability for map values.
|
|
|
|
// conversion ability for map values.
|
|
|
|
|
|
|
|
MethodParameter methodParameter = new MethodParameter(pd.getReadMethod(), -1); |
|
|
|
|
|
|
|
methodParameter.increaseNestingLevel(); |
|
|
|
Object convertedMapValue = convertIfNecessary( |
|
|
|
Object convertedMapValue = convertIfNecessary( |
|
|
|
propertyName, oldValue, pv.getValue(), mapValueType, |
|
|
|
propertyName, oldValue, pv.getValue(), mapValueType, |
|
|
|
new TypeDescriptor(new MethodParameter(pd.getReadMethod(), -1, tokens.keys.length + 1))); |
|
|
|
new PropertyTypeDescriptor(mapValueType, methodParameter, pd)); |
|
|
|
map.put(convertedMapKey, convertedMapValue); |
|
|
|
map.put(convertedMapKey, convertedMapValue); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
|