Skip to content

Conversation

@sh-cho
Copy link
Contributor

@sh-cho sh-cho commented Oct 19, 2025

Motivation:
jsr305 is dormant and now JSpecify is recommended annotation sets for variety of static analyses (for now, it supports only nullness) and many open sources are moving to JSpecify (e.g. Spring Framework, Guava, ...)

Modification:

  • Replace javax.annotation.Nullable, com.linecorp.armeria.common.annotation.Nullable with org.jspecify.annotations.Nullable
  • Use @NullMarked (org.jspecify.annotations.NullMarked) instead of NonNullByDefault and apply it to package-info.javas
  • Use @Nullable within inner or fully-qualified type names (Java enforces this to @Target(ElementType.TYPE_USE))

Result:
resolves #1193

Note:
For armeria service, I didn't change existing nullability annotations which used as parameter because it breaks tests.
(ex. ContentServiceV1) -> JsonPatchOperationIntegrationTest failed
I debugged shortly and looks like JSpecify`s nullability annotation is not handled correctly in armeria. It can be handled in other proj / issue.

Signed-off-by: Seonghyeon Cho <[email protected]>
Simply replaced annotations only. Compile errors should be handled in
the next commits

Signed-off-by: Seonghyeon Cho <[email protected]>
Signed-off-by: Seonghyeon Cho <[email protected]>
Signed-off-by: Seonghyeon Cho <[email protected]>
Signed-off-by: Seonghyeon Cho <[email protected]>
@sh-cho sh-cho changed the title Add jspecify dependency Migrate to JSpecify annotations Oct 19, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 19, 2025

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

193 files out of 300 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Oct 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.77%. Comparing base (ca4e9d7) to head (c8cb731).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1194      +/-   ##
============================================
- Coverage     70.68%   68.77%   -1.92%     
+ Complexity     4764     4668      -96     
============================================
  Files           475      480       +5     
  Lines         19633    20109     +476     
  Branches       2158     2249      +91     
============================================
- Hits          13877    13829      -48     
- Misses         4583     5074     +491     
- Partials       1173     1206      +33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sh-cho sh-cho marked this pull request as ready for review October 19, 2025 14:17
@minwoox
Copy link
Contributor

minwoox commented Oct 20, 2025

@sh-cho Thanks for the PR! 👍
I want to apply this to Armeria first.
Would you check if the annotation works correctly, in the situation that we mentioned in this issue, please?
line/armeria#2793

@sh-cho
Copy link
Contributor Author

sh-cho commented Oct 20, 2025

@minwoox Ok let me check armeria first

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate to JSpecify annotations for nullability constraints

3 participants