Skip to content

Commit a3213f2

Browse files
committed
Merge pull request spring-projects#677 from ksseo0701/SPR-12378
* SPR-12378: Remove unnecessary null check
2 parents 58f4014 + 1708a8a commit a3213f2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,7 @@ else if (value instanceof Map) {
814814
Class<?> mapKeyType = GenericCollectionTypeResolver.getMapKeyReturnType(pd.getReadMethod(), i + 1);
815815
// IMPORTANT: Do not pass full property name in here - property editors
816816
// must not kick in for map keys but rather only for map values.
817-
TypeDescriptor typeDescriptor = (mapKeyType != null ?
818-
TypeDescriptor.valueOf(mapKeyType) : TypeDescriptor.valueOf(Object.class));
817+
TypeDescriptor typeDescriptor = TypeDescriptor.valueOf(mapKeyType);
819818
Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, typeDescriptor);
820819
value = map.get(convertedMapKey);
821820
}
@@ -1028,8 +1027,7 @@ else if (propValue instanceof Map) {
10281027
Map<Object, Object> map = (Map<Object, Object>) propValue;
10291028
// IMPORTANT: Do not pass full property name in here - property editors
10301029
// must not kick in for map keys but rather only for map values.
1031-
TypeDescriptor typeDescriptor = (mapKeyType != null ?
1032-
TypeDescriptor.valueOf(mapKeyType) : TypeDescriptor.valueOf(Object.class));
1030+
TypeDescriptor typeDescriptor = TypeDescriptor.valueOf(mapKeyType);
10331031
Object convertedMapKey = convertIfNecessary(null, null, key, mapKeyType, typeDescriptor);
10341032
Object oldValue = null;
10351033
if (isExtractOldValueForEditor()) {

0 commit comments

Comments
 (0)