Use new ArrayList(Collection) rather than new, iterate, and add

See gh-22210
pull/22256/head
XenoAmess 4 years ago committed by Andy Wilkinson
parent 597d6acabc
commit 90d8480ffe

@ -141,10 +141,7 @@ public abstract class AutoConfigurationPackages {
PackageImports(AnnotationMetadata metadata) {
AnnotationAttributes attributes = AnnotationAttributes
.fromMap(metadata.getAnnotationAttributes(AutoConfigurationPackage.class.getName(), false));
List<String> packageNames = new ArrayList<>();
for (String basePackage : attributes.getStringArray("basePackages")) {
packageNames.add(basePackage);
}
List<String> packageNames = new ArrayList<>(Arrays.asList(attributes.getStringArray("basePackages")));
for (Class<?> basePackageClass : attributes.getClassArray("basePackageClasses")) {
packageNames.add(basePackageClass.getPackage().getName());
}

Loading…
Cancel
Save