Can S108 respect exceptions named "ignored"?

Using SonarLint in IntelliJ w/Java.

try {
    throwException();
} catch (final Exception ignored) {
    // sonar S108 doesn't respect `ignored`
}

I’ve gotten into the habit of naming my ignored exceptions according to IntelliJ inspections. But, since using Sonar, I’ve had to add a comment, too.

Is there any chance we can get S108 to stop complaining if the var is named ignored?

Hello @DreamingVoid, welcome to the community.

My feeling is that simply calling a variable ignored is not enough to justify an empty block, adding a comment explaining why it is ignored would increase the clarity and maintainability of the code.

Does it make sense?

Best,
Quentin

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.