Skip to content

Commit cb79d57

Browse files
committed
Manipulating classpath items should preserve item order
`getClasspathElements` computes the compilation and test compilation classpath from `MavenProject#getCompileClasspathElements` which is a `List<String>`. Transforming from the ordered `List<String>` into an unordered `Hashset<File>` can change the order of classpath elements. While this didn't cause a compilation issue in my case it could. It did break the [develocity cache key computation](https://develocity.apache.org/c/unuozmm6ecqpc/nusnauq3l6a6u/goal-inputs?expanded=WyJuemRibm96bGFrZ2FnLWNsYXNzcGF0aGVsZW1lbnRzIiwibnpkYm5vemxha2dhZy1jbGFzc3BhdGhFbGVtZW50cy0wLWZpbGUtb3JkZXIiXQ) I'm using to improve Apache James build times.
1 parent a25b942 commit cb79d57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/util/FileUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static File fileOf(File f, boolean canonical) throws Exception {
3636
}
3737

3838
public static Set<File> fromStrings(Collection<String> s) {
39-
return s.stream().map(File::new).collect(Collectors.toSet());
39+
return s.stream().map(File::new).collect(Collectors.toCollection(TreeSet::new));
4040
}
4141

4242
public static String toMultiPath(Collection<File> paths) {

0 commit comments

Comments
 (0)