Skip to content

Drop the jspecify nullness annotations - #429

Merged
slachiewicz merged 1 commit into
masterfrom
agent/jspecify-provided
Sep 11, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/jspecify-provided

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Removes the org.jspecify:jspecify dependency and every @NonNull / @Nullable annotation it supplied, in place of the provided-scope change this PR first proposed. The review on that version asked whether the annotations earn their place at all; they are not checked by any tool in this build, so dropping them is the smaller change to the consumer graph than adjusting the scope.

The diff is large only because spotless re-joins signatures that fit on one line once the annotations are gone. No method body changes.

What consumers see: the runtime annotation metadata disappears from public signatures. Nothing in this library reflects on it, Maven core has no reference to org.jspecify at all, and NullAway or similar checkers were never wired into this build. I have not audited the other consumers; one that referenced org.jspecify transitively through this artifact would need to declare it itself.

After the change dependency:list -DincludeScope=runtime yields slf4j-api, jansi (optional) and commons-io.

Verified: JAVA_HOME=$(/usr/libexec/java_home -v 17) mvn -B verify -> Tests run: 788, Failures: 0, Errors: 0 (JDK 17); spotless clean; dependency:list -DincludeScope=runtime shows no jspecify

This change was created with AI assistance.

@slachiewicz slachiewicz added the dependencies Pull requests that update a dependency file label Sep 10, 2026
@slachiewicz slachiewicz added this to the 3.5.0 milestone Sep 10, 2026
@slachiewicz
slachiewicz requested a review from elharo September 10, 2026 10:57
@slachiewicz
slachiewicz marked this pull request as ready for review September 10, 2026 10:57

@elharo elharo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me wonder if we could just drop this. The 18 different variants of Null/NonNull/Nullable etc. feel like an experiment that has failed. I've never seem them improve robustness in any meaningful way. They're applied haphazardly and never checked.

slachiewicz added a commit that referenced this pull request Sep 11, 2026
Review of the provided-scope change (#429) asked whether the annotations
earn their place at all: they are applied haphazardly, never checked by a
tool in this build, and add a dependency to the graph of every consumer.
Removing them leaves nothing to scope.

The only behavioural surface was RetentionPolicy.RUNTIME metadata on
public signatures; nothing in this library or Maven core reflects on it.
@slachiewicz
slachiewicz force-pushed the agent/jspecify-provided branch from 5688119 to d3dc4ad Compare September 11, 2026 07:00
@slachiewicz slachiewicz changed the title Declare jspecify at provided scope Drop the jspecify nullness annotations Sep 11, 2026
@slachiewicz
slachiewicz marked this pull request as draft September 11, 2026 07:00
Review of the provided-scope change (#429) asked whether the annotations
earn their place at all: they are applied haphazardly, never checked by a
tool in this build, and add a dependency to the graph of every consumer.
Removing them leaves nothing to scope.

The only behavioural surface was RetentionPolicy.RUNTIME metadata on
public signatures; nothing in this library or Maven core reflects on it.
@slachiewicz
slachiewicz force-pushed the agent/jspecify-provided branch from d3dc4ad to e921682 Compare September 11, 2026 07:02
@slachiewicz
slachiewicz marked this pull request as ready for review September 11, 2026 07:05
@slachiewicz
slachiewicz merged commit 5e65e7c into master Sep 11, 2026
15 checks passed
@slachiewicz
slachiewicz deleted the agent/jspecify-provided branch September 11, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants