提交 0451232e 编写于 作者: J Juergen Hoeller

Polishing

(cherry picked from commit 86ea3059)
上级 74973914
......@@ -20,7 +20,6 @@ import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.logging.Logger;
import javax.sql.DataSource;
import org.apache.commons.logging.Log;
......@@ -63,6 +62,7 @@ public class EmbeddedDatabaseFactory {
*/
public static final String DEFAULT_DATABASE_NAME = "testdb";
private static final Log logger = LogFactory.getLog(EmbeddedDatabaseFactory.class);
private String databaseName = DEFAULT_DATABASE_NAME;
......
......@@ -155,12 +155,15 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
*/
public List<MediaType> getAccept() {
String value = getFirst(ACCEPT);
List<MediaType> result = (value != null) ? MediaType.parseMediaTypes(value) : Collections.<MediaType>emptyList();
List<MediaType> result = (value != null ? MediaType.parseMediaTypes(value) : Collections.<MediaType>emptyList());
// Some containers parse 'Accept' into multiple values
if ((result.size() == 1) && (get(ACCEPT).size() > 1)) {
value = StringUtils.collectionToCommaDelimitedString(get(ACCEPT));
result = MediaType.parseMediaTypes(value);
if (result.size() == 1) {
List<String> acceptHeader = get(ACCEPT);
if (acceptHeader.size() > 1) {
value = StringUtils.collectionToCommaDelimitedString(acceptHeader);
result = MediaType.parseMediaTypes(value);
}
}
return result;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册