🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@dondonz
Copy link
Member

@dondonz dondonz commented May 23, 2025

Going forward we will be using JSpecify Nullability annotations.

It's possible to accidentally pull in the old javax Nullability annotations because this doesn't need any changes to our build.gradle dependencies.

While it's unlikely someone would accidentally add JetBrains Nullability annotations, because these require a new dependency to be added, I have also banned them.

Sample test output when a banned usage is found:

We are using JSpecify nullability annotations only. Please change the following to use JSpecify instead:
- Parameter <java.util.concurrent.CompletableFuture<T>> of method <graphql.execution.Async.orNullCompletedFuture(java.util.concurrent.CompletableFuture)> is annotated with <javax.annotation.Nullable> in (Async.java:0)

@dondonz dondonz added this to the 25.x breaking changes milestone May 23, 2025
-exportcontents: graphql.*
-removeheaders: Private-Package
Import-Package: !android.os.*,!com.google.*,!org.checkerframework.*,!javax.annotation.*,!graphql.com.google.*,!org.antlr.*,!graphql.org.antlr.*,!sun.misc.*,org.jspecify.annotations;resolution:=optional,*
Import-Package: !android.os.*,!com.google.*,!org.checkerframework.*,!graphql.com.google.*,!org.antlr.*,!graphql.org.antlr.*,!sun.misc.*,org.jspecify.annotations;resolution:=optional,*
Copy link
Member Author

Choose a reason for hiding this comment

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

While I'm here, we can clean up our config to remove javax.annotation

@github-actions
Copy link
Contributor

Test Results

  317 files    317 suites   2m 28s ⏱️
3 655 tests 3 650 ✅ 5 💤 0 ❌
3 744 runs  3 739 ✅ 5 💤 0 ❌

Results for commit 08c8bd3.

@andimarek
Copy link
Member

We also need to add this to gradle itself, right? Or am I missing something here?

@dondonz
Copy link
Member Author

dondonz commented May 26, 2025

We also need to add this to gradle itself, right? Or am I missing something here?

This runs as a standard test. If there's a violation, it'll turn up in our usual build as a failing test

Or did you mean about adding ArchUnit as a dependency? It was already added in another PR that added a rule

@dondonz dondonz merged commit 27a71b2 into master May 27, 2025
2 checks passed
@dondonz dondonz deleted the enforce-jspecify-and-no-other-nullability-libs branch May 27, 2025 08:05
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