Skip to content

#1382 make TYPE_USE annotations visible as dependencies#1666

Draft
winfriedgerlach wants to merge 1 commit into
TNG:mainfrom
winfriedgerlach:feature/#1382-detect-type-use-annotations-as-dependencies
Draft

#1382 make TYPE_USE annotations visible as dependencies#1666
winfriedgerlach wants to merge 1 commit into
TNG:mainfrom
winfriedgerlach:feature/#1382-detect-type-use-annotations-as-dependencies

Conversation

@winfriedgerlach

@winfriedgerlach winfriedgerlach commented Jul 15, 2026

Copy link
Copy Markdown

Many of you will have the same problem I have: migrating to JSpecify and making sure that no-one uses "the wrong nullability" annotations. Enforcing this is currently not possible with ArchUnit, since at least the Checker Framework annotations are also TYPE_USE annotations (like JSpecify), and thus are "invisible" to ArchUnit. (I had to use CheckStyle RegExes to achieve the desired result)

It turns out that solving this issue for ArchUnit is not that hard, it took Claude around 20 minutes. I just want to show the result to you for discussion - I am aware that this is not "mergeable" in its current state and other questions around JSpecify raised in #1382 need the exact position of the annotations as well, which is much more complicated. See https://github.com/TNG/ArchUnit/blob/0469f887876b311a7e63a077c2f96133f0ee316c/type-use-annotations-summary.md

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.

1 participant