From d5b77abd827f43e27cd68f62b6894b98b45c4dab Mon Sep 17 00:00:00 2001
From: "PMD CI (pmd-bot)"
This rule is defined by the following XPath expression:
-//CatchBlockStatement[./BlockStatement[count(*) = 0] and
- not(matches(@VariableName, $allowExceptionNameRegex)) and
- ($allowCommentedBlocks = false() or @ContainsComment = false())]
+//CatchBlockStatement[./BlockStatement[count(*) = 0]]
Example(s):
@@ -1747,18 +1745,6 @@ or reported.
Deprecated Code Climate Block Highlighting
no
-
- allowCommentedBlocks
- false
- Empty blocks containing comments will be skipped
- no
-
-
- allowExceptionNameRegex
- ^(ignored|expected)$
- Empty blocks catching exceptions with names matching this regular expression will be skipped
- no
-
@@ -1766,15 +1752,6 @@ or reported.
<rule ref="category/apex/errorprone.xml/EmptyCatchBlock" />
-Use this rule and customize it:
-<rule ref="category/apex/errorprone.xml/EmptyCatchBlock">
- <properties>
- <property name="allowCommentedBlocks" value="false" />
- <property name="allowExceptionNameRegex" value="^(ignored|expected)$" />
- </properties>
-</rule>
-
-
EmptyIfStmt
Since: PMD 6.0.0