Skip to content

Commit daa99f8

Browse files
Simplify return path for reading collections.
Reduce the nesting level of byte[] checks and processing. Original Pull Request: #2015
1 parent 4e9f4bc commit daa99f8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/main/java/org/springframework/data/redis/core/convert/MappingRedisConverter.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,14 @@ protected Object readProperty(String path, RedisData source, RedisPersistentProp
284284

285285
if (typeInformation.isCollectionLike()) {
286286

287-
if (isByteArray(typeInformation)) {
287+
if (!isByteArray(typeInformation)) {
288288

289-
// accept collection form for byte[] if there's no dedicated key
290-
if (!source.getBucket().hasValue(currentPath) && isByteArray(typeInformation)) {
289+
return readCollectionOrArray(currentPath, typeInformation.getType(),
290+
typeInformation.getRequiredComponentType().getType(), source.getBucket());
291+
}
292+
293+
if (!source.getBucket().hasValue(currentPath) && isByteArray(typeInformation)) {
291294

292-
return readCollectionOrArray(currentPath, typeInformation.getType(),
293-
typeInformation.getRequiredComponentType().getType(), source.getBucket());
294-
}
295-
} else {
296295
return readCollectionOrArray(currentPath, typeInformation.getType(),
297296
typeInformation.getRequiredComponentType().getType(), source.getBucket());
298297
}

0 commit comments

Comments
 (0)