From 13cc79af62d060bff491ff33cddf918cad0cb6ae Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 5 Oct 2024 10:36:39 +0200 Subject: [PATCH] [java] TooFewBranchesForSwitch - also ignore record pattern --- .../resources/category/java/performance.xml | 2 +- .../xml/TooFewBranchesForSwitch.xml | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/performance.xml b/pmd-java/src/main/resources/category/java/performance.xml index 4c0d2fe00c..2a6d218354 100644 --- a/pmd-java/src/main/resources/category/java/performance.xml +++ b/pmd-java/src/main/resources/category/java/performance.xml @@ -630,7 +630,7 @@ Note: This rule was named TooFewBranchesForASwitchStatement before PMD 7.7.0. diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/TooFewBranchesForSwitch.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/TooFewBranchesForSwitch.xml index 10dbb0081f..2af77f0e74 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/TooFewBranchesForSwitch.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/TooFewBranchesForSwitch.xml @@ -89,7 +89,7 @@ public class ValidSwitch { - [java] TooFewBranchesForASwitchStatement false positive for Pattern Matching + [java] TooFewBranchesForASwitchStatement false positive for Pattern Matching #5249 0 + + + + Record patterns are ignored, too #5249 + 0 + System.out.println(a); + } + } +} ]]>