Skip to content

GH-1212 Replace JetBrains nullability annotations with JSpecify#1288

Open
Jakubk15 wants to merge 10 commits intomasterfrom
migrate-to-jspecify
Open

GH-1212 Replace JetBrains nullability annotations with JSpecify#1288
Jakubk15 wants to merge 10 commits intomasterfrom
migrate-to-jspecify

Conversation

@Jakubk15
Copy link
Member

This PR replaces nullability annotations from JetBrains with the ones from JSpecify.

Resolves #1212

@Jakubk15 Jakubk15 requested a review from a team as a code owner January 31, 2026 14:35
@Jakubk15 Jakubk15 changed the title Replace JetBrains annotations with JSpecify annotations for nullability GH-1212 Replace JetBrains annotations with JSpecify annotations for nullability Jan 31, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully replaces JetBrains nullability annotations with JSpecify annotations across the project. The changes are thorough and consistent. I've added one suggestion to improve annotation correctness in one of the files, making the nullability contract more precise. Overall, this is a great refactoring that improves code standardization.

…ceholderapi/PlaceholderApiExtension.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Member

@noyzys noyzys left a comment

Choose a reason for hiding this comment

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

Trzeba też pamiętać jedno mieszanie adnotacji JetBrains i JSpecify mogłoby utrudnić interpretację kontraktów nullability, dlatego intencją jest pełne przejście na JSpecify w całym projekcie co za tym idzie zmiany w codebse.

Migracja do JSpecify jest celowa - chodzi o spójny, specyfikacyjny model nullability pseudo nullsafety i unikanie mieszania różnych frameworków adnotacji.
Twoja sugestia faktycznie poprawia precyzję kontraktu, więc ja daję approve aczkolwiek nie spamował bym tym na dużą skale.

@noyzys
Copy link
Member

noyzys commented Feb 2, 2026

@noyzys Problem w tym, że JSpecify posiada tylko adnotację dotyczące nullability, a nie posiada takich rzeczy jak chociażby @ApiStatus, czy @Unmodifiable

Dlatego trzeba iść drogą hybrydową

Comment on lines 23 to 25
NoticeService noticeService,
Notice message,
List<String> commands
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
NoticeService noticeService,
Notice message,
List<String> commands
@NonNull NoticeService noticeService,
@NonNull Notice message,
@NonNull List<String> commands

Jakubk15 and others added 6 commits February 2, 2026 14:26
Co-authored-by: DMK <81445555+imDMK@users.noreply.github.com>
Co-authored-by: DMK <81445555+imDMK@users.noreply.github.com>
Co-authored-by: DMK <81445555+imDMK@users.noreply.github.com>
Co-authored-by: DMK <81445555+imDMK@users.noreply.github.com>
Co-authored-by: DMK <81445555+imDMK@users.noreply.github.com>
Co-authored-by: DMK <81445555+imDMK@users.noreply.github.com>
@Jakubk15 Jakubk15 changed the title GH-1212 Replace JetBrains annotations with JSpecify annotations for nullability GH-1212 Replace JetBrains nullability annotations with JSpecify Feb 5, 2026
Copy link
Member

@CitralFlo CitralFlo left a comment

Choose a reason for hiding this comment

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

I checked services and annotated more - Nullable elements are not marked in your code.

Additionally inside code i added jetbrains annotation for better intelliJ usage - current screems when @NullMarked is used.

All Api methods should use jspecific

Review in pull request form: #1293

* My understanding of JSpecify for api - mostly used in Java-Kotlin communication. With NullMarked as clear way to display notnull by default. Nullmarks checked to second layer of services. Additional `NotNull` s from jetbrains required by intelliJ to not screen about parameter marks as notNull

* Additional marks

* Use global @NullMarked defined at package-info.java

* Update eternalcore-api/src/main/java/com/eternalcode/core/feature/catboy/CatboyService.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update eternalcore-api/src/main/java/com/eternalcode/core/feature/adminchat/event/AdminChatEvent.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update eternalcore-api/src/main/java/com/eternalcode/core/feature/jail/JailService.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update eternalcore-core/src/main/java/com/eternalcode/core/feature/warp/WarpServiceImpl.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Remove unnecessary annotations

* Update eternalcore-api/src/main/java/com/eternalcode/core/feature/spawn/SpawnService.java

* Update eternalcore-core/src/main/java/com/eternalcode/core/feature/spawn/SpawnServiceImpl.java

* Update eternalcore-api/src/main/java/com/eternalcode/core/EternalCoreApiProvider.java

* Update eternalcore-api/src/main/java/com/eternalcode/core/EternalCoreApiProvider.java

* Update eternalcore-api/src/main/java/com/eternalcode/core/EternalCoreApiProvider.java

* Update eternalcore-api/src/main/java/com/eternalcode/core/feature/warp/event/PreWarpTeleportEvent.java

* Minor touchups

* Add @ApiStatus.Internal annotation to deinitialize() method

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Jakub Kędziora <77227023+Jakubk15@users.noreply.github.com>
@Jakubk15 Jakubk15 requested a review from CitralFlo February 7, 2026 10:31
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.

Migrate to JSpecify annotations

5 participants