mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
DefaultPathContainer uses immutable map for SEPARATORS
Closes gh-36821 Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
This commit is contained in:
committed by
rstoyanchev
parent
b3dfba8719
commit
84efa46e09
@@ -20,7 +20,6 @@ import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -42,14 +41,11 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
final class DefaultPathContainer implements PathContainer {
|
||||
|
||||
private static final PathContainer EMPTY_PATH = new DefaultPathContainer("", Collections.emptyList());
|
||||
private static final PathContainer EMPTY_PATH = new DefaultPathContainer("", List.of());
|
||||
|
||||
private static final Map<Character, DefaultSeparator> SEPARATORS = new HashMap<>(2);
|
||||
|
||||
static {
|
||||
SEPARATORS.put('/', new DefaultSeparator('/', "%2F"));
|
||||
SEPARATORS.put('.', new DefaultSeparator('.', "%2E"));
|
||||
}
|
||||
private static final Map<Character, DefaultSeparator> SEPARATORS = Map.of(
|
||||
'/', new DefaultSeparator('/', "%2F"),
|
||||
'.', new DefaultSeparator('.', "%2E"));
|
||||
|
||||
|
||||
private final String path;
|
||||
|
||||
Reference in New Issue
Block a user