Enable PMD rule AvoidInstanceofChecksInCatchClause and fix violations

This commit is contained in:
Manuel Fuhr 2022-11-13 12:56:50 +01:00
parent 30be64cbbe
commit 1bff48b649
2 changed files with 2 additions and 4 deletions

View file

@ -805,10 +805,9 @@ public abstract class BExpressionContext implements IByteArrayUnifier {
for (int i = 0; i < minWriteIdx; i++) {
variableData[i] = readOnlyData[i];
}
} catch (Exception e) {
if (e instanceof IllegalArgumentException) {
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("ParseException " + file + " at line " + linenr + ": " + e.getMessage());
}
} catch (Exception e) {
throw new RuntimeException(e);
}
if (expressionList.size() == 0) {

View file

@ -14,7 +14,6 @@
<exclude name="AssignmentToNonFinalStatic" />
<exclude name="AvoidBranchingStatementAsLastInLoop" />
<exclude name="AvoidCatchingThrowable" />
<exclude name="AvoidInstanceofChecksInCatchClause" />
<exclude name="AvoidProtectedFieldInFinalClass" />
<exclude name="AvoidUsingVolatile" />
<exclude name="CloseResource" />