-
Notifications
You must be signed in to change notification settings - Fork 129
Migrate to JSpecify annotations #1194
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
base: main
Are you sure you want to change the base?
Conversation
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]>
Simply replaced annotations only. Compile errors should be handled in the next commits Signed-off-by: Seonghyeon Cho <[email protected]>
- https://jspecify.dev/docs/using/#if-your-code-already-uses-jsr-305-annotations 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]>
|
Important Review skippedMore 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 ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Signed-off-by: Seonghyeon Cho <[email protected]>
Signed-off-by: Seonghyeon Cho <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
@sh-cho Thanks for the PR! 👍 |
|
@minwoox Ok let me check armeria first |
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:
javax.annotation.Nullable,com.linecorp.armeria.common.annotation.Nullablewithorg.jspecify.annotations.Nullable@NullMarked(org.jspecify.annotations.NullMarked) instead ofNonNullByDefaultand apply it topackage-info.javas@Nullablewithin inner or fully-qualified type names (Java enforces this to@Target(ElementType.TYPE_USE))@Nullable public static com.linecorp.centraldogma.common.EntryType convertEntryType(...)public static com.linecorp.centraldogma.common.@Nullable EntryType convertEntryType(...)Result:
resolves #1193
Note:
For armeria service, I didn't change existing nullability annotations which used as parameter because it breaks tests.
(ex.
ContentServiceV1) ->JsonPatchOperationIntegrationTestfailedI debugged shortly and looks like JSpecify`s nullability annotation is not handled correctly in armeria. It can be handled in other proj / issue.