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
WhitespaceAround reports a violation when switch expression is passed as a method argument #14825
Labels
Comments
I can confirm that other expressions do not show the same behavior:
|
I am on it |
strkkk
added a commit
to strkkk/checkstyle
that referenced
this issue
May 5, 2024
strkkk
added a commit
to strkkk/checkstyle
that referenced
this issue
May 10, 2024
nrmancuso
pushed a commit
to strkkk/checkstyle
that referenced
this issue
May 10, 2024
strkkk
added a commit
to strkkk/checkstyle
that referenced
this issue
May 10, 2024
strkkk
added a commit
to strkkk/checkstyle
that referenced
this issue
May 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have read check documentation: https://checkstyle.sourceforge.io/checks/whitespace/whitespacearound.html
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
After the introduction of switch expressions (e.g.,
return switch (...)
) theswitch
keyword can now be used anywhere where an expression could be used previously.As whitespace is not required before any other expression, it should also not be required before
switch
(when it is used as part of a larger expression). Therefore, I'd expect Checkstyle to allow this:Now it only allows this:
or this
I think this may have been a case missed in: #8687
The text was updated successfully, but these errors were encountered: