Merge branch 'pr/3405' into 7.0.x

This commit is contained in:
Clément Fournier committed 2021-08-07 17:27:50 +02:00
commit e222c8422f
3 files changed
+4 -7

No files matched your search

+1 -1
View File
@@ -129,7 +129,7 @@
<!-- <rule ref="category/java/design.xml/AvoidThrowingNewInstanceOfSameException"/> -->
<rule ref="category/java/design.xml/AvoidThrowingNullPointerException"/>
<!-- <rule ref="category/java/design.xml/AvoidThrowingRawExceptionTypes"/> -->
<!-- <rule ref="category/java/design.xml/AvoidUncheckedExceptionsInSignatures"/> -->
<rule ref="category/java/design.xml/AvoidUncheckedExceptionsInSignatures"/>
<!-- <rule ref="category/java/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal"/> -->
<rule ref="category/java/design.xml/CognitiveComplexity" />
<rule ref="category/java/design.xml/CollapsibleIfStatements"/>
@@ -286,8 +286,8 @@ public class Foo {
class="net.sourceforge.pmd.lang.rule.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_design.html#avoiduncheckedexceptionsinsignatures">
<description>
A method or constructor should not explicitly declare unchecked exceptions in its
`throws` clause. Java doesn't force the caller to handle an unchecked exception,
Reports unchecked exceptions in the `throws` clause of a method or constructor.
Java doesn't force the caller to handle an unchecked exception,
so it's unnecessary except for documentation. A better practice is to document the
exceptional cases with a `@throws` Javadoc tag, which allows being more descriptive.
</description>
@@ -296,9 +296,7 @@ exceptional cases with a `@throws` Javadoc tag, which allows being more descript
<property name="xpath">
<value>
<![CDATA[
//MethodDeclaration/NameList/Name[pmd-java:typeIs("java.lang.RuntimeException")]
|
//ConstructorDeclaration/NameList/Name[pmd-java:typeIs("java.lang.RuntimeException")]
//ThrowsList/ClassOrInterfaceType[pmd-java:typeIs('java.lang.RuntimeException')]
]]>
</value>
</property>
@@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.design;
import net.sourceforge.pmd.testframework.PmdRuleTst;
@org.junit.Ignore("Rule has not been updated yet")
public class AvoidUncheckedExceptionsInSignaturesTest extends PmdRuleTst {
// no additional unit tests
}