testcontainers / testcontainers/testcontainers-java

[Enhancement]: migrate nullability annotations to jspecify

Open
#10,284 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/enhancement
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Module

Core

Proposal

Use jspecify for nullability annotations: https://jspecify.dev/docs/start-here/

Guava switched to jspecify for nullability annotations in 33.4.4:
https://github.com/google/guava/releases/tag/v33.4.4

Implementation note: it is recommended to go for "non-nullable by default", so in vast majority of the cases @NonNull annotation should not be used. @NonNull should be at the package level, and only @Nullable types should be annotated. It would reduce the amount of the noise in the code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Core module and the JSpecify start-here documentation linked in the issue, then review how nullability annotations are currently used there. Use Guava 33.4.4 as a reference for the migration approach; done means Core uses package-level non-nullability by default and annotates only nullable types with JSpecify.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.