8263561: Re-examine uses of LinkedList

Reviewed-by: redestad
This commit is contained in:
Sergey Tsypanov 2021-08-02 12:50:38 +00:00 committed by Claes Redestad
parent 6a3f8343bc
commit 249d641889
9 changed files with 45 additions and 47 deletions

View file

@ -41,7 +41,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
@ -245,7 +244,7 @@ final class ProxyGenerator extends ClassWriter {
* List of return types that are not yet known to be
* assignable from ("covered" by) any of the others.
*/
LinkedList<Class<?>> uncoveredReturnTypes = new LinkedList<>();
List<Class<?>> uncoveredReturnTypes = new ArrayList<>(1);
nextNewReturnType:
for (ProxyMethod pm : methods) {

View file

@ -2888,7 +2888,7 @@ public abstract class ResourceBundle {
if (language.equals("nb") || isNorwegianBokmal) {
List<Locale> tmpList = getDefaultList("nb", script, region, variant);
// Insert a locale replacing "nb" with "no" for every list entry with precedence
List<Locale> bokmalList = new LinkedList<>();
List<Locale> bokmalList = new ArrayList<>();
for (Locale l_nb : tmpList) {
var isRoot = l_nb.getLanguage().isEmpty();
var l_no = Locale.getInstance(isRoot ? "" : "no",
@ -2928,7 +2928,7 @@ public abstract class ResourceBundle {
List<String> variants = null;
if (!variant.isEmpty()) {
variants = new LinkedList<>();
variants = new ArrayList<>();
int idx = variant.length();
while (idx != -1) {
variants.add(variant.substring(0, idx));
@ -2936,7 +2936,7 @@ public abstract class ResourceBundle {
}
}
List<Locale> list = new LinkedList<>();
List<Locale> list = new ArrayList<>();
if (variants != null) {
for (String v : variants) {