Fix ExceptionHandlerExceptionResolver.setResponseBodyAdvice behaviour
Prior to this commit, calling the `setResponseBodyAdvice` method would clear all existing `ResponseBodyAdvice` instances present in the list before adding provided one. This behavior is inconsistent with the Javadoc and other implementations. This brings the method in line with the existing documentation. See gh-24204
This commit is contained in:
parent
da071c1fce
commit
8da5627c6c
|
|
@ -235,7 +235,6 @@ public class ExceptionHandlerExceptionResolver extends AbstractHandlerMethodExce
|
|||
* {@code HttpMessageConverter}.
|
||||
*/
|
||||
public void setResponseBodyAdvice(@Nullable List<ResponseBodyAdvice<?>> responseBodyAdvice) {
|
||||
this.responseBodyAdvice.clear();
|
||||
if (responseBodyAdvice != null) {
|
||||
this.responseBodyAdvice.addAll(responseBodyAdvice);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue