typetools / typetools/checker-framework

Create two versions of the Optional Checker

Open
#1,425 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
Java
Stars
1.1k
Forks
440
Avg merge
1d 12h
Merged PRs (30d)
134

Description

One is a lightweight checker that is independent of the Nullness Checker. It only checks properties # 2-7, not anything about nullness.
(I need to figure out all the places that the Optional Checker is coupled to the Nullness Checker. One example is the precise type-checking for the return type of ofNullable() is an example, but this probably isn't so important a feature: a user can use of() instead of ofNullable() if the user knows the arguments are non-null.)

The other is the Nullness Checker, which will do checking of Optional just as it currently does for Initialization and KeyFor. It makes sense to call this the Nullness Checker rather than the Optional Checker or the heavyweight Optional Checker, in terms of what most of the implementation is and in terms of getting people to use it (since the heavyweight Optional Checker wouldn't be as attractive as the Nullness Checker to a potential user).
There are two possible implementation strategies.

  • The implementation of the Nullness Checker will be the Optional Checker, with the Nullness Checker as a subchecker; this may momentarily surprise someone who reads the implementation, but a // comment will clarify the issue.
  • The Optional Checker would be a sub-checker of the current Nullness Checker.

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 by tracing where the Optional Checker is coupled to the Nullness Checker, including the precise type-checking for ofNullable(). Compare the two proposed subchecker arrangements and define done as a lightweight checker for properties 2–7 plus Nullness Checker handling of Optional checks without nullness-independent behavior being required.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.