Require JSpecify annotations on new Public API and Experimental API classes #3892
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #3877
This PR adds an ArchUnit test to require new Public API and Experimental API classes have the
@NullMarked
annotation on the class. See the documentation: https://jspecify.dev/docs/user-guide/#nullmarkedI put a PR up so it's easier to have a discussion, I'm open to ideas.
I originally tried to allow list all classes, but because we're starting off from almost zero, we have another 1,200 classes to go. That's a very, very long allow list! I thought instead we can start with public & experimental API classes, which is a mere ~350 classes. This would add the most value for users of the library.
I had thought about using Git to collect a list of new classes, but I don't want to spin up a new process every time we do a test run.
Sample test output
https://github.com/graphql-java/graphql-java/actions/runs/14279382170/job/40027003549?pr=3892