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

false-positive in AI_ANNOTATION_ISSUES_NEEDS_NULLABLE #385

Open
Vampire opened this issue Jan 23, 2020 · 0 comments
Open

false-positive in AI_ANNOTATION_ISSUES_NEEDS_NULLABLE #385

Vampire opened this issue Jan 23, 2020 · 0 comments

Comments

@Vampire
Copy link

Vampire commented Jan 23, 2020

The following method triggers mentioned rule:

public Object foo() {
    return CompletableFuture.completedFuture(new Object()).join();
}

But this can never return null.
The only way join() can return null is, if the futuer actually computed to null.
But actually in this case the future cannot compute to null.
The real-life situation where I got this is a more complex future, but it also will not return null.

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

No branches or pull requests

2 participants