Skip to content

Commit

Permalink
Fix check order of if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Niels de Bruin committed Oct 5, 2024
1 parent 771e21d commit 7bffbca
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ public J.Try visitTry(J.Try tryable, ExecutionContext ctx) {
// keep this one
for (int j = i + 1; j < tryable.getCatches().size(); j++) {
J.Try.Catch next = tryable.getCatches().get(j);
if (!onlyRethrows(next) && hasWiderExceptionType(aCatch, next)) {
if (hasWiderExceptionType(aCatch, next)) {
if (onlyRethrows(next)) {
return null;
}
return aCatch;
}
}
Expand Down

0 comments on commit 7bffbca

Please sign in to comment.