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

[java] [6.3.0] PrematureDeclaration false-positive #1067

Closed
boris-petrov opened this Issue Apr 30, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@boris-petrov

boris-petrov commented Apr 30, 2018

This is a regression from 6.2.0. We have a million of those warnings. It happens whenever a variable is used in a lambda which is in a return statement:

String foo = "";
return new ArrayList<String>().stream().anyMatch(bar -> foo.equals(bar));

Note that the following doesn't trigger the warning:

String foo = "";
return new ArrayList<String>().stream().anyMatch(foo::equals);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment