Skip to content

Commit 100d0aa

Browse files
committed
Minor formatting fixes
1 parent 6e05637 commit 100d0aa

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/main/java/net/tascalate/concurrent/Promise.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ default Promise<T> onTimeout(Supplier<T> supplier, Duration duration, boolean ca
115115

116116
// timeout converted to supplier
117117
Promise<Supplier<T>> onTimeout = Promises
118-
.delay(duration)
119-
.dependent()
118+
.delay(duration)
119+
.dependent()
120120
.thenApply(d -> supplier, true);
121121

122122
Promise<T> result = dependent()

src/main/java/net/tascalate/concurrent/Promises.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ public static <T> Promise<List<T>> atLeast(int minResultsCount, int maxErrorsCou
428428
int size = null == promises ? 0 : promises.size();
429429
if (minResultsCount > size) {
430430
throw new IllegalArgumentException(
431-
"The number of futures supplied is less than a number of futures to await");
431+
"The number of futures supplied is less than a number of futures to await"
432+
);
432433
} else if (minResultsCount == 0) {
433434
return success(Collections.emptyList());
434435
} else if (size == 1) {
@@ -504,10 +505,10 @@ public static <T> Promise<T> failAfter(long delay, TimeUnit timeUnit) {
504505

505506
public static Promise<Void> poll(Runnable codeBlock, Executor executor, RetryPolicy retryPolicy) {
506507
Promise<Object> wrappedResult = pollOptional(
507-
() -> { codeBlock.run(); return Optional.of(new Object()); },
508-
executor, retryPolicy
509-
);
510-
return wrappedResult.dependent().thenApply(v -> null, true);
508+
() -> { codeBlock.run(); return Optional.of(new Object()); },
509+
executor, retryPolicy
510+
);
511+
return wrappedResult.dependent().thenApply(v -> null, true);
511512
}
512513

513514
public static <T> Promise<T> poll(Callable<? extends T> codeBlock, Executor executor, RetryPolicy retryPolicy) {
@@ -531,7 +532,7 @@ public static <T> Promise<T> pollOptional(Callable<Optional<? extends T>> codeBl
531532
);
532533
Consumer<Promise<?>> changeCallPromiseRef = p -> {
533534
// If result promise is cancelled after callPromise was set need to stop;
534-
callPromiseRef.set( p );
535+
callPromiseRef.set( p );
535536
if (promise.isDone()) {
536537
p.cancel(true);
537538
}

0 commit comments

Comments
 (0)