You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As commented on #4871 (review) - for Apex, formal (doc) comments are dealt the same way like other comments now. No special treatment.
I thought, EmptyCatchBlock does the same, since there was a test case explicitly for javadoc comments saying "Javadoc comment is not OK"... but a test case with allowCommentedBlock was missing for javadoc comments.
So it turns out, that for Java, javadoc comments are not treated specially as well. So the Apex and Java rule are similar now.
But testing further showed, it's a bit worse: When the rule is configured with allowCommentedBlocks=true, then empty catch blocks are not found anymore...
Affects PMD Version: 7.0.0
Rule: EmptyCatchBlock
Description:
As commented on #4871 (review) - for Apex, formal (doc) comments are dealt the same way like other comments now. No special treatment.
I thought, EmptyCatchBlock does the same, since there was a test case explicitly for javadoc comments saying "Javadoc comment is not OK"... but a test case with allowCommentedBlock was missing for javadoc comments.
So it turns out, that for Java, javadoc comments are not treated specially as well. So the Apex and Java rule are similar now.
But testing further showed, it's a bit worse: When the rule is configured with
allowCommentedBlocks=true
, then empty catch blocks are not found anymore...Code Sample demonstrating the issue:
Expected outcome:
PMD should report a violation at line 3, but doesn't. This is a false-negative.
The text was updated successfully, but these errors were encountered: