GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add ArchUnit rule to ban javax & JetBrains nullability annotations by dondonz · Pull Request #3985 · graphql-java/graphql-java

Conversation

@dondonz

@dondonz dondonz commented May 23, 2025

Copy link
Copy Markdown
Member

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)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dondonz added 2 commits May 23, 2025 17:41
@dondonz
Add ArchUnit rule to ban javax nullability annotations
65e2c84
@dondonz
Rename to nullability annotation
08c8bd3
@dondonz dondonz added this to the 25.x breaking changes milestone May 23, 2025
dondonz
dondonz commented May 23, 2025
View reviewed changes
Comment thread build.gradle
-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,*

@dondonz dondonz May 23, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented May 23, 2025

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andimarek

andimarek commented May 23, 2025

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dondonz

dondonz commented May 26, 2025

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

andimarek
andimarek approved these changes May 26, 2025
View reviewed changes
@dondonz
dondonz merged commit 27a71b2 into master May 27, 2025
@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

Reviewers

@andimarek andimarek andimarek approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

25.x breaking changes

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@dondonz @andimarek
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.