Consistent ordering in MethodNotAllowedException
This caused random failures in a newly added test. Also remove defensive check in ResponseStatusExceptionResolver. See gh-24944
This commit is contained in:
@@ -18,7 +18,7 @@ package org.springframework.web.server;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class MethodNotAllowedException extends ResponseStatusException {
|
||||
supportedMethods = Collections.emptySet();
|
||||
}
|
||||
this.method = method;
|
||||
this.httpMethods = Collections.unmodifiableSet(new HashSet<>(supportedMethods));
|
||||
this.httpMethods = Collections.unmodifiableSet(new LinkedHashSet<>(supportedMethods));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user