Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate RemoteConfig with Nullity annotations #113

Open
xenoterracide opened this issue Nov 21, 2024 · 0 comments
Open

Annotate RemoteConfig with Nullity annotations #113

xenoterracide opened this issue Nov 21, 2024 · 0 comments

Comments

@xenoterracide
Copy link

Description

simply add @NonNull/@Nullable to the RemoteConfig class

Motivation

I'm getting an unsafe null, my headBranch method parameter @nonnull

      .map(s -> s.map(r -> { // r is RemoteConfig
        var name = r.getName();
        return new RemoteImpl(name, this.headBranch(name));
      }))
/home/xeno/IdeaProjects/gradle-semver/module/semver/src/main/java/com/xenoterracide/gradle/semver/internal/GitMetadataImpl.java:181: error: [NullAway] passing @Nullable parameter 'this.headBranch(name)' where @NonNull is required
        return new RemoteImpl(name, this.headBranch(name));
                                                   ^
    (see http://t.uber.com/nullaway )

Alternatives considered

I'm going to have to check for null... I'm not certain that it's actually possible for the name to be null, doesn't seem likely on a correct config, but maybe someone knows something I don't. I've noticed other objects are comprehensively annotated.

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant