Skip to content

Redundant assertion in RedisTemplate.afterPropertiesSet(…) #2832

Closed
@foaw

Description

@foaw

In RedisTemplate#afterPropertiesSet, if any of serializers are null and enableDefaultSerializer is true, they are set to defaultSerializer. After this, it checks if the defaultSerializer was also null, in which case an exception should be thrown. However, this cannot be the case, as defaultSerializer is pre-initialized to JdkSerializationRedisSerializer, if null.

if (defaultSerializer == null) {
defaultSerializer = new JdkSerializationRedisSerializer(
classLoader != null ? classLoader : this.getClass().getClassLoader());
}

if (enableDefaultSerializer && defaultUsed) {
Assert.notNull(defaultSerializer, "default serializer null and not all serializers initialized");
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions