Conversation
Replaces legacy JSR-305/SpotBugs annotations with the modern JSpecify
standard across the framework. This resolves longstanding JPMS split-package
warnings (javax.annotation), lightens the dependency tree, and modernizes
null-safety contracts.
Core & Global Changes:
- Removed `spotbugs-annotations` and `jsr305` dependencies entirely.
- Added `org.jspecify:jspecify` as the unified nullability standard.
- Swapped `@ReturnValuesAreNonnullByDefault` for `@NullMarked` in packages.
- Cleaned up redundant `@NonNull` annotations. JSpecify's `@NullMarked`
applies a non-null default to the entire scope (returns, parameters,
and fields), making explicit non-null declarations unnecessary.
jooby-apt (Annotation Processing):
- Added support for Type-Use annotations.
- Processors now correctly check both the element declaration AND the
underlying return/parameter types (`asType().getAnnotationMirrors()`)
to resolve nullability, fixing the visibility gap between legacy
declaration annotations and modern type-use annotations.
jooby-openapi (ASM Bytecode Parsing):
- Overhauled parameter annotation extraction to gather type annotations
(`visibleTypeAnnotations` & `invisibleTypeAnnotations`) alongside
standard parameter arrays.
- Hardened nullability detection: replaced hardcoded JetBrains/SpotBugs
descriptors with flexible substring matching ("Nullable", "NonNull",
"NotNull"). The OpenAPI generator is now fully library-agnostic and
will correctly parse JSpecify, JetBrains, Lombok, or SpotBugs annotations.
- fix #3906
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replaces legacy JSR-305/SpotBugs annotations with the modern JSpecify standard across the framework. This resolves longstanding JPMS split-package warnings (javax.annotation), lightens the dependency tree, and modernizes null-safety contracts.
Core & Global Changes:
spotbugs-annotationsandjsr305dependencies entirely.org.jspecify:jspecifyas the unified nullability standard.@ReturnValuesAreNonnullByDefaultfor@NullMarkedin packages.@NonNullannotations. JSpecify's@NullMarkedapplies a non-null default to the entire scope (returns, parameters, and fields), making explicit non-null declarations unnecessary.jooby-apt (Annotation Processing):
asType().getAnnotationMirrors()) to resolve nullability, fixing the visibility gap between legacy declaration annotations and modern type-use annotations.jooby-openapi (ASM Bytecode Parsing):
Overhauled parameter annotation extraction to gather type annotations (
visibleTypeAnnotations&invisibleTypeAnnotations) alongside standard parameter arrays.Hardened nullability detection: replaced hardcoded JetBrains/SpotBugs descriptors with flexible substring matching ("Nullable", "NonNull", "NotNull"). The OpenAPI generator is now fully library-agnostic and will correctly parse JSpecify, JetBrains, Lombok, or SpotBugs annotations.
fix nullability: replace spotbugs annotations with jspecify #3906