#1246 False positive from MissingBreakInSwitch
This commit is contained in:
@ -929,8 +929,9 @@ may indicate problematic behaviour. Empty cases are ignored as these indicate an
|
||||
[(count(.//BreakStatement)
|
||||
+ count(BlockStatement/Statement/ReturnStatement)
|
||||
+ count(BlockStatement/Statement/ThrowStatement)
|
||||
+ count(BlockStatement/Statement/IfStatement[@Else='true' and Statement[2][ReturnStatement|ThrowStatement]]/Statement[1][ReturnStatement|ThrowStatement])
|
||||
+ count(SwitchLabel[name(following-sibling::node()) = 'SwitchLabel'])
|
||||
+ count(SwitchLabel[count(following-sibling::node()) = 0 or count(child::node()) = 0])
|
||||
+ count(SwitchLabel[count(following-sibling::node()) = 0])
|
||||
< count (SwitchLabel))]
|
||||
]]>
|
||||
</value>
|
||||
|
@ -16,6 +16,7 @@
|
||||
* [#1241](https://sourceforge.net/p/pmd/bugs/1241/): False+ AvoidProtectedMethodInFinalClassNotExtending
|
||||
* [#1243](https://sourceforge.net/p/pmd/bugs/1243/): Useless Parentheses False Positive
|
||||
* [#1245](https://sourceforge.net/p/pmd/bugs/1245/): False Positive for Law of Demeter
|
||||
* [#1246](https://sourceforge.net/p/pmd/bugs/1246/): False positive from MissingBreakInSwitch
|
||||
* [#1247](https://sourceforge.net/p/pmd/bugs/1247/): Not able to recognize JDK 8 Static Method References
|
||||
|
||||
**Feature Requests and Improvements:**
|
||||
|
@ -140,7 +140,10 @@ public class Foo {
|
||||
else
|
||||
return null;
|
||||
case x3:
|
||||
return new Object();
|
||||
if (condition)
|
||||
return new Object();
|
||||
else
|
||||
return null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user