Skip to content

Commit

Permalink
refactor: use final var instead of reassigning var 🥧
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Jan 27, 2025
1 parent 8d1cecf commit a54a48e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ static CffuFactory withDefaultExecutor(CffuFactory fac, Executor defaultExecutor
return new CffuFactory(makeExecutor(defaultExecutor), fac.forbidObtrudeMethods());
}

private static Executor makeExecutor(Executor defaultExecutor) {
private static Executor makeExecutor(final Executor defaultExecutor) {
// check CffuMadeExecutor interface to avoid re-wrapping.
if (defaultExecutor instanceof CffuMadeExecutor) return defaultExecutor;

requireNonNull(defaultExecutor, "defaultExecutor is null");

// because wraps the input executor below, MUST call `screenExecutor` translation beforehand;
// otherwise the sequent operations can NOT recognize the input executor.
defaultExecutor = LLCF.screenExecutor(defaultExecutor);
Executor wrapByProviders = wrapExecutorByProviders(defaultExecutor);
final Executor screenExecutor = LLCF.screenExecutor(defaultExecutor);
final Executor wrapByProviders = wrapExecutorByProviders(screenExecutor);
return wrapMadeInterface(wrapByProviders);
}

Expand Down

0 comments on commit a54a48e

Please sign in to comment.