Polishing

This commit is contained in:
Juergen Hoeller
2017-09-27 01:34:11 +02:00
parent a4b2ae583e
commit efce7902c4
43 changed files with 107 additions and 98 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -51,6 +51,7 @@ import org.springframework.util.ObjectUtils;
* return new ResponseEntity<String>("Hello World", responseHeaders, HttpStatus.CREATED);
* }
* </pre>
*
* Or, by using a builder accessible via static methods:
* <pre class="code">
* &#64;RequestMapping("/handle")

View File

@@ -106,12 +106,12 @@ class InterceptingAsyncClientHttpRequest extends AbstractBufferingAsyncClientHtt
return interceptor.intercept(request, body, this);
}
else {
URI theUri = request.getURI();
URI uri = request.getURI();
HttpMethod method = request.getMethod();
HttpHeaders headers = request.getHeaders();
Assert.state(method != null, "No standard HTTP method");
AsyncClientHttpRequest delegate = requestFactory.createAsyncRequest(theUri, method);
AsyncClientHttpRequest delegate = requestFactory.createAsyncRequest(uri, method);
delegate.getHeaders().putAll(headers);
if (body.length > 0) {
StreamUtils.copy(body, delegate.getBody());

View File

@@ -90,7 +90,7 @@ public class ServletPathExtensionContentNegotiationStrategy extends PathExtensio
* {@link PathExtensionContentNegotiationStrategy#getMediaTypeForResource}
* with the ability to also look up through the ServletContext.
* @param resource the resource to look up
* @return the MediaType for the extension or {@code null}.
* @return the MediaType for the extension, or {@code null} if none found
* @since 4.3
*/
@Override

View File

@@ -289,11 +289,11 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ
etag = padEtagIfNecessary(etag);
while (ifNoneMatch.hasMoreElements()) {
String clientETags = ifNoneMatch.nextElement();
Matcher eTagMatcher = ETAG_HEADER_VALUE_PATTERN.matcher(clientETags);
Matcher etagMatcher = ETAG_HEADER_VALUE_PATTERN.matcher(clientETags);
// Compare weak/strong ETags as per https://tools.ietf.org/html/rfc7232#section-2.3
while (eTagMatcher.find()) {
if (StringUtils.hasLength(eTagMatcher.group()) &&
etag.replaceFirst("^W/", "").equals(eTagMatcher.group(3))) {
while (etagMatcher.find()) {
if (StringUtils.hasLength(etagMatcher.group()) &&
etag.replaceFirst("^W/", "").equals(etagMatcher.group(3))) {
this.notModified = true;
break;
}

View File

@@ -162,7 +162,7 @@ public class DelegatingFilterProxy extends GenericFilterBean {
* @see #setEnvironment(org.springframework.core.env.Environment)
*/
public DelegatingFilterProxy(String targetBeanName, @Nullable WebApplicationContext wac) {
Assert.hasText(targetBeanName, "target Filter bean name must not be null or empty");
Assert.hasText(targetBeanName, "Target Filter bean name must not be null or empty");
this.setTargetBeanName(targetBeanName);
this.webApplicationContext = wac;
if (wac != null) {

View File

@@ -44,6 +44,7 @@ import org.springframework.web.context.request.WebRequest;
* {@link SessionStatus#setComplete()}.
*
* @author Rossen Stoyanchev
* @author Juergen Hoeller
* @since 3.1
*/
public class SessionAttributesHandler {
@@ -154,7 +155,7 @@ public class SessionAttributesHandler {
* A pass-through call to the underlying {@link SessionAttributeStore}.
* @param request the current request
* @param attributeName the name of the attribute of interest
* @return the attribute value or {@code null}
* @return the attribute value, or {@code null} if none
*/
@Nullable
Object retrieveAttribute(WebRequest request, String attributeName) {