Skip to content
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

Document that Spring Framework 6.x does not yet support JSpecify annotations #34551

Closed
ghusta opened this issue Mar 7, 2025 · 3 comments
Closed
Assignees
Labels
type: documentation A documentation task
Milestone

Comments

@ghusta
Copy link

ghusta commented Mar 7, 2025

Maybe it could be nice to mention explicitly in documentation that Spring FWK 6.x doesn't support JSpecify.

When looking at : https://docs.spring.io/spring-framework/reference/6.2/core/beans/annotation-config/autowired.html

It says that

You can also use a @Nullable annotation (of any kind in any package — for example, javax.annotation.Nullable from JSR-305) or just leverage Kotlin built-in null-safety support:

But, according to the few tests I made, @org.jspecify.annotations.Nullable can't be used in Spring FWK 6 to mark a non required dependency.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 7, 2025
@sbrannen sbrannen added the type: documentation A documentation task label Mar 7, 2025
@sbrannen
Copy link
Member

sbrannen commented Mar 7, 2025

Indeed, Spring Framework 7.0 will support JSpecify's null-safety annotations.

We'll consider adding something to the docs.

@sbrannen sbrannen removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 7, 2025
@sbrannen sbrannen added this to the 6.2.4 milestone Mar 7, 2025
@sbrannen sbrannen changed the title Mention explicitly that Spring FWK 6.x doesn't support JSpecify Document that Spring Framework 6.x does not yet support JSpecify annotations Mar 7, 2025
@jhoeller
Copy link
Contributor

jhoeller commented Mar 7, 2025

Technically, you can use any parameter-level @Nullable annotation at this point. Type-use annotations such as from JSpecify are not detected yet, that's coming in 7.0.

@jhoeller jhoeller self-assigned this Mar 7, 2025
@ghusta
Copy link
Author

ghusta commented Mar 7, 2025

OK thanks !
Indeed, I didn't notice this little subtlety in the annotation's target type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

4 participants