Skip to content

Commit 6515417

Browse files
committed
Polishing
1 parent d71957c commit 6515417

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

spring-web/src/main/java/org/springframework/http/RequestEntity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -70,6 +70,8 @@
7070
* @param <T> the body type
7171
* @see #getMethod()
7272
* @see #getUrl()
73+
* @see org.springframework.web.client.RestOperations#exchange(RequestEntity, Class)
74+
* @see ResponseEntity
7375
*/
7476
public class RequestEntity<T> extends HttpEntity<T> {
7577

spring-web/src/main/java/org/springframework/http/ResponseEntity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
* @since 3.0.2
7171
* @param <T> the body type
7272
* @see #getStatusCode()
73+
* @see org.springframework.web.client.RestOperations#getForEntity(String, Class, Object...)
74+
* @see org.springframework.web.client.RestOperations#getForEntity(String, Class, java.util.Map)
75+
* @see org.springframework.web.client.RestOperations#getForEntity(URI, Class)
76+
* @see RequestEntity
7377
*/
7478
public class ResponseEntity<T> extends HttpEntity<T> {
7579

spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,26 +417,23 @@ public HttpHeaders getHeaders() {
417417

418418
private static class DefaultResponseSpec implements ResponseSpec {
419419

420-
private static final IntPredicate STATUS_CODE_ERROR = value -> value >= 400;
420+
private static final IntPredicate STATUS_CODE_ERROR = (value -> value >= 400);
421421

422422
private static final StatusHandler DEFAULT_STATUS_HANDLER =
423423
new StatusHandler(STATUS_CODE_ERROR, ClientResponse::createException);
424424

425-
426425
private final Mono<ClientResponse> responseMono;
427426

428427
private final Supplier<HttpRequest> requestSupplier;
429428

430429
private final List<StatusHandler> statusHandlers = new ArrayList<>(1);
431430

432-
433431
DefaultResponseSpec(Mono<ClientResponse> responseMono, Supplier<HttpRequest> requestSupplier) {
434432
this.responseMono = responseMono;
435433
this.requestSupplier = requestSupplier;
436434
this.statusHandlers.add(DEFAULT_STATUS_HANDLER);
437435
}
438436

439-
440437
@Override
441438
public ResponseSpec onStatus(Predicate<HttpStatus> statusPredicate,
442439
Function<ClientResponse, Mono<? extends Throwable>> exceptionFunction) {

spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClientBuilder.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,24 @@ public DefaultWebClientBuilder(DefaultWebClientBuilder other) {
101101
this.defaultUriVariables = (other.defaultUriVariables != null ?
102102
new LinkedHashMap<>(other.defaultUriVariables) : null);
103103
this.uriBuilderFactory = other.uriBuilderFactory;
104+
104105
if (other.defaultHeaders != null) {
105106
this.defaultHeaders = new HttpHeaders();
106107
this.defaultHeaders.putAll(other.defaultHeaders);
107108
}
108109
else {
109110
this.defaultHeaders = null;
110111
}
112+
111113
this.defaultCookies = (other.defaultCookies != null ?
112114
new LinkedMultiValueMap<>(other.defaultCookies) : null);
113115
this.defaultRequest = other.defaultRequest;
114-
this.filters = other.filters != null ? new ArrayList<>(other.filters) : null;
116+
this.filters = (other.filters != null ? new ArrayList<>(other.filters) : null);
117+
115118
this.connector = other.connector;
116119
this.strategies = other.strategies;
117-
this.strategiesConfigurers = other.strategiesConfigurers != null ? new ArrayList<>(other.strategiesConfigurers) : null;
120+
this.strategiesConfigurers = (other.strategiesConfigurers != null ?
121+
new ArrayList<>(other.strategiesConfigurers) : null);
118122
this.exchangeFunction = other.exchangeFunction;
119123
}
120124

0 commit comments

Comments
 (0)