Merge branch 'pr/3735' into 7.0.x
This commit is contained in:
@ -124,7 +124,7 @@
|
||||
<rule ref="category/java/design.xml/AvoidRethrowingException"/>
|
||||
<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/AvoidThrowingRawExceptionTypes"/>
|
||||
<rule ref="category/java/design.xml/AvoidUncheckedExceptionsInSignatures"/>
|
||||
<rule ref="category/java/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal"/>
|
||||
<rule ref="category/java/design.xml/CognitiveComplexity" />
|
||||
|
@ -250,7 +250,7 @@ Exception, or Error, use a subclassed exception or error instead.
|
||||
<property name="xpath">
|
||||
<value>
|
||||
<![CDATA[
|
||||
//ThrowStatement//AllocationExpression
|
||||
//ThrowStatement//ConstructorCall
|
||||
/ClassOrInterfaceType[
|
||||
pmd-java:typeIsExactly('java.lang.Throwable')
|
||||
or
|
||||
|
@ -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 AvoidThrowingRawExceptionTypesTest extends PmdRuleTst {
|
||||
public static class Throwable extends java.lang.Throwable {
|
||||
private static final long serialVersionUID = 1798165250043760600L;
|
||||
|
@ -7,6 +7,7 @@
|
||||
<test-code>
|
||||
<description>throwing various types</description>
|
||||
<expected-problems>4</expected-problems>
|
||||
<expected-linenumbers>3,4,5,6</expected-linenumbers>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
void bar() {
|
||||
@ -57,6 +58,7 @@ public class PmdTest {
|
||||
<test-code>
|
||||
<description>False negative when importing another exception</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<expected-linenumbers>6</expected-linenumbers>
|
||||
<code><![CDATA[
|
||||
import java.io.IOException;
|
||||
|
||||
|
Reference in New Issue
Block a user