Consistent HttpMethod identity comparisons
This commit is contained in:
@@ -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.
|
||||
@@ -45,7 +45,6 @@ import org.springframework.web.server.ServerWebInputException;
|
||||
import org.springframework.web.server.UnsupportedMediaTypeStatusException;
|
||||
import org.springframework.web.util.pattern.PathPattern;
|
||||
|
||||
|
||||
/**
|
||||
* Abstract base class for classes for which {@link RequestMappingInfo} defines
|
||||
* the mapping between a request and a handler method.
|
||||
@@ -358,7 +357,7 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
|
||||
private static Set<HttpMethod> initAllowedHttpMethods(Set<HttpMethod> declaredMethods) {
|
||||
if (declaredMethods.isEmpty()) {
|
||||
return EnumSet.allOf(HttpMethod.class).stream()
|
||||
.filter(method -> !method.equals(HttpMethod.TRACE))
|
||||
.filter(method -> method != HttpMethod.TRACE)
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user