Skip to content

Commit eb9ee9f

Browse files
committed
Polishing
`@since` missing tags in some methods related to the HttpHeaders change
1 parent f025d60 commit eb9ee9f

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

spring-test/src/main/java/org/springframework/test/http/HttpHeadersAssert.java

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public HttpHeadersAssert containsHeaders(String... names) {
9191
* Verify that the actual HTTP headers contain only the headers with the
9292
* given {@code names}, in any order and in a case-insensitive manner.
9393
* @param names the names of expected HTTP headers
94+
* @since 7.0
9495
*/
9596
public HttpHeadersAssert containsOnlyHeaders(String... names) {
9697
this.namesAssert
@@ -170,6 +171,7 @@ public HttpHeadersAssert hasValue(String name, Instant value) {
170171
* the given list of values, and in the same order.
171172
* @param name the considered header name (case-insensitive)
172173
* @param values the exhaustive list of expected values
174+
* @since 7.0
173175
*/
174176
public HttpHeadersAssert hasExactlyValues(String name, List<String> values) {
175177
containsHeader(name);
@@ -184,6 +186,7 @@ public HttpHeadersAssert hasExactlyValues(String name, List<String> values) {
184186
* the given list of values, in any order.
185187
* @param name the considered header name (case-insensitive)
186188
* @param values the exhaustive list of expected values
189+
* @since 7.0
187190
*/
188191
public HttpHeadersAssert hasExactlyValuesInAnyOrder(String name, List<String> values) {
189192
containsHeader(name);
@@ -296,6 +299,7 @@ public HttpHeadersAssert hasSizeBetween(int lowerBoundary, int higherBoundary) {
296299
* Verify that the number actual headers is the same as in the given
297300
* {@code HttpHeaders}.
298301
* @param other the {@code HttpHeaders} to compare size with
302+
* @since 7.0
299303
*/
300304
public HttpHeadersAssert hasSameSizeAs(HttpHeaders other) {
301305
this.namesAssert

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ public HttpHeaders(HttpHeaders httpHeaders) {
496496
* Get the list of header values for the given header name, if any.
497497
* @param headerName the header name
498498
* @return the list of header values, or an empty list
499-
* @since 5.2
499+
* @since 7.0
500500
*/
501501
public List<String> getOrEmpty(String headerName) {
502502
return getOrDefault(headerName, Collections.emptyList());
@@ -508,6 +508,7 @@ public List<String> getOrEmpty(String headerName) {
508508
* @param headerName the header name
509509
* @param defaultValue the fallback list if header is not present
510510
* @return the list of header values, or a default list of values
511+
* @since 7.0
511512
*/
512513
public List<String> getOrDefault(String headerName, List<String> defaultValue) {
513514
List<String> values = get(headerName);
@@ -1796,6 +1797,7 @@ public void addAll(String headerName, List<? extends String> headerValues) {
17961797
* values of each individual header name instead.
17971798
* @param headers the headers to add
17981799
* @see #putAll(HttpHeaders)
1800+
* @since 7.0
17991801
*/
18001802
public void addAll(HttpHeaders headers) {
18011803
this.headers.addAll(headers.headers);
@@ -1866,6 +1868,7 @@ public Map<String, String> asSingleValueMap() {
18661868
* @deprecated This method is provided for backward compatibility with APIs
18671869
* that would only accept maps. Generally avoid using HttpHeaders as a Map
18681870
* or MultiValueMap.
1871+
* @since 7.0
18691872
*/
18701873
@Deprecated
18711874
public MultiValueMap<String, String> asMultiValueMap() {
@@ -1920,6 +1923,7 @@ public boolean containsHeaderValue(String headerName, String value) {
19201923
/**
19211924
* Get the list of values associated with the given header name.
19221925
* @param headerName the header name
1926+
* @since 7.0
19231927
*/
19241928
@Nullable
19251929
public List<String> get(String headerName) {
@@ -1953,6 +1957,7 @@ public List<String> get(String headerName) {
19531957
* Put all the entries from the given HttpHeaders into this HttpHeaders.
19541958
* @param headers the given headers
19551959
* @see #put(String, List)
1960+
* @since 7.0
19561961
*/
19571962
public void putAll(HttpHeaders headers) {
19581963
this.headers.putAll(headers.headers);
@@ -1973,6 +1978,7 @@ public void putAll(Map<? extends String, ? extends List<String>> headers) {
19731978
* value list or {@code null} if that header wasn't present.
19741979
* @param key the name of the header to remove
19751980
* @return the value list associated with the removed header name
1981+
* @since 7.0
19761982
*/
19771983
public @Nullable List<String> remove(String key) {
19781984
return this.headers.remove(key);

spring-web/src/main/java/org/springframework/web/method/annotation/RequestHeaderMapMethodArgumentResolver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ else if (MultiValueMap.class.isAssignableFrom(paramType)) {
8585
}
8686
}
8787

88-
void copyHeaderValues(NativeWebRequest webRequest, BiConsumer<String, String> consumer) {
88+
private void copyHeaderValues(NativeWebRequest webRequest, BiConsumer<String, String> consumer) {
8989
for (Iterator<String> iterator = webRequest.getHeaderNames(); iterator.hasNext();) {
9090
String headerName = iterator.next();
9191
String[] headerValues = webRequest.getHeaderValues(headerName);

0 commit comments

Comments
 (0)