Skip to content

Commit

Permalink
Removes recordFailure and getFailure methods which were previously de…
Browse files Browse the repository at this point in the history
…precated.
  • Loading branch information
jhalterman committed Sep 20, 2022
1 parent 0169715 commit 0f3f66d
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 72 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### API Changes

- `ExecutionContext.getStartTime` now returns an `Instant` rather than a `Duration` object.
- `ExecutionContext.getLastFailure`, `Execution.recordFailure` and similar methods for recording Exceptions, which were previously deprecated, were removed. Use `getLastException`, `recordException`, etc. instead.

# 3.2.4

Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/dev/failsafe/AsyncExecution.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,4 @@ public interface AsyncExecution<R> extends ExecutionContext<R> {
* @throws IllegalStateException if the most recent execution was already recorded or the execution is complete
*/
void recordException(Throwable exception);

/**
* @deprecated Use {@link #recordException(Throwable)} instead
*/
@Deprecated
void recordFailure(Throwable failure);
}
6 changes: 0 additions & 6 deletions core/src/main/java/dev/failsafe/AsyncExecutionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ public void recordException(Throwable exception) {
record(null, exception);
}

@Override
@Deprecated
public void recordFailure(Throwable failure) {
recordException(failure);
}

@Override
public boolean isAsyncExecution() {
return asyncExecution;
Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/dev/failsafe/CircuitBreaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@ default void acquirePermit() {
*/
void recordException(Throwable exception);

/**
* @deprecated Use {@link #recordException(Throwable)} instead.
*/
@Deprecated
void recordFailure(Throwable failure);

/**
* Records an execution {@code result} as a success or failure based on the failure configuration.
*/
Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/dev/failsafe/Execution.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,4 @@ static <R> Execution<R> of(Policy<R> outerPolicy, Policy<R>... policies) {
* @throws IllegalStateException if the execution is already complete
*/
void recordException(Throwable exception);

/**
* @deprecated Use {@link #recordException(Throwable)} instead
*/
@Deprecated
void recordFailure(Throwable failure);
}
6 changes: 0 additions & 6 deletions core/src/main/java/dev/failsafe/ExecutionContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ public interface ExecutionContext<R> {
*/
<T extends Throwable> T getLastException();

/**
* @deprecated Use {@link #getLastException()} instead
*/
@Deprecated
<T extends Throwable> T getLastFailure();

/**
* Returns the last result that was recorded else {@code null}.
*/
Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/dev/failsafe/ExecutionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,6 @@ public <T extends Throwable> T getLastException() {
return r == null ? null : (T) r.getException();
}

@Override
@Deprecated
public <T extends Throwable> T getLastFailure() {
return getLastException();
}

@Override
public R getLastResult() {
ExecutionResult<R> r = result != null ? result : previousResult;
Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/dev/failsafe/SyncExecutionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ public void recordException(Throwable exception) {
postExecute(new ExecutionResult<>(null, exception));
}

@Override
@Deprecated
public void recordFailure(Throwable failure) {
recordException(failure);
}

@Override
public synchronized void preExecute() {
if (isStandalone()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ public Throwable getLastException() {
return exception;
}

/**
* @deprecated Use {@link #getLastException()} instead
*/
@Deprecated
public Throwable getLastFailure() {
return exception;
}

/**
* Returns the result that preceded the event, else {@code null} if there was none.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ public Throwable getException() {
return exception;
}

/**
* @deprecated Use {@link #getException()} instead
*/
@Deprecated
public Throwable getFailure() {
return exception;
}

/**
* Returns the result that preceded the event, else {@code null} if there was none.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ public Throwable getLastException() {
return exception;
}

/**
* @deprecated Use {@link #getLastException()} instead
*/
@Deprecated
public Throwable getLastFailure() {
return exception;
}

/**
* Returns the result that preceded the event, else {@code null} if there was none.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,6 @@ public void recordException(Throwable exception) {
recordResult(null, exception);
}

@Override
@Deprecated
public void recordFailure(Throwable failure) {
recordException(failure);
}

@Override
public void recordResult(R result) {
recordResult(result, null);
Expand Down

0 comments on commit 0f3f66d

Please sign in to comment.