Skip to content

@NonNull annotation incorrectly applied to ZSetOperations.score() #3133

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

Open
swl27 opened this issue Apr 17, 2025 · 0 comments
Open

@NonNull annotation incorrectly applied to ZSetOperations.score() #3133

swl27 opened this issue Apr 17, 2025 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@swl27
Copy link

swl27 commented Apr 17, 2025

The method ZSetOperations.score() is annotated with @NonNull, but it can actually return null if the member does not exist in the Redis ZSet. This causes IDEs (like IntelliJ IDEA) to incorrectly warn "score is never null" when checking if (score != null).
Compiler alarm: Method 'core' inheritance annotation from package org.springframework.data.redis.comre, thus 'non-null'

IDE static analysis tools (IntelliJ) treat the return value as non-null, leading to false warnings.

  • Spring Data Redis: 3.4.4
  • Java: 17
  • IDE: IntelliJ IDEA 2023.x
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 17, 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

No branches or pull requests

2 participants