Skip to content

Conversation

scordio
Copy link
Contributor

@scordio scordio commented Jun 8, 2025

This change also introduces NullAway to verify @NullMarked annotated packages (productive code only).

I used the following strategy to handle cases of null-safety mismatch detected by NullAway:

  • Whenever possible, I refactored the code to be null-safe
  • When refactoring was either not possible or too complex, I annotated the corresponding part with @SuppressWarnings("DataFlowIssue"), which is recognized by both IntelliJ IDEA and NullAway

Many classes could benefit from a more aggressive refactoring, where a constructor with parameters is favored instead of relying on the default constructor + setters + afterPropertiesSet implementation. I'll work on it in a separate PR.

@fmbenhassine
Copy link
Contributor

This is a huge amount of work.. thank you very much for contributing this PR! I REALLY appreciate your time and effort on this 🙏

I am targeting the migration to jSpecify for v6.0.0-M3 (planned for Sep 17th), so I will start working on this right after releasing 6.0.0-M2. I see that the PR is still in draft status, which is ok, but is there a module I can I start reviewing?

Just as a (self) reminder, we need to get rid of the com.google.code.findbugs:jsr305 dependency as part of this.

@scordio
Copy link
Contributor Author

scordio commented Aug 20, 2025

Hi @fmbenhassine, I couldn't spend time on it in the last weeks, but I'll be able to get back to it this week and make sure it'll be in the right shape in time for M3 (including giving you time for review, of course 🙂)

So far, I approached it by executing the full build and addressing the problems in a mostly sequential order. I'll rebase my branch and see if I can split the changes into smaller PRs so that the review becomes easier.

@scordio scordio changed the title Migrate to JSpecify annotations for nullability constraints Migrate spring-batch-infrastructure to JSpecify annotations Aug 21, 2025
@scordio
Copy link
Contributor Author

scordio commented Aug 21, 2025

@fmbenhassine I'm reducing the scope of this PR to spring-batch-infrastructure for a simpler review (I guess you could remove some labels), and I'll raise separate PRs for the other modules.

(as you wisely proposed in the past 🙃)

@scordio

This comment was marked as outdated.

@fmbenhassine
Copy link
Contributor

Thank you for the update and for narrowing down the PR's scope to spring-batch-infrastructure!

Take your time and let me know when you think it is ready, no rush we can postpone to 6.0.0-M4 if necessary. I can also take it from where it is if needed.

@scordio scordio force-pushed the jspecify branch 4 times, most recently from 348cacc to 2295d49 Compare September 7, 2025 14:25
@scordio scordio force-pushed the jspecify branch 4 times, most recently from e4cbd3d to 6943f20 Compare September 21, 2025 16:47
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