GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [java] UselessParentheses FP around switch expression · Issue #6123 · pmd/pmd Closed Labels a:false-positivePMD flags a piece of code that is not problematic Milestone DescriptionAffects PMD Version: 6.55.0, 7.13.0 Rule: UselessParentheses Description: When chaining a method call directly after a switch expression, the expression has to be wrapped into parentheses. Removing the parentheses is a syntax error (at least in Java 17.0.16). PMD detects this as a Code Sample demonstrating the issue: public class Main { public enum E { A, B; } public static String foo(final E e) { return (switch (e) { case A -> "bar"; case B -> "baz"; }).toUpperCase(); } } Expected outcome: PMD shouldn't detect the parentheses around the switch expression as Running PMD through: CLI and Gradle Activity
MetadataMetadataAssigneesLabelsa:false-positivePMD flags a piece of code that is not problematic TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |