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 b70a5aa0c..e86696b49 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 @@ -284,15 +284,14 @@ public class MappingRedisConverter implements RedisConverter, InitializingBean { if (typeInformation.isCollectionLike()) { - if (isByteArray(typeInformation)) { + if (!isByteArray(typeInformation)) { - // accept collection form for byte[] if there's no dedicated key - if (!source.getBucket().hasValue(currentPath) && isByteArray(typeInformation)) { + return readCollectionOrArray(currentPath, typeInformation.getType(), + typeInformation.getRequiredComponentType().getType(), source.getBucket()); + } + + if (!source.getBucket().hasValue(currentPath) && isByteArray(typeInformation)) { - return readCollectionOrArray(currentPath, typeInformation.getType(), - typeInformation.getRequiredComponentType().getType(), source.getBucket()); - } - } else { return readCollectionOrArray(currentPath, typeInformation.getType(), typeInformation.getRequiredComponentType().getType(), source.getBucket()); }