From f57994bee8f3409dcd96a0468570d77541a6327b Mon Sep 17 00:00:00 2001 From: Zhixuan WU Date: Wed, 2 Nov 2022 15:23:05 +0800 Subject: [PATCH] Update MappingRedisConverter.java Replace ObjectUtils.isEmpty with StringUtils.hasText since ObjectUtils.isEmpty(Boolean) is always false. --- .../data/redis/core/convert/MappingRedisConverter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/data/redis/core/convert/MappingRedisConverter.java b/src/main/java/org/springframework/data/redis/core/convert/MappingRedisConverter.java index a9e2c1874e..38fa56f671 100644 --- a/src/main/java/org/springframework/data/redis/core/convert/MappingRedisConverter.java +++ b/src/main/java/org/springframework/data/redis/core/convert/MappingRedisConverter.java @@ -61,7 +61,6 @@ import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.CollectionUtils; -import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; import org.springframework.util.comparator.NullSafeComparator; @@ -109,6 +108,7 @@ * @author Greg Turnquist * @author Mark Paluch * @author Golam Mazid Sajib + * @author Zhixuan Wu * @since 1.7 */ public class MappingRedisConverter implements RedisConverter, InitializingBean { @@ -317,7 +317,7 @@ protected Object readProperty(String path, RedisData source, RedisPersistentProp return null; } - if (persistentProperty.isIdProperty() && ObjectUtils.isEmpty(path.isEmpty())) { + if (persistentProperty.isIdProperty() && !StringUtils.hasText(path.isEmpty())) { return sourceBytes != null ? fromBytes(sourceBytes, typeInformation.getType()) : source.getId(); }