org.sonar.l10n.java.rules.squid.S1160.html Maven / Gradle / Ivy
The newest version!
Using checked exceptions forces method callers to deal with errors, either by propagating them or by handling them.
This makes those exceptions fully part of the API of the method.
To keep the complexity for callers reasonable, methods should not throw more than one kind of checked exception.
The following code:
public void delete() throws IOException, SQLException { // Non-Compliant
/* ... */
}
should be refactored into:
public void delete() throws SomeApplicationLevelException { // Compliant
/* ... */
}
Overriding methods are not checked by this rule and are allowed to throw several checked exceptions.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy