Fix DefaultResponseErrorHandler method visibility

Prior to this commit, the `setMessageConverters` method would have
private visibility. But `initBodyConvertFunction`, which is `protected`,
relies on the message converters being set in the first place.
While this works with `RestTemplate` because this is done automatically,
the `RestClient` does offer a builder method to configure a
`ResponseErrorHandler` and this makes it impossible to configure
converters in this case.

This commit aligns the method visibility by making it protected.

Closes gh-36434
This commit is contained in:
Brian Clozel
2026-03-10 18:08:09 +01:00
parent 6e9758700a
commit cc1514be85
@@ -69,11 +69,10 @@ public class DefaultResponseErrorHandler implements ResponseErrorHandler {
* to use to decode error content.
* @since 6.0
*/
void setMessageConverters(List<HttpMessageConverter<?>> converters) {
protected void setMessageConverters(List<HttpMessageConverter<?>> converters) {
this.messageConverters = Collections.unmodifiableList(converters);
}
/**
* Delegates to {@link #hasError(HttpStatusCode)} with the response status code.
* @see ClientHttpResponse#getStatusCode()