Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code cleanup #233

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public <T> T call(Callable<T> callable) throws Exception {
}

// Suppress API warnings about TimeLimiter in Guava which has been there since version 1.0
@SuppressWarnings("UnstableApiUsage")
@Immutable
private static final class FixedAttemptTimeLimit implements AttemptTimeLimiter {

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/kiwiproject/retry/AttemptTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void shouldCreateWithResult() {
() -> assertThat(attempt.hasResult()).isTrue(),
() -> assertThat(attempt.hasException()).isFalse(),
() -> assertThat(attempt.getResult()).isEqualTo(result),
() -> assertThatIllegalStateException().isThrownBy(() -> attempt.getException()),
() -> assertThatIllegalStateException().isThrownBy(attempt::getException),
() -> assertThat(attempt.getAttemptNumber()).isEqualTo(attemptNumber),
() -> assertThat(attempt.getDelaySinceFirstAttempt()).isEqualTo(delaySinceFirstAttempt)
);
Expand All @@ -49,7 +49,7 @@ void shouldAllowNullResult() {
() -> assertThat(attempt.hasResult()).isTrue(),
() -> assertThat(attempt.hasException()).isFalse(),
() -> assertThat(attempt.getResult()).isNull(),
() -> assertThatIllegalStateException().isThrownBy(() -> attempt.getException()),
() -> assertThatIllegalStateException().isThrownBy(attempt::getException),
() -> assertThat(attempt.getAttemptNumber()).isEqualTo(attemptNumber),
() -> assertThat(attempt.getDelaySinceFirstAttempt()).isEqualTo(delaySinceFirstAttempt)
);
Expand All @@ -63,7 +63,7 @@ void shouldCreateWithException() {
assertAll(
() -> assertThat(attempt.hasResult()).isFalse(),
() -> assertThat(attempt.hasException()).isTrue(),
() -> assertThatIllegalStateException().isThrownBy(() -> attempt.getResult()),
() -> assertThatIllegalStateException().isThrownBy(attempt::getResult),
() -> assertThat(attempt.getException()).isSameAs(exception),
() -> assertThat(attempt.getAttemptNumber()).isEqualTo(attemptNumber),
() -> assertThat(attempt.getDelaySinceFirstAttempt()).isEqualTo(delaySinceFirstAttempt)
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/kiwiproject/retry/RetryerBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ private static Callable<Boolean> callableCountingDownAlwaysNull(final CountDownL

private static Callable<Boolean> callableReturningNullUntil5Attempts() {
return new Callable<>() {
AtomicInteger count = new AtomicInteger();
final AtomicInteger count = new AtomicInteger();

@Override
public Boolean call() {
Expand All @@ -543,7 +543,7 @@ private static Callable<Boolean> callableThrowingIOExceptionUntil5Attempts() {

private static <E extends Exception> Callable<Boolean> callableThrowingExceptionUntil5Attempts(E e) {
return new Callable<>() {
AtomicInteger count = new AtomicInteger();
final AtomicInteger count = new AtomicInteger();

@Override
public Boolean call() throws E {
Expand All @@ -557,7 +557,7 @@ public Boolean call() throws E {

private static Callable<Boolean> callableThrowingOrReturningNullUntil5Attempts() {
return new Callable<>() {
AtomicInteger counter = new AtomicInteger();
final AtomicInteger counter = new AtomicInteger();

@Override
public Boolean call() throws IOException {
Expand Down