NullAway icon indicating copy to clipboard operation
NullAway copied to clipboard

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

Open ZacSweers opened this issue 4 years ago • 1 comments

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.

ZacSweers avatar Dec 30 '20 23:12 ZacSweers

We are actively working on this, actually! 😉

Just to set expectations, though: the general version of "take an annotated codebase and add annotations in all the right places" is a hard research problem. Also, by "we", I mean @nimakarimipour is working on this for Ph.D. under @msridhar's direction.

So, @nimakarimipour, assigning this one to you.

lazaroclapp avatar Dec 30 '20 23:12 lazaroclapp