Skip to content

Commit 720fcf0

Browse files
committed
Removes recordFailure and getFailure methods which were previously deprecated.
1 parent 0169715 commit 720fcf0

12 files changed

+1
-72
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### API Changes
44

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

78
# 3.2.4
89

core/src/main/java/dev/failsafe/AsyncExecution.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,4 @@ public interface AsyncExecution<R> extends ExecutionContext<R> {
6161
* @throws IllegalStateException if the most recent execution was already recorded or the execution is complete
6262
*/
6363
void recordException(Throwable exception);
64-
65-
/**
66-
* @deprecated Use {@link #recordException(Throwable)} instead
67-
*/
68-
@Deprecated
69-
void recordFailure(Throwable failure);
7064
}

core/src/main/java/dev/failsafe/AsyncExecutionImpl.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,6 @@ public void recordException(Throwable exception) {
111111
record(null, exception);
112112
}
113113

114-
@Override
115-
@Deprecated
116-
public void recordFailure(Throwable failure) {
117-
recordException(failure);
118-
}
119-
120114
@Override
121115
public boolean isAsyncExecution() {
122116
return asyncExecution;

core/src/main/java/dev/failsafe/CircuitBreaker.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,6 @@ default void acquirePermit() {
233233
*/
234234
void recordException(Throwable exception);
235235

236-
/**
237-
* @deprecated Use {@link #recordException(Throwable)} instead.
238-
*/
239-
@Deprecated
240-
void recordFailure(Throwable failure);
241-
242236
/**
243237
* Records an execution {@code result} as a success or failure based on the failure configuration.
244238
*/

core/src/main/java/dev/failsafe/Execution.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,4 @@ static <R> Execution<R> of(Policy<R> outerPolicy, Policy<R>... policies) {
8181
* @throws IllegalStateException if the execution is already complete
8282
*/
8383
void recordException(Throwable exception);
84-
85-
/**
86-
* @deprecated Use {@link #recordException(Throwable)} instead
87-
*/
88-
@Deprecated
89-
void recordFailure(Throwable failure);
9084
}

core/src/main/java/dev/failsafe/ExecutionContext.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ public interface ExecutionContext<R> {
6262
*/
6363
<T extends Throwable> T getLastException();
6464

65-
/**
66-
* @deprecated Use {@link #getLastException()} instead
67-
*/
68-
@Deprecated
69-
<T extends Throwable> T getLastFailure();
70-
7165
/**
7266
* Returns the last result that was recorded else {@code null}.
7367
*/

core/src/main/java/dev/failsafe/ExecutionImpl.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,6 @@ public <T extends Throwable> T getLastException() {
244244
return r == null ? null : (T) r.getException();
245245
}
246246

247-
@Override
248-
@Deprecated
249-
public <T extends Throwable> T getLastFailure() {
250-
return getLastException();
251-
}
252-
253247
@Override
254248
public R getLastResult() {
255249
ExecutionResult<R> r = result != null ? result : previousResult;

core/src/main/java/dev/failsafe/SyncExecutionImpl.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,6 @@ public void recordException(Throwable exception) {
132132
postExecute(new ExecutionResult<>(null, exception));
133133
}
134134

135-
@Override
136-
@Deprecated
137-
public void recordFailure(Throwable failure) {
138-
recordException(failure);
139-
}
140-
141135
@Override
142136
public synchronized void preExecute() {
143137
if (isStandalone()) {

core/src/main/java/dev/failsafe/event/ExecutionAttemptedEvent.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@ public Throwable getLastException() {
4040
return exception;
4141
}
4242

43-
/**
44-
* @deprecated Use {@link #getLastException()} instead
45-
*/
46-
@Deprecated
47-
public Throwable getLastFailure() {
48-
return exception;
49-
}
50-
5143
/**
5244
* Returns the result that preceded the event, else {@code null} if there was none.
5345
*/

core/src/main/java/dev/failsafe/event/ExecutionCompletedEvent.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@ public Throwable getException() {
4040
return exception;
4141
}
4242

43-
/**
44-
* @deprecated Use {@link #getException()} instead
45-
*/
46-
@Deprecated
47-
public Throwable getFailure() {
48-
return exception;
49-
}
50-
5143
/**
5244
* Returns the result that preceded the event, else {@code null} if there was none.
5345
*/

0 commit comments

Comments
 (0)