Selected use of ArrayList instead of LinkedList in common places

See gh-25652
This commit is contained in:
Juergen Hoeller
2020-08-27 14:14:44 +02:00
parent 589060d10f
commit cf2e0c7959
12 changed files with 48 additions and 51 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 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,7 @@
package org.springframework.orm.jpa.persistenceunit;
import java.net.URL;
import java.util.LinkedList;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@@ -61,16 +61,16 @@ public class MutablePersistenceUnitInfo implements SmartPersistenceUnitInfo {
@Nullable
private DataSource jtaDataSource;
private final List<String> mappingFileNames = new LinkedList<>();
private final List<String> mappingFileNames = new ArrayList<>();
private List<URL> jarFileUrls = new LinkedList<>();
private final List<URL> jarFileUrls = new ArrayList<>();
@Nullable
private URL persistenceUnitRootUrl;
private final List<String> managedClassNames = new LinkedList<>();
private final List<String> managedClassNames = new ArrayList<>();
private final List<String> managedPackages = new LinkedList<>();
private final List<String> managedPackages = new ArrayList<>();
private boolean excludeUnlistedClasses = false;

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.
@@ -24,7 +24,6 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -423,7 +422,7 @@ public class PersistenceAnnotationBeanPostProcessor
Class<?> targetClass = clazz;
do {
final LinkedList<InjectionMetadata.InjectedElement> currElements = new LinkedList<>();
final List<InjectionMetadata.InjectedElement> currElements = new ArrayList<>();
ReflectionUtils.doWithLocalFields(targetClass, field -> {
if (field.isAnnotationPresent(PersistenceContext.class) ||