Skip to content

migrate from jetbrains annotations to jspecify #3851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 12, 2025
Merged

migrate from jetbrains annotations to jspecify #3851

merged 2 commits into from
Mar 12, 2025

Conversation

andimarek
Copy link
Member

@andimarek andimarek commented Mar 6, 2025

Following the Spring project: https://docs.spring.io/spring-framework/reference/7.0-SNAPSHOT/core/null-safety.html

this PR moves from Jetbrains annotations to the jspecify project ones: https://jspecify.dev/

This is compatible with Kotlin:

However, the compiler understands JSpecify annotations and is able to use them to make Kotlin code see null-safe types when calling into Java code. The Kotlin compiler correctly interprets @nullable and @NullMarked starting at version 1.8.20, @nonnull starting at 2.0.0, and @NullUnmarked starting in 2.0.20.

As of version 2.1.0, the Kotlin compiler emits errors by default for problems found using JSpecify nullness. To change those to warnings, pass the -Xnullability-annotations=@org.jspecify.annotations:warn flag.

From https://jspecify.dev/docs/whether/#kotlin

Copy link
Contributor

github-actions bot commented Mar 6, 2025

Test Results

  310 files    310 suites   46s ⏱️
3 563 tests 3 557 ✅ 6 💤 0 ❌
3 652 runs  3 646 ✅ 6 💤 0 ❌

Results for commit 2cd77b2.

@andimarek andimarek merged commit 11a2be5 into master Mar 12, 2025
2 checks passed
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.

3 participants