uber / uber/NullAway

Suggestion: Accept a `Nullable` annotation name and suggest it in cases where it's missing

Open
#438 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement longterm
Dominant language
Java
Stars
4.1k
Forks
370
Avg merge
1d 13h
Merged PRs (30d)
68

Description

Error-prone itself has some checks for this, but nullaway is obviously better at it.

Given an error like this

/Users/zsweers/dev/slack/restructure/slack-android-ng/libraries/foundation/slack-commons/src/main/java/slack/commons/logger/DebugLogger.java:62: error: [NullAway] parameter tag is @NonNull, but parameter in superclass method slack.commons.logger.Logger.log(java.lang.String,java.lang.String,java.lang.Throwable) is @Nullable
  public void log(final String tag, final String message, final Throwable throwable) {
                               ^
    (see http://t.uber.com/nullaway )

I'd like to be able to define my desired @Nullable annotation as an option and have nullaway suggest adding the annotation.

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 reproducing the NullAway diagnostic shown for DebugLogger.java and inspect the superclass Logger.log signature and the existing annotation-related checks. The work is done when a configured Nullable annotation name is accepted and NullAway suggests adding it where the diagnostic identifies a missing nullable annotation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.