Simplify afterPropertiesSet() Method in RedisTemplate
Using Objects.requireNonNullElse
#3003
Labels
status: declined
A suggestion or change that we don't feel we should currently apply
The afterPropertiesSet() method currently contains multiple null checks and assignments that can be simplified. By utilizing Java 9’s Objects.requireNonNullElse and Objects.requireNonNullElseGet methods, we can make the code more concise, readable, and maintainable.
AS-IS
TO-BE
The text was updated successfully, but these errors were encountered: