[java] Update rule NonCaseLabelInSwitchStatement
This commit is contained in:
@ -237,7 +237,7 @@
|
||||
<rule ref="category/java/errorprone.xml/MissingSerialVersionUID"/>
|
||||
<!-- <rule ref="category/java/errorprone.xml/MissingStaticMethodInNonInstantiatableClass"/> -->
|
||||
<!-- <rule ref="category/java/errorprone.xml/MoreThanOneLogger"/> -->
|
||||
<!-- <rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement"/> -->
|
||||
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement"/>
|
||||
<rule ref="category/java/errorprone.xml/NonStaticInitializer"/>
|
||||
<!-- <rule ref="category/java/errorprone.xml/NullAssignment"/> -->
|
||||
<!-- <rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode"/> -->
|
||||
|
@ -2428,12 +2428,12 @@ public class Foo {
|
||||
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_errorprone.html#noncaselabelinswitchstatement">
|
||||
<description>
|
||||
A non-case label (e.g. a named break/continue label) was present in a switch statement.
|
||||
This legal, but confusing. It is easy to mix up the case labels and the non-case labels.
|
||||
This is legal, but confusing. It is easy to mix up the case labels and the non-case labels.
|
||||
</description>
|
||||
<priority>3</priority>
|
||||
<properties>
|
||||
<property name="xpath">
|
||||
<value>//SwitchStatement//BlockStatement/Statement/LabeledStatement</value>
|
||||
<value>//SwitchStatement//LabeledStatement</value>
|
||||
</property>
|
||||
</properties>
|
||||
<example>
|
||||
|
@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.errorprone;
|
||||
|
||||
import net.sourceforge.pmd.testframework.PmdRuleTst;
|
||||
|
||||
@org.junit.Ignore("Rule has not been updated yet")
|
||||
public class NonCaseLabelInSwitchStatementTest extends PmdRuleTst {
|
||||
// no additional unit tests
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
<test-code>
|
||||
<description>label inside switch</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<expected-linenumbers>6</expected-linenumbers>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
void bar(int x) {
|
||||
|
Reference in New Issue
Block a user