spring-projects / spring-data-redis

Provides support to increase developer productivity in Java when using Redis, a key-value store. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-redis/
Apache License 2.0
1.77k stars 1.17k forks source link

Simplify afterPropertiesSet() Method in `RedisTemplate` Using Objects.requireNonNullElse #3004

Closed kjb512 closed 2 months ago

kjb512 commented 2 months ago

Closes https://github.com/spring-projects/spring-data-redis/issues/3003

mp911de commented 2 months ago

I do not share your perspective that the code is simpler to read when using Objects.requireNonNullElseGet, especially in the context of nesting Objects.requireNonNullElseGet(…) inside another instance. Primarily, the representation is different and doesn't represent what we're usually doing.

That being said, making things just different increases the mental requirements to parse the code resulting in harder to read code.

Therefore, I'm closing the ticket without applying the suggestion.