Avoid resizing of fixed-size HashMap/LinkedHashMap variants
Closes gh-25349
This commit is contained in:
@@ -24,7 +24,6 @@ import java.io.OutputStreamWriter;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -82,6 +81,7 @@ import org.springframework.oxm.UnmarshallingFailureException;
|
||||
import org.springframework.oxm.XmlMappingException;
|
||||
import org.springframework.oxm.support.AbstractMarshaller;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.util.function.SingletonSupplier;
|
||||
@@ -584,7 +584,7 @@ public class XStreamMarshaller extends AbstractMarshaller implements BeanClassLo
|
||||
}
|
||||
|
||||
private Map<String, Class<?>> toClassMap(Map<String, ?> map) throws ClassNotFoundException {
|
||||
Map<String, Class<?>> result = new LinkedHashMap<>(map.size());
|
||||
Map<String, Class<?>> result = CollectionUtils.newLinkedHashMap(map.size());
|
||||
for (Map.Entry<String, ?> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
|
||||
Reference in New Issue
Block a user