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
?
Quentin
(Quentin Jaquier)
May 8, 2020, 9:42am
2
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
system
(system)
Closed
July 30, 2020, 12:32pm
3
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.