Skip to content

Conversation

cppwfs
Copy link
Contributor

@cppwfs cppwfs commented Jul 28, 2025

PartititonDispatcher.partition will always return at least 1 partition. So return value is wrapped with Objects.requireNonNull, for nullaway

Related to: #10083

PartititonDispatcher.partition will always return at least 1 partition.
So return value is wrapped with Objects.requireNonNull, for nullaway

Related to: spring-projects#10083
… the `NullAway` error, than take the performance hit of using `requiresNonNull`
}

@Override
@SuppressWarnings("NullAway")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we state in the comment to this annotation the reason?
Something similar to what I suggested in the review, but might be more specific to this situation.


@Override
@SuppressWarnings("NullAway")
@SuppressWarnings("NullAway") // Dataflow analysis limitation!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... That's not what I meant, especially not with a ! 😉
How about this?

Suggested change
@SuppressWarnings("NullAway") // Dataflow analysis limitation!
@SuppressWarnings("NullAway") // The partitions map never returns null according to partition hash

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the clarification. I thought that message was a bit terse. will update.

@artembilan artembilan merged commit 0503284 into spring-projects:main Jul 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants