Simplify return path for reading collections.

Reduce the nesting level of byte[] checks and processing.

Original Pull Request: #2015
This commit is contained in:
Christoph Strobl
2021-03-25 09:20:15 +01:00
parent 4e9f4bc4ad
commit daa99f8698

View File

@@ -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());
}