Skip to content

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

Closed
@swl27

Description

@swl27

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions