From 7f6f31fcf6ddec488b187d2c962e1746d4392533 Mon Sep 17 00:00:00 2001 From: Jonathan Halterman Date: Mon, 4 Sep 2023 11:41:29 -0700 Subject: [PATCH] Minor javadoc fixes --- .../java/dev/failsafe/internal/FallbackExecutor.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/dev/failsafe/internal/FallbackExecutor.java b/core/src/main/java/dev/failsafe/internal/FallbackExecutor.java index 14d01d56..86701655 100644 --- a/core/src/main/java/dev/failsafe/internal/FallbackExecutor.java +++ b/core/src/main/java/dev/failsafe/internal/FallbackExecutor.java @@ -40,8 +40,7 @@ public FallbackExecutor(FallbackImpl fallback, int policyIndex) { } /** - * Performs an execution by calling pre-execute else calling the supplier, applying a fallback if it fails, and - * calling post-execute. + * Performs an execution by applying the {@code innerFn}, applying a fallback if it fails, and calling post-execute. */ @Override public Function, ExecutionResult> apply( @@ -70,7 +69,8 @@ public Function, ExecutionResult> apply( } /** - * Performs an async execution by calling pre-execute else calling the supplier and doing a post-execute. + * Performs an async execution by applying the {@code innerFn}, applying a fallback if it fails, and calling + * post-execute. */ @Override public Function, CompletableFuture>> applyAsync( @@ -91,11 +91,13 @@ public Function, CompletableFuture> CompletableFuture> promise = new CompletableFuture<>(); Callable callable = () -> { try { - CompletableFuture fallbackFuture = fallback.applyStage(result.getResult(), result.getException(), execution); + CompletableFuture fallbackFuture = fallback.applyStage(result.getResult(), result.getException(), + execution); fallbackFuture.whenComplete((innerResult, exception) -> { if (exception instanceof CompletionException) exception = exception.getCause(); - ExecutionResult r = exception == null ? result.withResult(innerResult) : ExecutionResult.exception(exception); + ExecutionResult r = + exception == null ? result.withResult(innerResult) : ExecutionResult.exception(exception); promise.complete(r); }); } catch (Throwable t) {