Skip to content

Redundant assertion in RedisTemplate.afterPropertiesSet(…) #2832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
foaw opened this issue Jan 15, 2024 · 1 comment
Closed

Redundant assertion in RedisTemplate.afterPropertiesSet(…) #2832

foaw opened this issue Jan 15, 2024 · 1 comment
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@foaw
Copy link

foaw commented Jan 15, 2024

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");
}

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 15, 2024
@christophstrobl
Copy link
Member

Thank you @foaw for raising the issue. We'll have a look.

@mp911de mp911de changed the title Redundant assertion in RedisTemplate Redundant assertion in RedisTemplate.afterPropertiesSet(…) Jan 18, 2024
@mp911de mp911de added this to the 3.1.9 (2023.0.9) milestone Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

4 participants