Skip to content

Commit

Permalink
maintain order of repositories read from xml (#46)
Browse files Browse the repository at this point in the history
maintain order of repositories read from xml
  • Loading branch information
FinlayRJW authored Oct 11, 2024
1 parent 8f108a0 commit 4ce7f10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-46.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: maintain order of repositories read from xml
links:
- https://github.com/palantir/gradle-consistent-versions-idea-plugin/pull/46
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.intellij.openapi.project.Project;
import java.io.File;
import java.io.IOException;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
Expand All @@ -52,7 +53,7 @@ public static Set<String> loadRepositories(Project project) {
Repositories repositories = XML_MAPPER.readValue(mavenRepoFile, Repositories.class);
return repositories.repositories().stream()
.map(RepositoryConfig::url)
.collect(Collectors.toSet());
.collect(Collectors.toCollection(LinkedHashSet::new));
} catch (IOException e) {
log.error("Failed to load repositories", e);
}
Expand Down

0 comments on commit 4ce7f10

Please sign in to comment.