Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
Extract try-catch to avoid Eclipse compiler bug (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Mar 31, 2022
1 parent 40ab054 commit d8cc4f8
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,26 +173,29 @@ private void processExpression(final Expression expression, final Consumer<Strin
}

private void processFix(final Supplier<String> messageSupplier, final Runnable runnable) {
final FixExecutionException exception;
final FixExecutionException exception = tryRun(messageSupplier, runnable);
if (exception != null) {
metafix.getStrictness().handle(exception, record);
}
}

private FixExecutionException tryRun(final Supplier<String> messageSupplier, final Runnable runnable) { // checkstyle-disable-line ReturnCount
try {
runnable.run();
return;
}
catch (final FixProcessException e) {
throw e; // TODO: Add nesting information?
}
catch (final FixExecutionException e) {
exception = e; // TODO: Add nesting information?
return e; // TODO: Add nesting information?
}
catch (final IllegalStateException | NumberFormatException e) {
exception = new FixExecutionException(messageSupplier.get(), e);
return new FixExecutionException(messageSupplier.get(), e);
}
catch (final RuntimeException e) { // checkstyle-disable-line IllegalCatch
throw new FixProcessException(messageSupplier.get(), e);
}

metafix.getStrictness().handle(exception, record);
return null;
}

private String executionExceptionMessage(final Expression expression) {
Expand Down

0 comments on commit d8cc4f8

Please sign in to comment.