forked from phoedos/pmd
[java] TooFewBranchesForSwitch: use new PatternLabel attribute
This commit is contained in:
parent
66d879f707
commit
6f5af6e585
@ -628,9 +628,10 @@ Note: This rule was named TooFewBranchesForASwitchStatement before PMD 7.7.0.
|
||||
<property name="xpath">
|
||||
<value>
|
||||
<![CDATA[
|
||||
//(SwitchStatement | SwitchExpression)[ (count(*) - 1) < $minimumNumberCaseForASwitch ]
|
||||
(: exclude pattern matching :)
|
||||
[not(*/SwitchLabel/(TypePattern|RecordPattern))]
|
||||
//(SwitchStatement | SwitchExpression)
|
||||
[ (count(*) - 1) < $minimumNumberCaseForASwitch ]
|
||||
(: only consider if no pattern matching is used :)
|
||||
[*/SwitchLabel[@PatternLabel = false()]]
|
||||
]]>
|
||||
</value>
|
||||
</property>
|
||||
|
Loading…
x
Reference in New Issue
Block a user