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
FallThrough check false positive with labelled break #11230
Comments
#3885 is also about a FallThrough false positive, but it focuses on infinite loops, which are harder to detect. |
We should not violate break to label. Any break should be good to consider it as valid code. |
we need to behave same as in this case, nested switch shoudl not be something special |
@romani |
fixed, same behavior. |
@romani I am taking this |
I have read check documentation: https://checkstyle.sourceforge.io/config_coding.html#FallThrough
I have downloaded the latest checkstyle from: https://checkstyle.org/cmdline.html#Download_and_Run
I have executed the cli and showed it below, as cli describes the problem better than 1,000 words
Expected result is no errors. This code never falls through from case 1 to case 2. The problem seems to only happen with a labelled break. If I use
return 11
instead ofbreak top
then checkstyle does not find a problem.The text was updated successfully, but these errors were encountered: