Affects Version/s: None
Fix Version/s: 1.3
Here is a dummy class where we try to confirm SONAR is able to detect bad usage of "throw new Exception":
When we run the analysis, SONAR is not able to detect the 3 "throw new Exception" whereas in some case we have seen it was able to.
To confirm that please have a look at the attached screenshot.
In the documentation of the rule "Avoid Throwing Raw Exception Types" it's written:
Avoid throwing certain exception types. Rather than throw a raw RuntimeException, Throwable, Exception, or Error, use a subclassed exception or error instead.
That's why in our test class, you will find use case of RuntimeException, Throwable, Exception and Error.