Polishing

(cherry picked from commit 9af12d2)
This commit is contained in:
Juergen Hoeller
2016-03-23 18:39:29 +01:00
parent 7c5aac122a
commit 2ea7fcde3e
23 changed files with 216 additions and 235 deletions

View File

@@ -18,14 +18,15 @@ package org.springframework.web.servlet.support;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.http.CacheControl;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.HttpSessionRequiredException;
@@ -133,8 +134,8 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
* unrestricted for general controllers and interceptors.
*/
public final void setSupportedMethods(String... methods) {
if (methods != null) {
this.supportedMethods = new HashSet<String>(Arrays.asList(methods));
if (!ObjectUtils.isEmpty(methods)) {
this.supportedMethods = new LinkedHashSet<String>(Arrays.asList(methods));
}
else {
this.supportedMethods = null;