Skip to content

Commit cd2a3fd

Browse files
committed
Remove deprecations in HandlerResult
See gh-30608
1 parent 71dfebb commit cd2a3fd

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/HandlerResult.java

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,10 +16,6 @@
1616

1717
package org.springframework.web.reactive;
1818

19-
import java.util.function.Function;
20-
21-
import reactor.core.publisher.Mono;
22-
2319
import org.springframework.core.MethodParameter;
2420
import org.springframework.core.ResolvableType;
2521
import org.springframework.lang.Nullable;
@@ -46,9 +42,6 @@ public class HandlerResult {
4642
@Nullable
4743
private DispatchExceptionHandler exceptionHandler;
4844

49-
@Nullable
50-
private Function<Throwable, Mono<HandlerResult>> exceptionHandlerFunction;
51-
5245

5346
/**
5447
* Create a new {@code HandlerResult}.
@@ -149,40 +142,4 @@ public DispatchExceptionHandler getExceptionHandler() {
149142
return this.exceptionHandler;
150143
}
151144

152-
/**
153-
* {@link HandlerAdapter} classes can set this to have their exception
154-
* handling mechanism applied to response rendering and to deferred
155-
* exceptions when invoking a handler with an asynchronous return value.
156-
* @param function the error handler
157-
* @return the current instance
158-
* @deprecated in favor of {@link #setExceptionHandler(DispatchExceptionHandler)}
159-
*/
160-
@Deprecated(since = "6.0", forRemoval = true)
161-
public HandlerResult setExceptionHandler(Function<Throwable, Mono<HandlerResult>> function) {
162-
this.exceptionHandler = (exchange, ex) -> function.apply(ex);
163-
this.exceptionHandlerFunction = function;
164-
return this;
165-
}
166-
167-
/**
168-
* Whether there is an exception handler.
169-
* @deprecated in favor of checking via {@link #getExceptionHandler()}
170-
*/
171-
@Deprecated(since = "6.0", forRemoval = true)
172-
public boolean hasExceptionHandler() {
173-
return (this.exceptionHandler != null);
174-
}
175-
176-
/**
177-
* Apply the exception handler and return the alternative result.
178-
* @param failure the exception
179-
* @return the new result or the same error if there is no exception handler
180-
* @deprecated without a replacement; for internal invocation only, not used as of 6.0
181-
*/
182-
@Deprecated(since = "6.0", forRemoval = true)
183-
public Mono<HandlerResult> applyExceptionHandler(Throwable failure) {
184-
return (this.exceptionHandlerFunction != null ?
185-
this.exceptionHandlerFunction.apply(failure) : Mono.error(failure));
186-
}
187-
188145
}

0 commit comments

Comments
 (0)