gh-25650 Replace remaining usage of LinkedList with ArrayList in tests
This commit is contained in:
committed by
Juergen Hoeller
parent
79cf6b4353
commit
1f3e52d932
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user