Skip to content

Commit

Permalink
few javadoc fixes (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfa1 committed Apr 4, 2021
1 parent f9ddba0 commit a06e09b
Show file tree
Hide file tree
Showing 21 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/jodah/failsafe/AsyncExecution.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ boolean isAsyncExecution() {

/**
* Attempts to complete the parent execution, calls failure handlers, and completes the future if needed. Runs
* synchrnously since a concrete result is needed.
* synchronously since a concrete result is needed.
*
* @throws IllegalStateException if the execution is already complete
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/jodah/failsafe/CircuitBreaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public synchronized CircuitBreaker<R> withFailureThreshold(int failureThreshold,
/**
* Configures time based failure thresholding by setting the number of failures that must occur within the {@code
* failureThresholdingPeriod} when in a CLOSED state in order to open the circuit. The number of executions must also
* exceed the {@code failureExecutionThreshod} within the {@code failureThresholdingPeriod} when in the CLOSED state
* exceed the {@code failureExecutionThreshold} within the {@code failureThresholdingPeriod} when in the CLOSED state
* before the circuit can be opened.
* <p>
* If a {@link #withSuccessThreshold(int) success threshold} is not configured, the {@code failureThreshold} will also
Expand Down Expand Up @@ -515,7 +515,7 @@ public synchronized CircuitBreaker<R> withFailureThreshold(int failureThreshold,
/**
* Configures time based failure rate thresholding by setting the percentage rate of failures, from 1 to 100, that
* must occur within the rolling {@code failureThresholdingPeriod} when in a CLOSED state in order to open the
* circuit. The number of executions must also exceed the {@code failureExecutionThreshod} within the {@code
* circuit. The number of executions must also exceed the {@code failureExecutionThreshold} within the {@code
* failureThresholdingPeriod} before the circuit can be opened.
* <p>
* If a {@link #withSuccessThreshold(int) success threshold} is not configured, the {@code failureExecutionThreshold}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public CircuitBreakerOpenException(CircuitBreaker circuitBreaker) {
this.circuitBreaker = circuitBreaker;
}

/** Retruns the {@link CircuitBreaker} that caused the exception. */
/** Returns the {@link CircuitBreaker} that caused the exception. */
public CircuitBreaker getCircuitBreaker() {
return circuitBreaker;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/jodah/failsafe/ExecutionContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public Duration getStartTime() {
}

/**
* Returns whether the execution has ben cancelled. In this case the implementor shuold attempt to stop execution.
* Returns whether the execution has ben cancelled. In this case the implementor should attempt to stop execution.
*/
public boolean isCancelled() {
return cancelled;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/jodah/failsafe/FailsafeFuture.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.concurrent.Future;

/**
* A CompletableFuture implementation that propogates cancellations and calls completion handlers.
* A CompletableFuture implementation that propagates cancellations and calls completion handlers.
* <p>
* Part of the Failsafe SPI.
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/jodah/failsafe/FailurePolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static <R> BiPredicate<R, Throwable> failurePredicateFor(Predicate<? extends Thr
/**
* Returns a predicate that evaluates the {@code resultPredicate} against a result, when present.
* <p>
* Short-circuts to false without invoking {@code resultPredicate}, when result is not present (i.e.
* Short-circuits to false without invoking {@code resultPredicate}, when result is not present (i.e.
* BiPredicate.test(null, Throwable)).
*/
static <R> BiPredicate<R, Throwable> resultPredicateFor(Predicate<R> resultPredicate) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/net/jodah/failsafe/Timeout.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.time.Duration;

/**
* A policy that fails an excecution with a {@link net.jodah.failsafe.TimeoutExceededException TimeoutExceededException}
* A policy that fails an execution with a {@link net.jodah.failsafe.TimeoutExceededException TimeoutExceededException}
* if it exceeds a timeout. Uses a separate thread on the configured scheduler or the common pool to perform timeouts
* checks.
* <p>
Expand All @@ -20,11 +20,11 @@
* can be used to handle a timeout being exceeded or not.</li>
* <li>{@link #withCancel(boolean) Cancellation and interruption} are not supported when performing an {@link
* FailsafeExecutor#getAsyncExecution(AsyncSupplier) async execution} and will have no effect since the async thread is
* unkown to Failsafe.</li>
* unknown to Failsafe.</li>
* </ul>
* </p>
* <p>
* This class is threadsafe.
* This class is thread-safe.
* </p>
*
* @param <R> result type
Expand Down Expand Up @@ -78,7 +78,7 @@ public boolean canInterrupt() {
* </li>
* <li>
* Cancellation and interruption are not supported when performing an {@link FailsafeExecutor#getAsyncExecution(AsyncSupplier)
* async execution} and will have no effect since the async thread is unkown to Failsafe.</p>
* async execution} and will have no effect since the async thread is unknown to Failsafe.</p>
* </li>
* </ul>
* </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public TimeoutExceededException(Timeout timeout) {
this.timeout = timeout;
}

/** Retruns the {@link Timeout} that caused the exception. */
/** Returns the {@link Timeout} that caused the exception. */
public Timeout getTimeout() {
return timeout;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public ExecutionAttemptedEvent(R result, Throwable failure, ExecutionContext con
}

/**
* Returns the failure that preceeded the event, else {@code null} if there was none.
* Returns the failure that preceded the event, else {@code null} if there was none.
*/
public Throwable getLastFailure() {
return failure;
}

/**
* Returns the result that preceeded the event, else {@code null} if there was none.
* Returns the result that preceded the event, else {@code null} if there was none.
*/
public R getLastResult() {
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public ExecutionCompletedEvent(R result, Throwable failure, ExecutionContext con
}

/**
* Returns the failure that preceeded the event, else {@code null} if there was none.
* Returns the failure that preceded the event, else {@code null} if there was none.
*/
public Throwable getFailure() {
return failure;
}

/**
* Returns the result that preceeded the event, else {@code null} if there was none.
* Returns the result that preceded the event, else {@code null} if there was none.
*/
public R getResult() {
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public TimedCircuitStats(int bucketCount, Duration thresholdingPeriod, Clock clo

/**
* Copies the most recent stats from the {@code oldStats} into this in order from oldest to newest and orders buckets
* from oldest to newest, with unitialized buckets counting as oldest.
* from oldest to newest, with uninitialized buckets counting as oldest.
*/
void copyStats(CircuitStats oldStats) {
if (oldStats instanceof TimedCircuitStats) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/net/jodah/failsafe/AbstractFailsafeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ public void shouldTimeoutAndCancelAndInterrupt() throws Throwable {
}

/**
* Ensures that an interrupted execution should always have the interrupt flag cleared aferwards.
* Ensures that an interrupted execution should always have the interrupt flag cleared afterwards.
*/
public void shouldHandleNonInterruptableExecution() throws Throwable {
// Given
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/net/jodah/failsafe/AsyncFailsafeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void shouldCompleteFutureExternally() throws Throwable {
/**
* Tests a scenario where three timeouts should cause all delegates to be cancelled with interrupts.
*/
public void shouldCancelNestedTimeoutsWithInterupt() throws Throwable {
public void shouldCancelNestedTimeoutsWithInterrupt() throws Throwable {
// Given
RetryPolicy<Boolean> rp = new RetryPolicy<Boolean>().withMaxRetries(2);
Timeout<Boolean> timeout1 = Timeout.of(Duration.ofMillis(1000));
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/net/jodah/failsafe/CircuitBreakerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void shouldRequireValidSuccessThresholdRatio() {
assertThrows(() -> new CircuitBreaker().withSuccessThreshold(2, 1), IllegalArgumentException.class);
}

public void shouldDefaulDelay() throws Throwable {
public void shouldDefaultDelay() throws Throwable {
CircuitBreaker breaker = new CircuitBreaker();
breaker.recordFailure();
Thread.sleep(100);
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/net/jodah/failsafe/FailsafeFutureTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ public void shouldCallOnCompleteWhenCancelled() throws Throwable {

future.cancel(true);
waiter.await(1000, 2);
future.complete("unxpected2");
future.complete("unexpected2");
Asserts.assertThrows(future::get, CancellationException.class);
}

/**
* Asserts that a completed future ignroes subsequent completion attempts.
* Asserts that a completed future ignores subsequent completion attempts.
*/
public void shouldNotCancelCompletedFuture() throws Throwable {
// Given
Expand Down Expand Up @@ -83,7 +83,7 @@ public void shouldNotCompleteCancelledFuture() {
});

future.cancel(true);
future.complete("unxpected2");
future.complete("unexpected2");
Asserts.assertThrows(future::get, CancellationException.class);
}
}
2 changes: 1 addition & 1 deletion src/test/java/net/jodah/failsafe/ListenersTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public void testForUnhandledFailureAsync() throws Throwable {
}

/**
* Asserts that listeners aree called the expected number of times when retries are exceeded.
* Asserts that listeners are called the expected number of times when retries are exceeded.
*/
private void assertForRetriesExceeded(boolean sync) throws Throwable {
// Given - Fail 4 times and exceed retries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class CountingCircuitStatsTest extends CircuitStatsTest {
CountingCircuitStats stats;

public void shouldReturnUnitializedValues() {
public void shouldReturnUninitializedValues() {
stats = new CountingCircuitStats(100, null);
for (int i = 0; i < 100; i++) {
assertEquals(stats.setNext(true), -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public void shouldHandleLateSetFailureRatio() {
* Asserts that the late configuration of a success ratio is handled by resetting the state's internal tracking. Also
* asserts that executions from prior configurations are carried over to a new configuration.
*/
public void shouldHandleLateSetSucessRatio() {
public void shouldHandleLateSetSuccessRatio() {
// Given
breaker.halfOpen();
HalfOpenState state = Testing.stateFor(breaker);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void testMetrics() {
assertEquals(stats.getExecutionCount(), 0);

// Record into bucket 1
recordExecutions(stats, 50, i -> i % 5 == 0); // currenetTime = 0
recordExecutions(stats, 50, i -> i % 5 == 0); // currentTime = 0
assertEquals(stats.currentIndex, 0);
assertEquals(stats.getCurrentBucket().startTimeMillis, 0);
assertEquals(stats.getSuccessCount(), 10);
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/net/jodah/failsafe/issues/Issue131Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class Issue131Test {

/**
* This predicate is invoked in failure scenarios with an arg of null,
* producing a {@link NullPointerException} yielding surpising results.
* producing a {@link NullPointerException} yielding surprising results.
*/
private static Predicate<String> handleIfEqualsIgnoreCaseFoo = s -> {
return s.equalsIgnoreCase("foo"); // produces NPE when invoked in failing scenarios.
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/net/jodah/failsafe/issues/Issue192Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected void afterTest() {
/**
* Asserts the handling of multiple retry policies with an async execution.
*/
public void testAsnc() {
public void testAsync() {
AtomicInteger exceptionA = new AtomicInteger();
AtomicInteger exceptionB = new AtomicInteger();
AtomicInteger exceptionC = new AtomicInteger();
Expand Down

0 comments on commit a06e09b

Please sign in to comment.