Skip to content

Commit 93b72fa

Browse files
committed
Polishing
1 parent 3ac7f83 commit 93b72fa

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,9 @@ public HttpHeaders(MultiValueMap<String, String> headers) {
468468
* <p>If the supplied {@code HttpHeaders} instance is a
469469
* {@linkplain #readOnlyHttpHeaders(HttpHeaders) read-only}
470470
* {@code HttpHeaders} wrapper, it will be unwrapped to ensure that the
471-
* {@code HttpHeaders} instance created by this constructor is mutable.
472-
* Once the writable instance is mutated, the read-only instance is
473-
* likely to be out of sync and should be discarded.
471+
* {@code HttpHeaders} instance created by this constructor is mutable. Once
472+
* the writable instance is mutated, the read-only instance is likely to be
473+
* out of sync and should be discarded.
474474
* @param httpHeaders the headers to expose
475475
* @since 7.0
476476
* @see #copyOf(HttpHeaders)

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
import org.springframework.util.MultiValueMap;
3333

3434
/**
35-
* {@code HttpHeaders} object that can only be read, not written to.
36-
* <p>This caches the parsed representations of the "Accept" and "Content-Type" headers
37-
* and will get out of sync with the backing map it is mutated at runtime.
35+
* {@code HttpHeaders} variant that can only be read, not written to.
36+
*
37+
* <p>This caches the parsed representations of the "Accept" and "Content-Type"
38+
* headers and will get out of sync with the backing map if it is mutated at runtime.
3839
*
3940
* @author Brian Clozel
4041
* @author Sam Brannen
@@ -44,11 +45,13 @@ class ReadOnlyHttpHeaders extends HttpHeaders {
4445

4546
private static final long serialVersionUID = -8578554704772377436L;
4647

48+
4749
private @Nullable MediaType cachedContentType;
4850

4951
@SuppressWarnings("serial")
5052
private @Nullable List<MediaType> cachedAccept;
5153

54+
5255
ReadOnlyHttpHeaders(MultiValueMap<String, String> headers) {
5356
super(headers);
5457
}
@@ -138,7 +141,6 @@ public Set<String> headerNames() {
138141
return Collections.unmodifiableSet(super.headerNames());
139142
}
140143

141-
142144
@Override
143145
public List<String> put(String key, List<String> value) {
144146
throw new UnsupportedOperationException();

0 commit comments

Comments
 (0)