From 846521d8c5f8150f43e3aca48d698ed65f133f81 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Thu, 1 Oct 2026 12:09:57 +0200 Subject: [PATCH] Work around Eclipse compiler type inference errors Eclipse fails to infer the generic types in XmlEventDecoder and DefaultWebClient, even though javac and IntelliJ IDEA compile the code without issues. This commit introduces explicit type arguments for the calls to flatMapIterable() and exceptionWrappingFunction() to work around those bugs. --- .../org/springframework/http/codec/xml/XmlEventDecoder.java | 2 +- .../web/reactive/function/client/DefaultWebClient.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java b/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java index 8ded46a9c3c..fe7cf5b7b8b 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java +++ b/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java @@ -137,7 +137,7 @@ public class XmlEventDecoder extends AbstractDecoder { if (this.useAalto) { AaltoDataBufferToXmlEvent mapper = new AaltoDataBufferToXmlEvent(hints); return Flux.from(input) - .flatMapIterable(mapper) + .flatMapIterable(mapper) .doFinally(signalType -> mapper.endOfInput()); } else { diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java index 3cc7f07e57d..ed67c41f355 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java @@ -681,14 +681,14 @@ final class DefaultWebClient implements WebClient { } private Publisher handleBodyFlux(ClientResponse response, Flux body) { - body = body.onErrorResume(WebClientUtils.WRAP_EXCEPTION_PREDICATE, exceptionWrappingFunction(response)); + body = body.onErrorResume(WebClientUtils.WRAP_EXCEPTION_PREDICATE, this.exceptionWrappingFunction(response)); Mono result = applyStatusHandlers(response); return (result != null ? result.flux().switchIfEmpty(body) : body); } private Mono>> handlerEntityFlux(ClientResponse response, Flux body) { ResponseEntity> entity = new ResponseEntity<>( - body.onErrorResume(WebClientUtils.WRAP_EXCEPTION_PREDICATE, exceptionWrappingFunction(response)), + body.onErrorResume(WebClientUtils.WRAP_EXCEPTION_PREDICATE, this.exceptionWrappingFunction(response)), response.headers().asHttpHeaders(), response.statusCode());