PMD version 6.13.0.
Rule: PreserveStackTrace
try {
...
} catch (IOException exception) {
if (exception.getMessage().contains("foobar")) {
throw new SomeOtherUserDefinedException("Error", exception);
}
throw exception;
}
This code produces a PreserveStackTrace error but it shouldn't according to the documentation of PreserveStackTrace.
PMD version 6.13.0.
Rule: PreserveStackTrace
This code produces a
PreserveStackTraceerror but it shouldn't according to the documentation ofPreserveStackTrace.