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
InnerAssignmentCheck failed for one line code in Java 14 switch expression #13086
Comments
Andromeda227799
pushed a commit
to Andromeda227799/checkstyle
that referenced
this issue
May 25, 2023
… in Java 14 switch expression
Andromeda227799
pushed a commit
to Andromeda227799/checkstyle
that referenced
this issue
May 27, 2023
… in Java 14 switch expression
Andromeda227799
pushed a commit
to Andromeda227799/checkstyle
that referenced
this issue
May 27, 2023
… in Java 14 switch expression
Andromeda227799
pushed a commit
to Andromeda227799/checkstyle
that referenced
this issue
May 27, 2023
… in Java 14 switch expression
Andromeda227799
pushed a commit
to Andromeda227799/checkstyle
that referenced
this issue
May 28, 2023
… in Java 14 switch expression
Andromeda227799
pushed a commit
to Andromeda227799/checkstyle
that referenced
this issue
May 28, 2023
… in Java 14 switch expression
Andromeda227799
pushed a commit
to Andromeda227799/checkstyle
that referenced
this issue
May 28, 2023
… in Java 14 switch expression
Andromeda227799
pushed a commit
to Andromeda227799/checkstyle
that referenced
this issue
May 28, 2023
… in Java 14 switch expression
Andromeda227799
pushed a commit
to Andromeda227799/checkstyle
that referenced
this issue
Jun 6, 2023
… in Java 14 switch expression
aayushRedHat
added a commit
to aayushRedHat/checkstyle
that referenced
this issue
Dec 16, 2023
… in Java 14 switch expression
@romani @nrmancuso there is an open PR for this but no activity since jan.idk if it is abandoned.so can i take this or should we wait |
@mahfouz72 you can pick it up, I closed the PR |
mahfouz72
added a commit
to mahfouz72/checkstyle
that referenced
this issue
Apr 16, 2024
mahfouz72
added a commit
to mahfouz72/checkstyle
that referenced
this issue
Apr 16, 2024
mahfouz72
added a commit
to mahfouz72/checkstyle
that referenced
this issue
Apr 16, 2024
mahfouz72
added a commit
to mahfouz72/checkstyle
that referenced
this issue
Apr 16, 2024
mahfouz72
added a commit
to mahfouz72/checkstyle
that referenced
this issue
Apr 16, 2024
mahfouz72
added a commit
to mahfouz72/checkstyle
that referenced
this issue
Apr 19, 2024
mahfouz72
added a commit
to mahfouz72/checkstyle
that referenced
this issue
Apr 19, 2024
mahfouz72
added a commit
to mahfouz72/checkstyle
that referenced
this issue
May 8, 2024
mahfouz72
added a commit
to mahfouz72/checkstyle
that referenced
this issue
May 8, 2024
rnveach
pushed a commit
that referenced
this issue
May 12, 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.org/config_coding.html#InnerAssignment
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
Describe what you expect in detail.
Checkstyle behaves differently between one line code and code block for Java 14's Switch Expression. In the given code above, checkstyle will complain about
case "Y" -> flag = true;
but notcase "N" -> {flag = false;}
. I'm afraid that it's becauseflag = true;
is equivalent toreturn flag = true;
? But the return value is not used here in the switch expression, we just want to do the value assignment.Expected: no violations on such code.
The text was updated successfully, but these errors were encountered: