We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Affects PMD Version: 7.6.0
Rule: TooFewBranchesForASwitchStatement
Description: The rule currently only checks Switch Statements, but should also check Switch Expressions.
Therefore, the rule should be renamed to TooFewBranchesForSwitch (remove the statement part)
Code Sample demonstrating the issue:
public class DumbSwitch { public String foo(int i) { return switch (i) { // violation expected here case 0: { yield "I am a fish."; } }; } }
Expected outcome:
PMD should report a violation at line ..., but doesn't. This is a false-negative.
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
The text was updated successfully, but these errors were encountered:
Fix pmd#5249 and pmd#5250: [java] TooFewBranchesForSwitch ignore patt…
3a501a0
…ern matching and support switch expressions (pmd#5251) Merge pull request pmd#5251 from adangel:issue-5249-5250
b87944a
Successfully merging a pull request may close this issue.
Affects PMD Version: 7.6.0
Rule: TooFewBranchesForASwitchStatement
Description:
The rule currently only checks Switch Statements, but should also check Switch Expressions.
Therefore, the rule should be renamed to TooFewBranchesForSwitch (remove the statement part)
Code Sample demonstrating the issue:
Expected outcome:
PMD should report a violation at line ..., but doesn't. This is a false-negative.
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
The text was updated successfully, but these errors were encountered: