I can relate your comment to the following code: throw new RuntimeException("IO error");
Yes, that is bad and should be avoided.
However, in case of "throw new RuntimeException(e)", we are basically just converting a checked exception to an unchecked one. Yes, we are aware that the calling code will not be able distinguish these exceptions from the system-generated exceptions - and we are ok with it. We do not need to distinguish them. When we need to distinguish, of course we will introduce a specific Exception subclass.
Yes, we could introduce a MyException extends RuntimeException and throw that everywhere where we are currently throwing RuntimeException. But this is just plain wrong -- introducing a new exception just to make Sonar happy. And we would need to put this new exception in some dependency and make sure all our modules have access to that -- it is just too much effort for no gain.
As a general comment: the decision of how people write code is not yours to make. If a team working on a project has agreed upon a certain set of coding patterns then the toolset should support those patterns not work against them (within certain reasonable limits, of course). In most cases, Sonar adapts itself quite nicely. And there are plenty of rules to choose from. However, in this particular case, I agree to disagree.
I'm a firm believer of sensible defaults. And in case the defaults are not enough, they should be configurable.
As writing a custom plugin is too much effort for us (compared to the gain we get from this rule), we have just disabled this rule. This will reduce the usefulness of Sonar for us, but so be it -- life is not perfect.
Thank you for the response.
Neeme