Skip to content

Switched nullability annotations to jspecify - #104

Draft
Trinsdar wants to merge 12 commits into
brachy84:1.20.1from
Trinsdar:jspecify-switch
Draft

Switched nullability annotations to jspecify#104
Trinsdar wants to merge 12 commits into
brachy84:1.20.1from
Trinsdar:jspecify-switch

Conversation

@Trinsdar

Copy link
Copy Markdown
Contributor

Also am wondering: do you guys want to use the nullaway error prone plugin or is intellij's warning system good enough? Nullaway makes it possible to get compile errors from incorrect null handling, kinda like how kotlin does, though one caveat I will note is it might not work super well with lombok, I haven't looked too much into that yet.

Comment on lines 17 to 18
@UnknownNullability
T getValue();

@Trinsdar Trinsdar Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

not sure how @UnknownNullability should be dealt with

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.

Can't you just do @NullUnmarked or something similar?

@Trinsdar Trinsdar Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes that's a solution, but I'm not sure if that's a proper solution. I wonder if i should change T to T extends @Nullable Object
Edit: i just checked: NullUnmarked is only meant to be used as a transitional annotation until all classes are nullmarked. I wouldn't be surprised if they depreciated it in a future version once most java projects have switched over fully to jspecify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants