-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
google_checks: False positive on left curly brace in switch statement with lambda-like construct #15851
Comments
@Zopsss , please glance. |
violations from this module: checkstyle/src/main/resources/google_checks.xml Lines 94 to 99 in 69aaaff
|
This shows that case/default are considered as regular blocks of class/if-else/ ...
|
@romani your PR is merged, and user's problem is resolved. The issue is ready to be closed. |
@bradleylarrick , fix is released, please update your project. |
Found the same problem with 10.20.0 last week (didn't check earlier versions), had to workaround due to the enhanced switch statements. Thanks @romani for fixing this, thanks @bradleylarrick for reporting! |
Expected no violations.
I found a couple more false positives on the LeftCurlyNL in a switch statement with lambda-like construct. I formatted the code using google-java-format-1.24.0-all-deps.jar and ran checkstyle using checkstyle-10.20.0-all.jar. The warnings seem to be generated when the left curly brace is followed by a comment:
generated the following:
And:
Generated:
The text was updated successfully, but these errors were encountered: