[java] SwitchStmtsShouldHaveDefault: use new PatternLabel attribute

This commit is contained in:
Andreas Dangel 2024-10-24 11:29:40 +02:00
parent e37f82b62d
commit 6c35c73919
No known key found for this signature in database
GPG Key ID: 93450DF2DF9A3FA3

View File

@ -1177,9 +1177,11 @@ class SomeTestClass {
<properties> <properties>
<property name="xpath"> <property name="xpath">
<value><![CDATA[ <value><![CDATA[
//SwitchStatement[@DefaultCase = false() and @ExhaustiveEnumSwitch = false()] //SwitchStatement
[@DefaultCase = false()]
[@ExhaustiveEnumSwitch = false()]
(: exclude pattern tests - for these, the compiler will ensure exhaustiveness :) (: exclude pattern tests - for these, the compiler will ensure exhaustiveness :)
[not(*/SwitchLabel/(TypePattern|RecordPattern))] [*/SwitchLabel[@PatternLabel = false()]]
]]></value> ]]></value>
</property> </property>
</properties> </properties>