Polishing

This commit is contained in:
Juergen Hoeller
2018-05-05 16:36:52 +02:00
parent 193c289080
commit c99a104919
9 changed files with 85 additions and 77 deletions

View File

@@ -400,7 +400,6 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
* Private constructor that can create read-only {@code HttpHeader} instances.
*/
private HttpHeaders(Map<String, List<String>> headers, boolean readOnly) {
Assert.notNull(headers, "'headers' must not be null");
if (readOnly) {
Map<String, List<String>> map =
new LinkedCaseInsensitiveMap<List<String>>(headers.size(), Locale.ENGLISH);
@@ -1319,6 +1318,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
* Return a {@code HttpHeaders} object that can only be read, not written to.
*/
public static HttpHeaders readOnlyHttpHeaders(HttpHeaders headers) {
Assert.notNull(headers, "HttpHeaders must not be null");
return new HttpHeaders(headers, true);
}