Skip to content

Commit cb1b178

Browse files
committed
Ensure Reactor & RxJava response extractors compile with Eclipse JDT
1 parent b2e8487 commit cb1b178

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

spring-web/src/main/java/org/springframework/web/client/reactive/ResponseExtractors.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public static <T> ResponseExtractor<Mono<T>> body(Class<T> sourceClass) {
6565
* Extract the response body and decode it, returning it as a {@code Mono<T>}.
6666
* @see ResolvableType#forClassWithGenerics(Class, Class[])
6767
*/
68-
@SuppressWarnings("unchecked")
6968
public static <T> BodyExtractor<Mono<T>> as(ResolvableType bodyType) {
7069
return (clientResponse, messageConverters) ->
7170
decodeResponseBodyAsMono(clientResponse, bodyType, messageConverters);
@@ -153,7 +152,8 @@ public static <T> ResponseExtractor<Mono<ResponseEntity<T>>> response(Class<T> b
153152
public static <T> ResponseExtractor<Mono<ResponseEntity<Flux<T>>>> responseStream(ResolvableType type) {
154153
return (clientResponse, webClientConfig) -> clientResponse
155154
.map(response -> new ResponseEntity<>(
156-
decodeResponseBody(response, type, webClientConfig.getMessageReaders()),
155+
// ResponseExtractors.<T> is required for Eclipse JDT.
156+
ResponseExtractors.<T> decodeResponseBody(response, type, webClientConfig.getMessageReaders()),
157157
response.getHeaders(), response.getStatusCode()));
158158
}
159159

spring-web/src/main/java/org/springframework/web/client/reactive/support/RxJava1ResponseExtractors.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ public static <T> ResponseExtractor<Single<T>> body(ResolvableType bodyType) {
6060
/**
6161
* Extract the response body and decode it, returning it as a {@code Single<T>}.
6262
*/
63-
@SuppressWarnings("unchecked")
6463
public static <T> ResponseExtractor<Single<T>> body(Class<T> sourceClass) {
65-
6664
ResolvableType bodyType = ResolvableType.forClass(sourceClass);
6765
return body(bodyType);
6866
}
@@ -174,7 +172,9 @@ public static <T> ResponseExtractor<Single<ResponseEntity<Observable<T>>>> respo
174172
return (clientResponse, webClientConfig) -> RxJava1Adapter.publisherToSingle(clientResponse
175173
.map(response -> new ResponseEntity<>(
176174
RxJava1Adapter
177-
.publisherToObservable(decodeResponseBody(response, bodyType, webClientConfig.getMessageReaders())),
175+
.publisherToObservable(
176+
// RxJava1ResponseExtractors.<T> is required for Eclipse JDT.
177+
RxJava1ResponseExtractors.<T> decodeResponseBody(response, bodyType, webClientConfig.getMessageReaders())),
178178
response.getHeaders(),
179179
response.getStatusCode())));
180180
}

0 commit comments

Comments
 (0)