Skip to content

Switch to JSpecify for nullability annotations in API module#6303

Merged
eclipseisoffline merged 5 commits into
GeyserMC:feat/26.1from
eclipseisoffline:jspecify
Apr 23, 2026
Merged

Switch to JSpecify for nullability annotations in API module#6303
eclipseisoffline merged 5 commits into
GeyserMC:feat/26.1from
eclipseisoffline:jspecify

Conversation

@eclipseisoffline
Copy link
Copy Markdown
Member

@eclipseisoffline eclipseisoffline commented Apr 15, 2026

This PR switches to JSpecify for nullability annotations in the API module. All packages in the API now have a package-info.java file with a @NullMarked annotation, which applies to all types in the package. This includes but is not limited to method return values, parameters, fields, generic type parameters, arrays, and more.

Because of this change, all @NonNull annotations have been removed, as they are no longer necessary. All @Nullable annotations have been replaced by JSpecify's, and those on a separate line have been moved to be in-line, as per JSpecify's standard.

Some extra @Nullable annotations have been added where they should be.

This PR is currently targetting 26.1, but can be changed to target master if merged in a later version.

Depends on api#12 for JSpecify in the base API.

@eclipseisoffline eclipseisoffline added PR: Feature When a PR implements a new feature API The issue/feature request relates to the Geyser API labels Apr 15, 2026
@eclipseisoffline eclipseisoffline merged commit d66956d into GeyserMC:feat/26.1 Apr 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API The issue/feature request relates to the Geyser API PR: Feature When a PR implements a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants