Use constructor rather than Collection.addAll

See gh-41053
This commit is contained in:
Piyal Ahmed
2024-06-11 16:18:49 +06:00
committed by Phillip Webb
parent d37098153c
commit 17adcfc180
5 changed files with 5 additions and 10 deletions

View File

@@ -240,8 +240,7 @@ class ImportsContextCustomizer implements ContextCustomizer {
this.key = Collections.unmodifiableSet(synthesize(annotations));
}
else {
Set<Object> key = new HashSet<>();
key.addAll(determinedImports);
Set<Object> key = new HashSet<>(determinedImports);
Set<Annotation> componentScanning = annotations.stream()
.filter((annotation) -> annotation.getType().equals(ComponentScan.class))
.map(MergedAnnotation::synthesize)