[java] Fix AvoidCatchingGenericException for multi-catch

This commit is contained in:
Andreas Dangel committed 2024-03-22 19:46:05 +01:00
1 parent 5670517396
commit e95d9d79f4
2 files changed
+2 -2

No files matched your search

@@ -62,7 +62,7 @@ Avoid catching generic exceptions such as NullPointerException, RuntimeException
<value>
<![CDATA[
//CatchParameter[
ClassType[
(.|UnionType)/ClassType[
pmd-java:typeIsExactly('java.lang.NullPointerException') or
pmd-java:typeIsExactly('java.lang.Exception') or
pmd-java:typeIsExactly('java.lang.RuntimeException')]
@@ -63,7 +63,7 @@ public class Foo {
<test-code>
<description>failure case with multi-catch</description>
<expected-problems>2</expected-problems>
<expected-problems>1</expected-problems>
<code><![CDATA[
public class Foo {
void bar() {