[Enhancement]: migrate nullability annotations to jspecify

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

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.

Description

type/enhancement
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.

Dominant language
Java
Stars
8.8k
Forks
2k
Avg merge
2d 1h
Merged PRs (30d)
11

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from testcontainers/testcontainers-java

All issues in testcontainers/testcontainers-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.