Skip to content

Conversation

@sh-cho
Copy link
Contributor

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

(Base: #6457)

Motivation:
jsr-305 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, ...)

Modifications:

  • Add JSpecify dependency
  • Deprecate internal annotations and replace to JSpecify annotations
    • com.linecorp.armeria.common.annotation.Nullable -> org.jspecify.annotations.NullMarked
    • com.linecorp.armeria.common.annotation.NonNullByDefault -> org.jspecify.annotations.Nullable

Note:
Since JSpecify's Nullable annotation is type-use annotation, placement of existing jsr-305 annotations are incompatible with JSpecify one, so following steps should be applied (ref: https://jspecify.dev/docs/using/#if-your-code-already-uses-jsr-305-annotations)

  • @Nullable Object[] -> Object @Nullable []
  • @Nullable Map.Entry<K, V> -> Map.@Nullable Entry<K, V>

Result:

@sh-cho sh-cho marked this pull request as ready for review October 25, 2025 16:36
@sh-cho
Copy link
Contributor Author

sh-cho commented Oct 25, 2025

Need to sort out commits
-> rebase done

@sh-cho sh-cho marked this pull request as draft October 25, 2025 17:13
Signed-off-by: Seonghyeon Cho <[email protected]>
@sh-cho sh-cho force-pushed the jspecify-nullable branch from a329f31 to b4e359d Compare October 26, 2025 05:11
Signed-off-by: Seonghyeon Cho <[email protected]>

Remove temp comment

Signed-off-by: Seonghyeon Cho <[email protected]>

Add deprecated comment

Signed-off-by: Seonghyeon Cho <[email protected]>

Add indent on imports

Signed-off-by: Seonghyeon Cho <[email protected]>

Add indent more

Signed-off-by: Seonghyeon Cho <[email protected]>
`Type argument is not within its bounds: should be subtype of
'kotlin.Any'.`, etc

Signed-off-by: Seonghyeon Cho <[email protected]>
@sh-cho sh-cho force-pushed the jspecify-nullable branch from b4e359d to a03482b Compare October 26, 2025 11:17
@sh-cho sh-cho marked this pull request as ready for review October 26, 2025 11:42
@sh-cho

This comment was marked as resolved.

@sh-cho sh-cho marked this pull request as draft October 26, 2025 11:57
@sh-cho sh-cho marked this pull request as ready for review October 26, 2025 15:11
@sh-cho
Copy link
Contributor Author

sh-cho commented Nov 12, 2025

I'll open this after #6457 gets merged and rebased

@sh-cho sh-cho marked this pull request as draft November 12, 2025 14:04
minwoox pushed a commit that referenced this pull request Nov 13, 2025
Motivation:

In annotated service, type-use `@Nullable` annotation (ex. jspecify) is not respected.

Modifications:

- Add jspecify dependency
  - (Migration in progress. See #6456)
- In `AnnotatedValueResolver#isAnnotatedNullable`, add checks for type-use nullable annotation

Result:

- Resolves #6454
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.

Use JetBrains's Java annotations?

1 participant