From 59403fc9e145aac5c5c9a9d4fbf0474a725c0f3c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 5 Oct 2024 10:39:55 +0200 Subject: [PATCH] [java] SwitchStmtsShouldHaveDefault - also ignore record pattern --- .../resources/category/java/bestpractices.xml | 4 ++-- .../xml/SwitchStmtsShouldHaveDefault.xml | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index aa965d9f67..58fea8b30b 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -1178,8 +1178,8 @@ class SomeTestClass { diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/SwitchStmtsShouldHaveDefault.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/SwitchStmtsShouldHaveDefault.xml index e28cfe5b9d..145739199e 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/SwitchStmtsShouldHaveDefault.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/SwitchStmtsShouldHaveDefault.xml @@ -313,6 +313,22 @@ public class Example2 { } } } +]]> + + + + With Record Patterns #4813 + 0 + System.out.println(a); + } + } +} ]]>