Polishing

This commit is contained in:
Juergen Hoeller
2018-03-07 16:24:40 +01:00
parent c15f23bf0c
commit 346d0e271d
10 changed files with 116 additions and 147 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -775,7 +775,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
* by the {@code Date} header.
* <p>The date is returned as the number of milliseconds since
* January 1, 1970 GMT. Returns -1 when the date is unknown.
* @throws IllegalArgumentException if the value can't be converted to a date
* @throws IllegalArgumentException if the value cannot be converted to a date
*/
public long getDate() {
return getFirstDate(DATE);

View File

@@ -70,18 +70,18 @@ public class GsonHttpMessageConverter extends AbstractGenericHttpMessageConverte
*/
public GsonHttpMessageConverter() {
super(MediaType.APPLICATION_JSON, new MediaType("application", "*+json"));
this.setDefaultCharset(DEFAULT_CHARSET);
setDefaultCharset(DEFAULT_CHARSET);
}
/**
* Set the {@code Gson} instance to use.
* If not set, a default {@link Gson#Gson() Gson} instance is used.
* If not set, a default {@link Gson#Gson() Gson} instance will be used.
* <p>Setting a custom-configured {@code Gson} is one way to take further
* control of the JSON serialization process.
*/
public void setGson(Gson gson) {
Assert.notNull(gson, "'gson' is required");
Assert.notNull(gson, "A Gson instance is required");
this.gson = gson;
}