Skip to content

Commit c861f24

Browse files
author
Phillip Webb
committed
Switch mergeDependencies to use a set.
1 parent d36f9ce commit c861f24

File tree

1 file changed

+5
-5
lines changed
  • spring-boot-tools/spring-boot-dependency-tools/src/main/java/org/springframework/boot/dependency/tools

1 file changed

+5
-5
lines changed

spring-boot-tools/spring-boot-dependency-tools/src/main/java/org/springframework/boot/dependency/tools/AbstractDependencies.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919
import java.util.ArrayList;
2020
import java.util.Iterator;
2121
import java.util.LinkedHashMap;
22-
import java.util.List;
22+
import java.util.LinkedHashSet;
2323
import java.util.Map;
24+
import java.util.Set;
2425

2526
import org.springframework.boot.dependency.tools.Dependency.Exclusion;
2627

2728
/**
2829
* Abstract base implementation for {@link Dependencies}.
29-
*
30+
*
3031
* @author Phillip Webb
3132
* @author Andy Wilkinson
3233
* @since 1.1.0
@@ -68,12 +69,11 @@ protected void add(ArtifactAndGroupId artifactAndGroupId, Dependency dependency)
6869

6970
private Dependency mergeDependencies(Dependency existingDependency,
7071
Dependency newDependency) {
71-
List<Exclusion> combinedExclusions = new ArrayList<Exclusion>();
72+
Set<Exclusion> combinedExclusions = new LinkedHashSet<Exclusion>();
7273
combinedExclusions.addAll(existingDependency.getExclusions());
7374
combinedExclusions.addAll(newDependency.getExclusions());
74-
7575
return new Dependency(newDependency.getGroupId(), newDependency.getArtifactId(),
76-
newDependency.getVersion(), combinedExclusions);
76+
newDependency.getVersion(), new ArrayList<Exclusion>(combinedExclusions));
7777
}
7878

7979
/**

0 commit comments

Comments
 (0)