Remove unnecessary null check

Issue: SPR-12378
master
Seo, Kyung-Seok 10 years ago committed by Stephane Nicoll
parent 58f4014b17
commit 1708a8a10d
  1. 6
      spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java

@ -814,8 +814,7 @@ 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.
TypeDescriptor typeDescriptor = (mapKeyType != null ? TypeDescriptor typeDescriptor = TypeDescriptor.valueOf(mapKeyType);
TypeDescriptor.valueOf(mapKeyType) : TypeDescriptor.valueOf(Object.class));
Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, typeDescriptor); Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, typeDescriptor);
value = map.get(convertedMapKey); value = map.get(convertedMapKey);
} }
@ -1028,8 +1027,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
Map<Object, Object> map = (Map<Object, Object>) propValue; Map<Object, Object> map = (Map<Object, Object>) 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.
TypeDescriptor typeDescriptor = (mapKeyType != null ? TypeDescriptor typeDescriptor = TypeDescriptor.valueOf(mapKeyType);
TypeDescriptor.valueOf(mapKeyType) : TypeDescriptor.valueOf(Object.class));
Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, typeDescriptor); Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, typeDescriptor);
Object oldValue = null; Object oldValue = null;
if (isExtractOldValueForEditor()) { if (isExtractOldValueForEditor()) {

Loading…
Cancel
Save