Problem statement
The project uses nullable contracts (@Nullable / JSpecify), but null-safety is not enforced as a compile-time gate. This leaves room for NPE regressions in constructor paths, parser/validator flows, and Spring auto-configuration wiring during refactors or feature work.
Proposed solution
Integrate Error Prone + NullAway and enforce it across target modules immediately (no phased rollout).
- Enable Error Prone + NullAway for:
jsonrpc-core
jsonrpc-spring-webmvc
jsonrpc-spring-boot-autoconfigure
- optionally
samples/* under the same policy
- Configure
AnnotatedPackages:
- Make NullAway violations fail the build locally and in CI (
check/ci).
- Define suppression policy:
- allow
@SuppressWarnings("NullAway") only when necessary
- require a short justification comment
- Document:
- local setup/run instructions
- false-positive handling
- suppression rules with examples
Alternatives considered
- SpotBugs nullness checks: useful, but weaker as a compile-time enforcement gate.
- Checker Framework: stronger type system, but higher migration and maintenance cost.
- Keep current JSpecify-only approach: low friction, but no hard regression gate.
JSON-RPC behavior impact
No protocol-level behavior change. This is a build-time safety/quality enforcement improvement.
Additional context
Acceptance criteria:
- NullAway enabled across target modules and wired into CI.
./gradlew check fails on NullAway violations.
- Suppressions are minimal and justified.
- Relevant docs (README/docs/CONTRIBUTING) updated.
Problem statement
The project uses nullable contracts (
@Nullable/ JSpecify), but null-safety is not enforced as a compile-time gate. This leaves room for NPE regressions in constructor paths, parser/validator flows, and Spring auto-configuration wiring during refactors or feature work.Proposed solution
Integrate Error Prone + NullAway and enforce it across target modules immediately (no phased rollout).
jsonrpc-corejsonrpc-spring-webmvcjsonrpc-spring-boot-autoconfiguresamples/*under the same policyAnnotatedPackages:com.limehee.jsonrpccheck/ci).@SuppressWarnings("NullAway")only when necessaryAlternatives considered
JSON-RPC behavior impact
No protocol-level behavior change. This is a build-time safety/quality enforcement improvement.
Additional context
Acceptance criteria:
./gradlew checkfails on NullAway violations.