Skip to content

Commit 18f4a82

Browse files
committed
Example cleanup
1 parent c629eb5 commit 18f4a82

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/test/java/net/jodah/failsafe/examples/RetryLoopExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class RetryLoopExample {
3737
public static void main(String... args) throws Throwable {
3838
RetryPolicy<Object> retryPolicy = new RetryPolicy<>().handle(IllegalStateException.class).withBackoff(10, 40,
3939
ChronoUnit.MILLIS);
40-
Execution execution = new Execution(retryPolicy);
40+
Execution<Object> execution = new Execution<>(retryPolicy);
4141

4242
while (!execution.isComplete()) {
4343
try {
@@ -50,7 +50,7 @@ public static void main(String... args) throws Throwable {
5050
}
5151
}
5252

53-
assertEquals(execution.getLastResult(), Integer.valueOf(5));
53+
assertEquals(execution.getLastResult(), 5);
5454
assertEquals(execution.getAttemptCount(), 3);
5555
}
5656
}

src/test/java/net/jodah/failsafe/examples/RxJavaExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ public static void main(String... args) {
3636
else
3737
System.out.println("Subscriber completed successfully");
3838
}).retryWhen(attempts -> {
39-
Execution execution = new Execution(retryPolicy);
39+
Execution<Object> execution = new Execution<>(retryPolicy);
4040
return attempts.flatMap(failure -> {
4141
System.out.println("Failure detected");
4242
if (execution.canRetryOn(failure))
4343
return Observable.timer(execution.getWaitTime().toNanos(), TimeUnit.NANOSECONDS);
4444
else
45-
return Observable.<Long>error(failure);
45+
return Observable.error(failure);
4646
});
4747
}).toBlocking().forEach(System.out::println);
4848
}

0 commit comments

Comments
 (0)