Skip to content

Conversation

@jamespud
Copy link
Contributor

@jamespud jamespud commented Dec 6, 2025

use org.jspecify.annotations.Nullable instead of deprecated org.springframework.lang.Nullable

Signed-off-by: Wenli Tian <jamespud9@gmail.com>
@ericbottard
Copy link
Member

Hi @jamespud,

Thanks for your welcome PR. Null safety with JSpecify is an important topic for Spring AI 2.0.
Sadly, the endeavour involves much more than just switching packages for the @Nullable annotation. Indeed this has virtually no effect until we mark packages with @NullMarked. Moreover, for Spring AI 2.0, this will involve a thorough review of all the APIs, making sure the null safety information is consistent (the compiler will not let any inconsistency go unnoticed!).
A first stepping stone has been committed here. I am personally working on reviewing more of the core packages (commits to come).

I will thus close this PR without merging.
If you're interested in learning more about JSpecify and null safety (either for your own pleasure or to later contribute to Spring AI once the core packages have been reviewed), I encourage you to read the JSpecify doc and some Spring Blog entries covering the subject!

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.

3 participants