Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Migrate nullability annotations to JSpecify #4990

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

Closed
scordio wants to merge 2 commits into spring-projects:main from scordio:jspecify-sb-core

Conversation

Copy link
Contributor

@scordio scordio commented Sep 24, 2025

This is the next step for:

I cherry-picked the changes from #4864 as they haven't been merged yet.

I initially wanted to target spring-batch-core only as the next module, but, as discussed at #4989 (comment), the clock is ticking 🙂

I'm just pushing what I have, and please consider that there are also changes from other modules. Feel free to reuse them if it helps, or just discard them!

If I can support with anything, please don't hesitate to let me know.

Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
Copy link
Contributor

Thank you!

I cherry-picked the changes from #4864 as they haven't been merged yet.

Good. I already reviewed #4864 and currently working on the refactoring mentioned here: #4864 (comment). So since you cherry-picked the changes here, can we close #4864 in favour of this PR? I will continue on this one since it includes everything.

BTW, this will definitely require at least two passes. But I think it should be ok to ship in the last milestone (6.0 M4). I will keep you posted. Thank you again for this amazing effort!

Copy link
Contributor Author

scordio commented Sep 24, 2025

So since you cherry-picked the changes here, can we close #4864 in favour of this PR?

Totally up to you! If you prefer a single PR for all modules, #4864 can definitely be closed.

On the other side, #4864 is "stable" and touches only spring-batch-infrastructure, while here there is plenty of work in progress across all the other modules...

fmbenhassine reacted with thumbs up emoji

@fmbenhassine fmbenhassine changed the title (削除) Migrate spring-batch-core to JSpecify annotations (削除ここまで) (追記) Migrate nullability annotations to JSpecify (追記ここまで) Sep 24, 2025
Copy link
Contributor

That's fine. I will focus on this one and adapt where needed.

scordio reacted with thumbs up emoji

Copy link
Contributor

okay.. after digging into this, nullability specs and checks will be very difficult to implement correctly with the current state of things in Spring Batch (nothing to do with this PR).

The current model with default constructors (to make persistence and serialisation tools happy) is just broken by design. What makes things difficult is the fact that there is a single model used as a domain model and a persistence/serialization model at the same time. I remember I came across this problem when I introduced the first NoSQL store implementation.

I need to think more about the best way to proceed with the current state of things and the current context. I will get back with an update here asap.

Copy link
Contributor Author

scordio commented Sep 25, 2025

The current model with default constructors (to make persistence and serialisation tools happy) is just broken by design.

Indeed, that is essentially why I used @SuppressWarnings("DataFlowIssue") extensively.

I'll stay tuned! 👀

Copy link

main

fmbenhassine added a commit that referenced this pull request Oct 3, 2025
This commit updates nullability checks based on the new
changes introduced in #1870. The main refinements are:
- Add constructors with mandatory properties
- Avoid accepting nullable parameters where appropriate
Some classes have been excluded from nullability checks
util we fully remove the "no-arg constructor + setters +
afterPropertiesSet" approach to creating objects.
Resolves #4673 
Copy link
Contributor

fmbenhassine commented Oct 3, 2025
edited
Loading

Rebased, squashed and merged as 551e26d. Thanks again for this amazing contribution!

As discussed, I refined things in 21af80d after doing a big preparatory work in 90d8959. I also excluded deprecated APIs from nullability checks to reduce the surface (see 0d49dba).

This refinement is the first stable pass, more refinements will come in #4988 and #4989

scordio reacted with rocket emoji

@scordio scordio deleted the jspecify-sb-core branch October 3, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /