Replace remaining usage of LinkedList with ArrayList/ArrayDeque

Closes gh-25650
This commit is contained in:
Juergen Hoeller
2020-08-26 18:32:08 +02:00
parent d198c4426f
commit 874574513c
65 changed files with 239 additions and 239 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 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,8 +20,8 @@ import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -57,7 +57,7 @@ public class CallableStatementCreatorFactory {
*/
public CallableStatementCreatorFactory(String callString) {
this.callString = callString;
this.declaredParameters = new LinkedList<>();
this.declaredParameters = new ArrayList<>();
}
/**

View File

@@ -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.
@@ -21,10 +21,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.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
@@ -66,7 +66,7 @@ public class PreparedStatementCreatorFactory {
*/
public PreparedStatementCreatorFactory(String sql) {
this.sql = sql;
this.declaredParameters = new LinkedList<>();
this.declaredParameters = new ArrayList<>();
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 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.
@@ -17,7 +17,6 @@
package org.springframework.jdbc.core;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import org.springframework.lang.Nullable;
@@ -186,7 +185,7 @@ public class SqlParameter {
*/
public static List<SqlParameter> sqlTypesToAnonymousParameterList(@Nullable int... types) {
if (types == null) {
return new LinkedList<>();
return new ArrayList<>();
}
List<SqlParameter> result = new ArrayList<>(types.length);
for (int type : types) {

View File

@@ -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.jdbc.object;
import java.sql.ResultSet;
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;
@@ -79,7 +79,7 @@ public abstract class RdbmsOperation implements InitializingBean {
@Nullable
private String sql;
private final List<SqlParameter> declaredParameters = new LinkedList<>();
private final List<SqlParameter> declaredParameters = new ArrayList<>();
/**
* Has this operation been compiled? Compilation means at

View File

@@ -16,8 +16,8 @@
package org.springframework.jdbc.support;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -47,7 +47,7 @@ public class GeneratedKeyHolder implements KeyHolder {
* Create a new GeneratedKeyHolder with a default list.
*/
public GeneratedKeyHolder() {
this.keyList = new LinkedList<>();
this.keyList = new ArrayList<>(1);
}
/**