org.sonar.l10n.pmd.AvoidThrowingNewInstanceOfSameException.html Maven / Gradle / Ivy
Catch blocks that merely rethrow a caught exception wrapped inside a new instance of the same type only add to code size and runtime complexity. Example :
public class Foo {
void bar() {
try {
// do something
} catch (SomeException se) {
// harmless comment
throw new SomeException(se);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy