From 1708a8a10d17b9c3dc203b90f181c1d55ad5facb Mon Sep 17 00:00:00 2001 From: "Seo, Kyung-Seok" Date: Sun, 26 Oct 2014 23:52:42 +0900 Subject: [PATCH] Remove unnecessary null check Issue: SPR-12378 --- .../java/org/springframework/beans/BeanWrapperImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java b/spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java index 98e4ba0397..646480055f 100644 --- a/spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java +++ b/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); // IMPORTANT: Do not pass full property name in here - property editors // must not kick in for map keys but rather only for map values. - TypeDescriptor typeDescriptor = (mapKeyType != null ? - TypeDescriptor.valueOf(mapKeyType) : TypeDescriptor.valueOf(Object.class)); + TypeDescriptor typeDescriptor = TypeDescriptor.valueOf(mapKeyType); Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, typeDescriptor); value = map.get(convertedMapKey); } @@ -1028,8 +1027,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra Map map = (Map) propValue; // IMPORTANT: Do not pass full property name in here - property editors // must not kick in for map keys but rather only for map values. - TypeDescriptor typeDescriptor = (mapKeyType != null ? - TypeDescriptor.valueOf(mapKeyType) : TypeDescriptor.valueOf(Object.class)); + TypeDescriptor typeDescriptor = TypeDescriptor.valueOf(mapKeyType); Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, typeDescriptor); Object oldValue = null; if (isExtractOldValueForEditor()) {