Polishing (backported from master)

This commit is contained in:
Juergen Hoeller
2016-07-06 15:29:15 +02:00
parent 16d5ba9b3a
commit 92d78c10a2
62 changed files with 273 additions and 415 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2016 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.
@@ -23,22 +23,23 @@ import org.springframework.http.HttpRequest;
/**
* Represents the context of a client-side HTTP request execution.
*
* <p>Used to invoke the next interceptor in the interceptor chain, or - if the calling interceptor is last - execute
* the request itself.
* <p>Used to invoke the next interceptor in the interceptor chain,
* or - if the calling interceptor is last - execute the request itself.
*
* @author Arjen Poutsma
* @see ClientHttpRequestInterceptor
* @since 3.1
* @see ClientHttpRequestInterceptor
*/
public interface ClientHttpRequestExecution {
/**
* Execute the request with the given request attributes and body, and return the response.
*
* Execute the request with the given request attributes and body,
* and return the response.
* @param request the request, containing method, URI, and headers
* @param body the body of the request to execute
* @return the response
* @throws IOException in case of I/O errors
*/
ClientHttpResponse execute(HttpRequest request, byte[] body) throws IOException;
}

View File

@@ -812,7 +812,7 @@ public class Jackson2ObjectMapperBuilder {
return new XmlMapper(new XmlFactory(xmlInputFactory()), module);
}
private static final XMLInputFactory xmlInputFactory() {
private static XMLInputFactory xmlInputFactory() {
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
inputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2016 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.
@@ -31,9 +31,9 @@ import javax.xml.ws.WebServiceProvider;
* <p>Note that this exporter will only work if the JAX-WS runtime actually
* supports publishing with an address argument, i.e. if the JAX-WS runtime
* ships an internal HTTP server. This is the case with the JAX-WS runtime
* that's inclued in Sun's JDK 1.6 but not with the standalone JAX-WS 2.1 RI.
* that's included in Sun's JDK 6 but not with the standalone JAX-WS 2.1 RI.
*
* <p>For explicit configuration of JAX-WS endpoints with Sun's JDK 1.6
* <p>For explicit configuration of JAX-WS endpoints with Sun's JDK 6
* HTTP server, consider using {@link SimpleHttpServerJaxWsServiceExporter}!
*
* @author Juergen Hoeller

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -70,6 +70,9 @@ import org.springframework.web.multipart.MultipartRequest;
*/
public class WebRequestDataBinder extends WebDataBinder {
private static final boolean servlet3Parts = ClassUtils.hasMethod(HttpServletRequest.class, "getParts");
/**
* Create a new WebRequestDataBinder instance, with default object name.
* @param target the target object to bind onto (or {@code null}
@@ -116,7 +119,7 @@ public class WebRequestDataBinder extends WebDataBinder {
if (multipartRequest != null) {
bindMultipart(multipartRequest.getMultiFileMap(), mpvs);
}
else if (ClassUtils.hasMethod(HttpServletRequest.class, "getParts")) {
else if (servlet3Parts) {
HttpServletRequest serlvetRequest = ((NativeWebRequest) request).getNativeRequest(HttpServletRequest.class);
new Servlet3MultipartHelper(isBindEmptyMultipartFiles()).bindParts(serlvetRequest, mpvs);
}

View File

@@ -23,7 +23,6 @@ import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

View File

@@ -122,7 +122,7 @@ public abstract class MultipartResolutionDelegate {
return null;
}
}
else if (parameter.getNestedParameterType() == servletPartClass) {
else if (servletPartClass == parameter.getNestedParameterType()) {
return (isMultipart ? RequestPartResolver.resolvePart(request, name) : null);
}
else if (isPartCollection(parameter)) {