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