Polish
See gh-22340
This commit is contained in:
@@ -167,6 +167,7 @@ public abstract class MimeTypeUtils {
|
||||
private static volatile Random random;
|
||||
|
||||
static {
|
||||
// Not using "parseMimeType" to avoid static init cost
|
||||
ALL = new MimeType("*", "*");
|
||||
APPLICATION_JSON = new MimeType("application", "json");
|
||||
APPLICATION_OCTET_STREAM = new MimeType("application", "octet-stream");
|
||||
|
||||
@@ -323,6 +323,7 @@ public class MediaType extends MimeType implements Serializable {
|
||||
|
||||
|
||||
static {
|
||||
// Not using "valueOf' to avoid static init cost
|
||||
ALL = new MediaType("*", "*");
|
||||
APPLICATION_ATOM_XML = new MediaType("application", "atom+xml");
|
||||
APPLICATION_FORM_URLENCODED = new MediaType("application", "x-www-form-urlencoded");
|
||||
@@ -552,6 +553,7 @@ public class MediaType extends MimeType implements Serializable {
|
||||
if (!StringUtils.hasLength(mediaTypes)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// Avoid using java.util.stream.Stream in hot paths
|
||||
List<String> tokenizedTypes = MimeTypeUtils.tokenize(mediaTypes);
|
||||
List<MediaType> result = new ArrayList<>(tokenizedTypes.size());
|
||||
for (String type : tokenizedTypes) {
|
||||
|
||||
Reference in New Issue
Block a user