[Maintenance]: Change nullability annotations

Open
#6,129 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
build-system

Research direction

Find the project's dependency declarations and Java sources using javax.annotation.Nullable or javax.annotation.Nonnull. Start by checking how dependencies are managed and searching for those annotation uses. Add JSpecify, replace the annotations, and remove jsr305; done when the project builds with all usages migrated and the old dependency removed.

Written by the indexing model from the issue text.

Description

code-maintenance
Describe the problem

So far, we have been using javax.annotation.Nullable and javax.annotation.Nonnull whereever we using nullability annotations. These are great for things like return and parameter types, but have limited uses elsewhere.

Also, despite living under javax, these are not standard annotations as JSR-305 was never accepted. The annotations are instead provided by com.google.code.findbugs:jsr305:3.0.2, which is not being kept up-to-date with language changes (no update since 2017).

The improvement you'd like to see
  • Add a dependency on org.jspecify:jspecify.
  • Replace uses of javax.annotations.Nullable with org.jspecify.annotations.Nullable
  • Replace uses of javax.annotations.Nonnull with org.jspecify.annotations.NonNull
  • Remove the dependency on com.google.code.findbugs:jsr305
Expected Benefits

We'll have nullability annotations that can be used in most contexts (e.g., generics) from a library that is maintained and can react to language changes (even though releases are rarely needed).

Additional Context

No response

Dominant language
Java
Stars
927
Forks
286
Avg merge
3d 17h
Merged PRs (30d)
94

Getting set up

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 RPTools/maptool

All issues in RPTools/maptool

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.