Merge branch 'pr/3664' into 7.0.x
This commit is contained in:
4 files changed
+4
-4
No files matched your search
@@ -176,7 +176,7 @@
|
||||
<rule ref="category/java/errorprone.xml/AvoidAssertAsIdentifier"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop"/>
|
||||
<!-- <rule ref="category/java/errorprone.xml/AvoidCallingFinalize"/> -->
|
||||
<!-- <rule ref="category/java/errorprone.xml/AvoidCatchingNPE"/> -->
|
||||
<rule ref="category/java/errorprone.xml/AvoidCatchingNPE"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidCatchingThrowable"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
|
||||
<!-- <rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals"/> -->
|
||||
|
||||
@@ -223,8 +223,7 @@ original error, causing other, more subtle problems later on.
|
||||
<property name="xpath">
|
||||
<value>
|
||||
<![CDATA[
|
||||
//CatchStatement/FormalParameter/Type
|
||||
/ReferenceType/ClassOrInterfaceType[@Image='NullPointerException']
|
||||
//CatchClause/CatchParameter/ClassOrInterfaceType[pmd-java:typeIsExactly('java.lang.NullPointerException')]
|
||||
]]>
|
||||
</value>
|
||||
</property>
|
||||
|
||||
-1
@@ -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 AvoidCatchingNPETest extends PmdRuleTst {
|
||||
// no additional unit tests
|
||||
}
|
||||
+2
@@ -7,6 +7,7 @@
|
||||
<test-code>
|
||||
<description>failure case</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<expected-linenumbers>4</expected-linenumbers>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
void bar() {
|
||||
@@ -28,6 +29,7 @@ public class Foo {
|
||||
} catch (FooException e) {
|
||||
}
|
||||
}
|
||||
public static class FooException extends NullPointerException {}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
Reference in new issue
Block a user