[java] Update rule DoNotThrowExceptionInFinally

This commit is contained in:
Andreas Dangel
2021-11-29 09:45:19 +01:00
parent f36b99fbd7
commit d66d8828ab
4 changed files with 3 additions and 3 deletions

View File

@@ -207,7 +207,7 @@
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
<!-- <rule ref="category/java/errorprone.xml/DoNotExtendJavaLangThrowable"/> -->
<!-- <rule ref="category/java/errorprone.xml/DoNotHardCodeSDCard"/> -->
<!-- <rule ref="category/java/errorprone.xml/DoNotThrowExceptionInFinally"/> -->
<rule ref="category/java/errorprone.xml/DoNotThrowExceptionInFinally"/>
<rule ref="category/java/errorprone.xml/DontImportSun"/>
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/>
<rule ref="category/java/errorprone.xml/EmptyCatchBlock"/>

View File

@@ -1362,7 +1362,7 @@ Note: This is a PMD implementation of the Lint4j rule "A throw in a finally bloc
<priority>4</priority>
<properties>
<property name="xpath">
<value>//FinallyStatement[descendant::ThrowStatement]</value>
<value>//FinallyClause[descendant::ThrowStatement]</value>
</property>
</properties>
<example>

View File

@@ -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 DoNotThrowExceptionInFinallyTest extends PmdRuleTst {
// no additional unit tests
}

View File

@@ -7,6 +7,7 @@
<test-code>
<description>classic failure case</description>
<expected-problems>1</expected-problems>
<expected-linenumbers>8</expected-linenumbers>
<code><![CDATA[
public class Foo {
public void bar() {