[Suggestion]Let rule S1194 detect more specific errors is recommended

Affects Sonarqube Version:
Sonarqube version: 8.1.0.31237
sonar-scanner version: 4.2.0.1873-windows

Rule:
S1194: “java.lang.Error” should not be extended

Description:
It is recommended to supplement the detection of more specific errors, such as AssertionError, AssertionFailedError, ExpectationError and StackOverflowError

Code Sample demonstrating the issue:

public class AssertionFailedError extends AssertionError {
}

Expected outcome:
suggestion

Running Sonarqube through:
command line

Hello

It makes sense to me, I created a ticket (SONARJAVA-3440) to keep track of this improvment.

Thanks for the feedback.

Best,
Quentin

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