gh-25650 Replace remaining usage of LinkedList with ArrayList in tests
This commit is contained in:
parent
79cf6b4353
commit
1f3e52d932
|
@ -23,7 +23,6 @@ import java.lang.reflect.Method;
|
|||
import java.lang.reflect.UndeclaredThrowableException;
|
||||
import java.rmi.RemoteException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
|
@ -136,7 +135,7 @@ abstract class AbstractAspectJAdvisorFactoryTests {
|
|||
int realAge = 65;
|
||||
target.setAge(realAge);
|
||||
|
||||
List<Advisor> advisors = new LinkedList<>();
|
||||
List<Advisor> advisors = new ArrayList<>();
|
||||
PerTargetAspect aspect1 = new PerTargetAspect();
|
||||
aspect1.count = 100;
|
||||
aspect1.setOrder(10);
|
||||
|
@ -164,7 +163,7 @@ abstract class AbstractAspectJAdvisorFactoryTests {
|
|||
int realAge = 65;
|
||||
target.setAge(realAge);
|
||||
|
||||
List<Advisor> advisors = new LinkedList<>();
|
||||
List<Advisor> advisors = new ArrayList<>();
|
||||
PerTargetAspectWithOrderAnnotation10 aspect1 = new PerTargetAspectWithOrderAnnotation10();
|
||||
aspect1.count = 100;
|
||||
advisors.addAll(
|
||||
|
@ -392,7 +391,7 @@ abstract class AbstractAspectJAdvisorFactoryTests {
|
|||
|
||||
@Test
|
||||
void introductionOnTargetExcludedByTypePattern() {
|
||||
LinkedList<Object> target = new LinkedList<>();
|
||||
ArrayList<Object> target = new ArrayList<>();
|
||||
List<?> proxy = (List<?>) createProxy(target,
|
||||
AopUtils.findAdvisorsThatCanApply(
|
||||
getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new MakeLockable(), "someBean")),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -25,7 +25,6 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
@ -1072,7 +1071,7 @@ public abstract class AbstractPropertyAccessorTests {
|
|||
public void setGenericArrayProperty() {
|
||||
SkipReaderStub target = new SkipReaderStub();
|
||||
AbstractPropertyAccessor accessor = createAccessor(target);
|
||||
List<String> values = new LinkedList<>();
|
||||
List<String> values = new ArrayList<>();
|
||||
values.add("1");
|
||||
values.add("2");
|
||||
values.add("3");
|
||||
|
@ -1113,7 +1112,7 @@ public abstract class AbstractPropertyAccessorTests {
|
|||
SortedSet<String> sortedSet = new TreeSet<>();
|
||||
sortedSet.add("sortedSet1");
|
||||
accessor.setPropertyValue("sortedSet", sortedSet);
|
||||
List<String> list = new LinkedList<>();
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("list1");
|
||||
accessor.setPropertyValue("list", list);
|
||||
assertThat(target.getCollection()).isSameAs(coll);
|
||||
|
@ -1130,7 +1129,7 @@ public abstract class AbstractPropertyAccessorTests {
|
|||
Collection<String> coll = new ArrayList<>();
|
||||
coll.add("coll1");
|
||||
accessor.setPropertyValue("collection", coll);
|
||||
List<String> set = new LinkedList<>();
|
||||
List<String> set = new ArrayList<>();
|
||||
set.add("set1");
|
||||
accessor.setPropertyValue("set", set);
|
||||
List<String> sortedSet = new ArrayList<>();
|
||||
|
@ -1157,7 +1156,7 @@ public abstract class AbstractPropertyAccessorTests {
|
|||
Collection<String> coll = new HashSet<>();
|
||||
coll.add("coll1");
|
||||
accessor.setPropertyValue("collection", coll.toArray());
|
||||
List<String> set = new LinkedList<>();
|
||||
List<String> set = new ArrayList<>();
|
||||
set.add("set1");
|
||||
accessor.setPropertyValue("set", set.toArray());
|
||||
List<String> sortedSet = new ArrayList<>();
|
||||
|
@ -1184,7 +1183,7 @@ public abstract class AbstractPropertyAccessorTests {
|
|||
Collection<Integer> coll = new HashSet<>();
|
||||
coll.add(0);
|
||||
accessor.setPropertyValue("collection", new int[] {0});
|
||||
List<Integer> set = new LinkedList<>();
|
||||
List<Integer> set = new ArrayList<>();
|
||||
set.add(1);
|
||||
accessor.setPropertyValue("set", new int[] {1});
|
||||
List<Integer> sortedSet = new ArrayList<>();
|
||||
|
@ -1211,7 +1210,7 @@ public abstract class AbstractPropertyAccessorTests {
|
|||
Collection<Integer> coll = new HashSet<>();
|
||||
coll.add(0);
|
||||
accessor.setPropertyValue("collection", 0);
|
||||
List<Integer> set = new LinkedList<>();
|
||||
List<Integer> set = new ArrayList<>();
|
||||
set.add(1);
|
||||
accessor.setPropertyValue("set", 1);
|
||||
List<Integer> sortedSet = new ArrayList<>();
|
||||
|
@ -1235,7 +1234,7 @@ public abstract class AbstractPropertyAccessorTests {
|
|||
public void setCollectionPropertyWithStringValue() {
|
||||
IndexedTestBean target = new IndexedTestBean();
|
||||
AbstractPropertyAccessor accessor = createAccessor(target);
|
||||
List<String> set = new LinkedList<>();
|
||||
List<String> set = new ArrayList<>();
|
||||
set.add("set1");
|
||||
accessor.setPropertyValue("set", "set1");
|
||||
List<String> sortedSet = new ArrayList<>();
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
@ -197,8 +196,8 @@ public class BeanWrapperGenericsTests {
|
|||
@Test
|
||||
public void testGenericListOfLists() throws MalformedURLException {
|
||||
GenericBean<String> gb = new GenericBean<>();
|
||||
List<List<Integer>> list = new LinkedList<>();
|
||||
list.add(new LinkedList<>());
|
||||
List<List<Integer>> list = new ArrayList<>();
|
||||
list.add(new ArrayList<>());
|
||||
gb.setListOfLists(list);
|
||||
BeanWrapper bw = new BeanWrapperImpl(gb);
|
||||
bw.setPropertyValue("listOfLists[0][0]", 5);
|
||||
|
@ -209,8 +208,8 @@ public class BeanWrapperGenericsTests {
|
|||
@Test
|
||||
public void testGenericListOfListsWithElementConversion() throws MalformedURLException {
|
||||
GenericBean<String> gb = new GenericBean<>();
|
||||
List<List<Integer>> list = new LinkedList<>();
|
||||
list.add(new LinkedList<>());
|
||||
List<List<Integer>> list = new ArrayList<>();
|
||||
list.add(new ArrayList<>());
|
||||
gb.setListOfLists(list);
|
||||
BeanWrapper bw = new BeanWrapperImpl(gb);
|
||||
bw.setPropertyValue("listOfLists[0][0]", "5");
|
||||
|
@ -246,7 +245,7 @@ public class BeanWrapperGenericsTests {
|
|||
@Test
|
||||
public void testGenericListOfMaps() throws MalformedURLException {
|
||||
GenericBean<String> gb = new GenericBean<>();
|
||||
List<Map<Integer, Long>> list = new LinkedList<>();
|
||||
List<Map<Integer, Long>> list = new ArrayList<>();
|
||||
list.add(new HashMap<>());
|
||||
gb.setListOfMaps(list);
|
||||
BeanWrapper bw = new BeanWrapperImpl(gb);
|
||||
|
@ -258,7 +257,7 @@ public class BeanWrapperGenericsTests {
|
|||
@Test
|
||||
public void testGenericListOfMapsWithElementConversion() throws MalformedURLException {
|
||||
GenericBean<String> gb = new GenericBean<>();
|
||||
List<Map<Integer, Long>> list = new LinkedList<>();
|
||||
List<Map<Integer, Long>> list = new ArrayList<>();
|
||||
list.add(new HashMap<>());
|
||||
gb.setListOfMaps(list);
|
||||
BeanWrapper bw = new BeanWrapperImpl(gb);
|
||||
|
@ -295,7 +294,7 @@ public class BeanWrapperGenericsTests {
|
|||
public void testGenericMapOfLists() throws MalformedURLException {
|
||||
GenericBean<String> gb = new GenericBean<>();
|
||||
Map<Integer, List<Integer>> map = new HashMap<>();
|
||||
map.put(1, new LinkedList<>());
|
||||
map.put(1, new ArrayList<>());
|
||||
gb.setMapOfLists(map);
|
||||
BeanWrapper bw = new BeanWrapperImpl(gb);
|
||||
bw.setPropertyValue("mapOfLists[1][0]", 5);
|
||||
|
@ -307,7 +306,7 @@ public class BeanWrapperGenericsTests {
|
|||
public void testGenericMapOfListsWithElementConversion() throws MalformedURLException {
|
||||
GenericBean<String> gb = new GenericBean<>();
|
||||
Map<Integer, List<Integer>> map = new HashMap<>();
|
||||
map.put(1, new LinkedList<>());
|
||||
map.put(1, new ArrayList<>());
|
||||
gb.setMapOfLists(map);
|
||||
BeanWrapper bw = new BeanWrapperImpl(gb);
|
||||
bw.setPropertyValue("mapOfLists[1][0]", "5");
|
||||
|
@ -347,7 +346,7 @@ public class BeanWrapperGenericsTests {
|
|||
|
||||
@Test
|
||||
public void testGenericTypeNestingListOfMapOfInteger() throws Exception {
|
||||
List<Map<String, String>> list = new LinkedList<>();
|
||||
List<Map<String, String>> list = new ArrayList<>();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("testKey", "5");
|
||||
list.add(map);
|
||||
|
@ -381,9 +380,9 @@ public class BeanWrapperGenericsTests {
|
|||
@Test
|
||||
public void testComplexGenericMap() {
|
||||
Map<List<String>, List<String>> inputMap = new HashMap<>();
|
||||
List<String> inputKey = new LinkedList<>();
|
||||
List<String> inputKey = new ArrayList<>();
|
||||
inputKey.add("1");
|
||||
List<String> inputValue = new LinkedList<>();
|
||||
List<String> inputValue = new ArrayList<>();
|
||||
inputValue.add("10");
|
||||
inputMap.put(inputKey, inputValue);
|
||||
|
||||
|
@ -414,7 +413,7 @@ public class BeanWrapperGenericsTests {
|
|||
|
||||
@Test
|
||||
public void testComplexGenericIndexedMapEntry() {
|
||||
List<String> inputValue = new LinkedList<>();
|
||||
List<String> inputValue = new ArrayList<>();
|
||||
inputValue.add("10");
|
||||
|
||||
ComplexMapHolder holder = new ComplexMapHolder();
|
||||
|
@ -440,7 +439,7 @@ public class BeanWrapperGenericsTests {
|
|||
|
||||
@Test
|
||||
public void testComplexDerivedIndexedMapEntry() {
|
||||
List<String> inputValue = new LinkedList<>();
|
||||
List<String> inputValue = new ArrayList<>();
|
||||
inputValue.add("10");
|
||||
|
||||
ComplexMapHolder holder = new ComplexMapHolder();
|
||||
|
|
|
@ -24,13 +24,13 @@ import java.lang.annotation.Target;
|
|||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
@ -2709,7 +2709,7 @@ public class AutowiredAnnotationBeanPostProcessorTests {
|
|||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public static class SelfInjectionCollectionBean extends LinkedList<SelfInjectionCollectionBean> {
|
||||
public static class SelfInjectionCollectionBean extends ArrayList<SelfInjectionCollectionBean> {
|
||||
|
||||
@Autowired
|
||||
public SelfInjectionCollectionBean reference;
|
||||
|
@ -2833,7 +2833,7 @@ public class AutowiredAnnotationBeanPostProcessorTests {
|
|||
}
|
||||
|
||||
public List<TestBean> iterateTestBeans() {
|
||||
List<TestBean> resolved = new LinkedList<>();
|
||||
List<TestBean> resolved = new ArrayList<>();
|
||||
for (TestBean tb : this.testBeanProvider) {
|
||||
resolved.add(tb);
|
||||
}
|
||||
|
@ -2841,7 +2841,7 @@ public class AutowiredAnnotationBeanPostProcessorTests {
|
|||
}
|
||||
|
||||
public List<TestBean> forEachTestBeans() {
|
||||
List<TestBean> resolved = new LinkedList<>();
|
||||
List<TestBean> resolved = new ArrayList<>();
|
||||
this.testBeanProvider.forEach(resolved::add);
|
||||
return resolved;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -16,7 +16,7 @@
|
|||
|
||||
package org.springframework.beans.factory.config;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
@ -47,7 +47,7 @@ public class SimpleScopeTests {
|
|||
beanFactory = new DefaultListableBeanFactory();
|
||||
Scope scope = new NoOpScope() {
|
||||
private int index;
|
||||
private List<TestBean> objects = new LinkedList<>(); {
|
||||
private List<TestBean> objects = new ArrayList<>(); {
|
||||
objects.add(new TestBean());
|
||||
objects.add(new TestBean());
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.util.AbstractCollection;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -960,7 +959,7 @@ public class BeanFactoryGenericsTests {
|
|||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public static class NamedUrlList extends LinkedList<URL> {
|
||||
public static class NamedUrlList extends ArrayList<URL> {
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -28,7 +28,6 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
@ -406,7 +405,7 @@ public class SpringValidatorAdapterTests {
|
|||
private Set<Child> childSet = new LinkedHashSet<>();
|
||||
|
||||
@Valid
|
||||
private List<Child> childList = new LinkedList<>();
|
||||
private List<Child> childList = new ArrayList<>();
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -20,10 +20,10 @@ import java.lang.annotation.ElementType;
|
|||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
@ -295,7 +295,7 @@ public class ValidatorFactoryTests {
|
|||
private ValidAddress address = new ValidAddress();
|
||||
|
||||
@Valid
|
||||
private List<ValidAddress> addressList = new LinkedList<>();
|
||||
private List<ValidAddress> addressList = new ArrayList<>();
|
||||
|
||||
@Valid
|
||||
private Set<ValidAddress> addressSet = new LinkedHashSet<>();
|
||||
|
@ -457,7 +457,7 @@ public class ValidatorFactoryTests {
|
|||
public static class ListContainer {
|
||||
|
||||
@NotXList
|
||||
private List<String> list = new LinkedList<>();
|
||||
private List<String> list = new ArrayList<>();
|
||||
|
||||
public void addString(String value) {
|
||||
list.add(value);
|
||||
|
|
|
@ -22,9 +22,9 @@ import java.lang.reflect.Method;
|
|||
import java.lang.reflect.UndeclaredThrowableException;
|
||||
import java.rmi.MarshalException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -1128,7 +1128,7 @@ public abstract class AbstractAopProxyTests {
|
|||
};
|
||||
|
||||
class NameSaver implements MethodInterceptor {
|
||||
private List<Object> names = new LinkedList<>();
|
||||
private List<Object> names = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.springframework.aop.framework;
|
|||
import java.io.FileNotFoundException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.LinkedList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.aopalliance.aop.Advice;
|
||||
|
@ -654,7 +654,7 @@ public class ProxyFactoryBeanTests {
|
|||
@SuppressWarnings("serial")
|
||||
public static class PointcutForVoid extends DefaultPointcutAdvisor {
|
||||
|
||||
public static List<String> methodNames = new LinkedList<>();
|
||||
public static List<String> methodNames = new ArrayList<>();
|
||||
|
||||
public static void reset() {
|
||||
methodNames.clear();
|
||||
|
|
|
@ -25,7 +25,6 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
@ -555,7 +554,7 @@ public class ImportSelectorTests {
|
|||
|
||||
@Override
|
||||
public Iterable<Entry> selectImports() {
|
||||
LinkedList<Entry> content = new LinkedList<>(this.instanceImports);
|
||||
ArrayList<Entry> content = new ArrayList<>(this.instanceImports);
|
||||
Collections.reverse(content);
|
||||
return content;
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
package org.springframework.context.event;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executor;
|
||||
|
@ -537,7 +537,7 @@ public class ApplicationContextEventTests extends AbstractApplicationEventListen
|
|||
|
||||
public static class MyOrderedListener1 implements ApplicationListener<ApplicationEvent>, Ordered {
|
||||
|
||||
public final List<ApplicationEvent> seenEvents = new LinkedList<>();
|
||||
public final List<ApplicationEvent> seenEvents = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationEvent event) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -27,7 +27,6 @@ import java.lang.reflect.Field;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
@ -361,7 +360,7 @@ public class SpringValidatorAdapterTests {
|
|||
private Set<Child> childSet = new LinkedHashSet<>();
|
||||
|
||||
@Valid
|
||||
private List<Child> childList = new LinkedList<>();
|
||||
private List<Child> childList = new ArrayList<>();
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -20,10 +20,10 @@ import java.lang.annotation.ElementType;
|
|||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
@ -293,7 +293,7 @@ public class ValidatorFactoryTests {
|
|||
private ValidAddress address = new ValidAddress();
|
||||
|
||||
@Valid
|
||||
private List<ValidAddress> addressList = new LinkedList<>();
|
||||
private List<ValidAddress> addressList = new ArrayList<>();
|
||||
|
||||
@Valid
|
||||
private Set<ValidAddress> addressSet = new LinkedHashSet<>();
|
||||
|
@ -455,7 +455,7 @@ public class ValidatorFactoryTests {
|
|||
public static class ListContainer {
|
||||
|
||||
@NotXList
|
||||
private List<String> list = new LinkedList<>();
|
||||
private List<String> list = new ArrayList<>();
|
||||
|
||||
public void addString(String value) {
|
||||
list.add(value);
|
||||
|
|
|
@ -33,7 +33,6 @@ import java.util.EnumSet;
|
|||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
@ -384,7 +383,7 @@ class DefaultConversionServiceTests {
|
|||
|
||||
@Test
|
||||
void convertArrayToCollectionImpl() {
|
||||
LinkedList<?> result = conversionService.convert(new String[] {"1", "2", "3"}, LinkedList.class);
|
||||
ArrayList<?> result = conversionService.convert(new String[] {"1", "2", "3"}, ArrayList.class);
|
||||
assertThat(result.get(0)).isEqualTo("1");
|
||||
assertThat(result.get(1)).isEqualTo("2");
|
||||
assertThat(result.get(2)).isEqualTo("3");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -26,7 +26,6 @@ import java.util.Arrays;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
|
@ -103,8 +102,8 @@ class CollectionToCollectionConverterTests {
|
|||
TypeDescriptor targetType = new TypeDescriptor(getClass().getField("emptyListDifferentTarget"));
|
||||
assertThat(conversionService.canConvert(sourceType, targetType)).isTrue();
|
||||
@SuppressWarnings("unchecked")
|
||||
LinkedList<Integer> result = (LinkedList<Integer>) conversionService.convert(list, sourceType, targetType);
|
||||
assertThat(result.getClass()).isEqualTo(LinkedList.class);
|
||||
ArrayList<Integer> result = (ArrayList<Integer>) conversionService.convert(list, sourceType, targetType);
|
||||
assertThat(result.getClass()).isEqualTo(ArrayList.class);
|
||||
assertThat(result.isEmpty()).isTrue();
|
||||
}
|
||||
|
||||
|
@ -270,7 +269,7 @@ class CollectionToCollectionConverterTests {
|
|||
|
||||
public List<Integer> emptyListTarget;
|
||||
|
||||
public LinkedList<Integer> emptyListDifferentTarget;
|
||||
public ArrayList<Integer> emptyListDifferentTarget;
|
||||
|
||||
public List<List<List<Integer>>> objectToCollection;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -16,7 +16,7 @@
|
|||
|
||||
package org.springframework.util;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -38,7 +38,7 @@ class AutoPopulatingListTests {
|
|||
|
||||
@Test
|
||||
void withClassAndUserSuppliedBackingList() throws Exception {
|
||||
doTestWithClass(new AutoPopulatingList<Object>(new LinkedList<>(), TestObject.class));
|
||||
doTestWithClass(new AutoPopulatingList<Object>(new ArrayList<>(), TestObject.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -48,7 +48,7 @@ class AutoPopulatingListTests {
|
|||
|
||||
@Test
|
||||
void withElementFactoryAndUserSuppliedBackingList() throws Exception {
|
||||
doTestWithElementFactory(new AutoPopulatingList<Object>(new LinkedList<>(), new MockElementFactory()));
|
||||
doTestWithElementFactory(new AutoPopulatingList<Object>(new ArrayList<>(), new MockElementFactory()));
|
||||
}
|
||||
|
||||
private void doTestWithClass(AutoPopulatingList<Object> list) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -29,7 +29,6 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -364,17 +363,17 @@ class ClassUtilsTests {
|
|||
|
||||
@Test
|
||||
void classNamesToString() {
|
||||
List<Class<?>> ifcs = new LinkedList<>();
|
||||
List<Class<?>> ifcs = new ArrayList<>();
|
||||
ifcs.add(Serializable.class);
|
||||
ifcs.add(Runnable.class);
|
||||
assertThat(ifcs.toString()).isEqualTo("[interface java.io.Serializable, interface java.lang.Runnable]");
|
||||
assertThat(ClassUtils.classNamesToString(ifcs)).isEqualTo("[java.io.Serializable, java.lang.Runnable]");
|
||||
|
||||
List<Class<?>> classes = new LinkedList<>();
|
||||
classes.add(LinkedList.class);
|
||||
List<Class<?>> classes = new ArrayList<>();
|
||||
classes.add(ArrayList.class);
|
||||
classes.add(Integer.class);
|
||||
assertThat(classes.toString()).isEqualTo("[class java.util.LinkedList, class java.lang.Integer]");
|
||||
assertThat(ClassUtils.classNamesToString(classes)).isEqualTo("[java.util.LinkedList, java.lang.Integer]");
|
||||
assertThat(classes.toString()).isEqualTo("[class java.util.ArrayList, class java.lang.Integer]");
|
||||
assertThat(ClassUtils.classNamesToString(classes)).isEqualTo("[java.util.ArrayList, java.lang.Integer]");
|
||||
|
||||
assertThat(Collections.singletonList(List.class).toString()).isEqualTo("[interface java.util.List]");
|
||||
assertThat(ClassUtils.classNamesToString(List.class)).isEqualTo("[java.util.List]");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -22,7 +22,6 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
@ -46,7 +45,7 @@ class CollectionUtilsTests {
|
|||
assertThat(CollectionUtils.isEmpty(new HashMap<String, String>())).isTrue();
|
||||
assertThat(CollectionUtils.isEmpty(new HashSet<>())).isTrue();
|
||||
|
||||
List<Object> list = new LinkedList<>();
|
||||
List<Object> list = new ArrayList<>();
|
||||
list.add(new Object());
|
||||
assertThat(CollectionUtils.isEmpty(list)).isFalse();
|
||||
|
||||
|
@ -58,7 +57,7 @@ class CollectionUtilsTests {
|
|||
@Test
|
||||
void mergeArrayIntoCollection() {
|
||||
Object[] arr = new Object[] {"value1", "value2"};
|
||||
List<Comparable<?>> list = new LinkedList<>();
|
||||
List<Comparable<?>> list = new ArrayList<>();
|
||||
list.add("value3");
|
||||
|
||||
CollectionUtils.mergeArrayIntoCollection(arr, list);
|
||||
|
@ -70,7 +69,7 @@ class CollectionUtilsTests {
|
|||
@Test
|
||||
void mergePrimitiveArrayIntoCollection() {
|
||||
int[] arr = new int[] {1, 2};
|
||||
List<Comparable<?>> list = new LinkedList<>();
|
||||
List<Comparable<?>> list = new ArrayList<>();
|
||||
list.add(Integer.valueOf(3));
|
||||
|
||||
CollectionUtils.mergeArrayIntoCollection(arr, list);
|
||||
|
@ -101,10 +100,10 @@ class CollectionUtilsTests {
|
|||
void contains() {
|
||||
assertThat(CollectionUtils.contains((Iterator<String>) null, "myElement")).isFalse();
|
||||
assertThat(CollectionUtils.contains((Enumeration<String>) null, "myElement")).isFalse();
|
||||
assertThat(CollectionUtils.contains(new LinkedList<String>().iterator(), "myElement")).isFalse();
|
||||
assertThat(CollectionUtils.contains(new ArrayList<String>().iterator(), "myElement")).isFalse();
|
||||
assertThat(CollectionUtils.contains(new Hashtable<String, Object>().keys(), "myElement")).isFalse();
|
||||
|
||||
List<String> list = new LinkedList<>();
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("myElement");
|
||||
assertThat(CollectionUtils.contains(list.iterator(), "myElement")).isTrue();
|
||||
|
||||
|
@ -178,35 +177,35 @@ class CollectionUtilsTests {
|
|||
|
||||
@Test
|
||||
void hasUniqueObject() {
|
||||
List<String> list = new LinkedList<>();
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("myElement");
|
||||
list.add("myOtherElement");
|
||||
assertThat(CollectionUtils.hasUniqueObject(list)).isFalse();
|
||||
|
||||
list = new LinkedList<>();
|
||||
list = new ArrayList<>();
|
||||
list.add("myElement");
|
||||
assertThat(CollectionUtils.hasUniqueObject(list)).isTrue();
|
||||
|
||||
list = new LinkedList<>();
|
||||
list = new ArrayList<>();
|
||||
list.add("myElement");
|
||||
list.add(null);
|
||||
assertThat(CollectionUtils.hasUniqueObject(list)).isFalse();
|
||||
|
||||
list = new LinkedList<>();
|
||||
list = new ArrayList<>();
|
||||
list.add(null);
|
||||
list.add("myElement");
|
||||
assertThat(CollectionUtils.hasUniqueObject(list)).isFalse();
|
||||
|
||||
list = new LinkedList<>();
|
||||
list = new ArrayList<>();
|
||||
list.add(null);
|
||||
list.add(null);
|
||||
assertThat(CollectionUtils.hasUniqueObject(list)).isTrue();
|
||||
|
||||
list = new LinkedList<>();
|
||||
list = new ArrayList<>();
|
||||
list.add(null);
|
||||
assertThat(CollectionUtils.hasUniqueObject(list)).isTrue();
|
||||
|
||||
list = new LinkedList<>();
|
||||
list = new ArrayList<>();
|
||||
assertThat(CollectionUtils.hasUniqueObject(list)).isFalse();
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.lang.reflect.Method;
|
|||
import java.lang.reflect.Modifier;
|
||||
import java.rmi.ConnectException;
|
||||
import java.rmi.RemoteException;
|
||||
import java.util.LinkedList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
@ -370,9 +370,9 @@ class ReflectionUtilsTests {
|
|||
|
||||
private static class ListSavingMethodCallback implements ReflectionUtils.MethodCallback {
|
||||
|
||||
private List<String> methodNames = new LinkedList<>();
|
||||
private List<String> methodNames = new ArrayList<>();
|
||||
|
||||
private List<Method> methods = new LinkedList<>();
|
||||
private List<Method> methods = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void doWith(Method m) throws IllegalArgumentException, IllegalAccessException {
|
||||
|
|
|
@ -30,7 +30,6 @@ import java.sql.Types;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -196,7 +195,7 @@ public class JdbcTemplateTests {
|
|||
String[] results = {"rod", "gary", " portia"};
|
||||
|
||||
class StringHandler implements RowCallbackHandler {
|
||||
private List<String> list = new LinkedList<>();
|
||||
private List<String> list = new ArrayList<>();
|
||||
@Override
|
||||
public void processRow(ResultSet rs) throws SQLException {
|
||||
this.list.add(rs.getString(1));
|
||||
|
|
|
@ -22,10 +22,10 @@ import java.sql.PreparedStatement;
|
|||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Types;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
@ -275,7 +275,7 @@ public class NamedParameterJdbcTemplateTests {
|
|||
|
||||
params.put("id", new SqlParameterValue(Types.DECIMAL, 1));
|
||||
params.put("country", "UK");
|
||||
final List<Customer> customers = new LinkedList<>();
|
||||
final List<Customer> customers = new ArrayList<>();
|
||||
namedParameterTemplate.query(SELECT_NAMED_PARAMETERS, params, rs -> {
|
||||
Customer cust = new Customer();
|
||||
cust.setId(rs.getInt(COLUMN_NAMES[0]));
|
||||
|
@ -300,7 +300,7 @@ public class NamedParameterJdbcTemplateTests {
|
|||
given(resultSet.getInt("id")).willReturn(1);
|
||||
given(resultSet.getString("forename")).willReturn("rod");
|
||||
|
||||
final List<Customer> customers = new LinkedList<>();
|
||||
final List<Customer> customers = new ArrayList<>();
|
||||
namedParameterTemplate.query(SELECT_NO_PARAMETERS, rs -> {
|
||||
Customer cust = new Customer();
|
||||
cust.setId(rs.getInt(COLUMN_NAMES[0]));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -18,9 +18,9 @@ package org.springframework.mock.web;
|
|||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -93,7 +93,7 @@ class MockMultipartHttpServletRequestTests {
|
|||
MultipartFile file1 = request.getFile("file1");
|
||||
MultipartFile file2 = request.getFile("file2");
|
||||
Map<String, MultipartFile> fileMap = request.getFileMap();
|
||||
List<String> fileMapKeys = new LinkedList<>(fileMap.keySet());
|
||||
List<String> fileMapKeys = new ArrayList<>(fileMap.keySet());
|
||||
assertThat(fileMapKeys.size()).isEqualTo(2);
|
||||
assertThat(fileMap.get("file1")).isEqualTo(file1);
|
||||
assertThat(fileMap.get("file2")).isEqualTo(file2);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -18,8 +18,8 @@ package org.springframework.transaction.interceptor;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.rmi.RemoteException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -51,7 +51,7 @@ public class RuleBasedTransactionAttributeTests {
|
|||
*/
|
||||
@Test
|
||||
public void testRuleForRollbackOnChecked() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
list.add(new RollbackRuleAttribute(IOException.class.getName()));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class RuleBasedTransactionAttributeTests {
|
|||
|
||||
@Test
|
||||
public void testRuleForCommitOnUnchecked() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
list.add(new NoRollbackRuleAttribute(MyRuntimeException.class.getName()));
|
||||
list.add(new RollbackRuleAttribute(IOException.class.getName()));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
|
||||
|
@ -79,7 +79,7 @@ public class RuleBasedTransactionAttributeTests {
|
|||
|
||||
@Test
|
||||
public void testRuleForSelectiveRollbackOnCheckedWithString() {
|
||||
List<RollbackRuleAttribute> l = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> l = new ArrayList<>();
|
||||
l.add(new RollbackRuleAttribute(java.rmi.RemoteException.class.getName()));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, l);
|
||||
doTestRuleForSelectiveRollbackOnChecked(rta);
|
||||
|
@ -106,7 +106,7 @@ public class RuleBasedTransactionAttributeTests {
|
|||
*/
|
||||
@Test
|
||||
public void testRuleForCommitOnSubclassOfChecked() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
// Note that it's important to ensure that we have this as
|
||||
// a FQN: otherwise it will match everything!
|
||||
list.add(new RollbackRuleAttribute("java.lang.Exception"));
|
||||
|
@ -121,7 +121,7 @@ public class RuleBasedTransactionAttributeTests {
|
|||
|
||||
@Test
|
||||
public void testRollbackNever() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
list.add(new NoRollbackRuleAttribute("Throwable"));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
|
||||
|
||||
|
@ -134,7 +134,7 @@ public class RuleBasedTransactionAttributeTests {
|
|||
|
||||
@Test
|
||||
public void testToStringMatchesEditor() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
list.add(new NoRollbackRuleAttribute("Throwable"));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
|
||||
|
||||
|
@ -154,7 +154,7 @@ public class RuleBasedTransactionAttributeTests {
|
|||
*/
|
||||
@Test
|
||||
public void testConflictingRulesToDetermineExactContract() {
|
||||
List<RollbackRuleAttribute> list = new LinkedList<>();
|
||||
List<RollbackRuleAttribute> list = new ArrayList<>();
|
||||
list.add(new NoRollbackRuleAttribute(MyBusinessWarningException.class));
|
||||
list.add(new RollbackRuleAttribute(MyBusinessException.class));
|
||||
RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -16,8 +16,8 @@
|
|||
|
||||
package org.springframework.transaction.jta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class MockUOWManager implements UOWManager {
|
|||
|
||||
private final Map<Object, Object> resources = new HashMap<>();
|
||||
|
||||
private final List<Synchronization> synchronizations = new LinkedList<>();
|
||||
private final List<Synchronization> synchronizations = new ArrayList<>();
|
||||
|
||||
|
||||
@Override
|
||||
|
|
|
@ -41,7 +41,6 @@ import java.util.Date;
|
|||
import java.util.GregorianCalendar;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
@ -2409,7 +2408,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
|
|||
|
||||
@Override
|
||||
public List<TestBean> getTestBeans() {
|
||||
List<TestBean> list = new LinkedList<>();
|
||||
List<TestBean> list = new ArrayList<>();
|
||||
list.add(new TestBean("tb1"));
|
||||
list.add(new TestBean("tb2"));
|
||||
return list;
|
||||
|
@ -2436,7 +2435,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
|
|||
@Override
|
||||
@ModelAttribute("testBeanList")
|
||||
public List<TestBean> getTestBeans() {
|
||||
List<TestBean> list = new LinkedList<>();
|
||||
List<TestBean> list = new ArrayList<>();
|
||||
list.add(new TestBean("tb1"));
|
||||
list.add(new TestBean("tb2"));
|
||||
return list;
|
||||
|
@ -2463,7 +2462,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
|
|||
|
||||
@ModelAttribute("testBeanList")
|
||||
public List<TestBean> getTestBeans() {
|
||||
List<TestBean> list = new LinkedList<>();
|
||||
List<TestBean> list = new ArrayList<>();
|
||||
list.add(new TestBean("tb1"));
|
||||
list.add(new TestBean("tb2"));
|
||||
return list;
|
||||
|
@ -2500,7 +2499,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
|
|||
|
||||
@ModelAttribute
|
||||
public List<TestBean> getTestBeans() {
|
||||
List<TestBean> list = new LinkedList<>();
|
||||
List<TestBean> list = new ArrayList<>();
|
||||
list.add(new TestBean("tb1"));
|
||||
list.add(new TestBean("tb2"));
|
||||
return list;
|
||||
|
@ -2521,7 +2520,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
|
|||
|
||||
@ModelAttribute("testBeanList")
|
||||
public List<TestBean> getTestBeans(@ModelAttribute(name="myCommand", binding=false) TestBean tb) {
|
||||
List<TestBean> list = new LinkedList<>();
|
||||
List<TestBean> list = new ArrayList<>();
|
||||
list.add(new TestBean("tb1"));
|
||||
list.add(new TestBean("tb2"));
|
||||
return list;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
@ -16,8 +16,8 @@
|
|||
|
||||
package org.springframework.web.servlet.tags;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -201,7 +201,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void createQueryStringNoParams() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
String queryString = tag.createQueryString(params, usedParams, true);
|
||||
|
@ -210,7 +210,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void createQueryStringOneParam() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -224,7 +224,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void createQueryStringOneParamForExsistingQueryString() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -238,7 +238,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void createQueryStringOneParamEmptyValue() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -252,7 +252,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void createQueryStringOneParamNullValue() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -266,7 +266,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void createQueryStringOneParamAlreadyUsed() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -281,7 +281,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void createQueryStringTwoParams() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -300,7 +300,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void createQueryStringUrlEncoding() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -319,7 +319,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void createQueryStringParamNullName() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -333,7 +333,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void createQueryStringParamEmptyName() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -347,7 +347,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void replaceUriTemplateParamsNoParams() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
String uri = tag.replaceUriTemplateParams("url/path", params, usedParams);
|
||||
|
@ -357,7 +357,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void replaceUriTemplateParamsTemplateWithoutParamMatch() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
String uri = tag.replaceUriTemplateParams("url/{path}", params, usedParams);
|
||||
|
@ -367,7 +367,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void replaceUriTemplateParamsTemplateWithParamMatch() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -383,7 +383,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void replaceUriTemplateParamsTemplateWithParamMatchNamePreEncoding() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -399,7 +399,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void replaceUriTemplateParamsTemplateWithParamMatchValueEncoded() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -417,7 +417,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test // SPR-11401
|
||||
public void replaceUriTemplateParamsTemplateWithPathSegment() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
@ -434,7 +434,7 @@ public class UrlTagTests extends AbstractTagTests {
|
|||
|
||||
@Test
|
||||
public void replaceUriTemplateParamsTemplateWithPath() throws JspException {
|
||||
List<Param> params = new LinkedList<>();
|
||||
List<Param> params = new ArrayList<>();
|
||||
Set<String> usedParams = new HashSet<>();
|
||||
|
||||
Param param = new Param();
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
@ -600,7 +599,7 @@ public class SelectTagTests extends AbstractFormTagTests {
|
|||
this.bean.setSomeList(list);
|
||||
|
||||
BeanPropertyBindingResult errors = new BeanPropertyBindingResult(this.bean, COMMAND_NAME);
|
||||
errors.getPropertyAccessor().registerCustomEditor(List.class, new CustomCollectionEditor(LinkedList.class) {
|
||||
errors.getPropertyAccessor().registerCustomEditor(List.class, new CustomCollectionEditor(ArrayList.class) {
|
||||
@Override
|
||||
public String getAsText() {
|
||||
return getValue().toString();
|
||||
|
|
Loading…
Reference in New Issue