Skip to content

Conversation

@youngsuk-kim
Copy link

@youngsuk-kim youngsuk-kim commented Dec 7, 2025

Refactor: Extract precision API fallback with type-safe enum

Remove 66 lines of duplicate try-catch code from RedisTemplate.
Replace hardcoded strings with PrecisionCommand enum.
Add logging and specific exception handling.

No functional changes, backward compatible.

Changes

  • New: PrecisionApiHelper.java with PrecisionCommand enum
  • Modified: RedisTemplate.java - updated expire(), expireAt(), getExpire()

Testing

  • All existing tests pass
  • No behavior changes

Closes #3274


  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don't submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current
    year only).

Remove 66 lines of duplicate try-catch code from RedisTemplate.
Replace hardcoded strings with PrecisionCommand enum.
Add logging and specific exception handling.

No functional changes, backward compatible.

Signed-off-by: bread <thayer2392@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 7, 2025
@youngsuk-kim youngsuk-kim changed the title Refactor: Extract precision API fallback with type-safe enum Extract precision API fallback with type-safe enum Dec 8, 2025
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

Successfully merging this pull request may close these issues.

Remove Duplicate Code and Hardcoded Strings in RedisTemplate

3 participants