Update pmd-core/src/main/java/net/sourceforge/pmd/util/GraphUtil.java

Co-authored-by: Clément Fournier <clem.fournier@proton.me>
This commit is contained in:
Andreas Dangel
2024-03-15 13:40:45 +01:00
committed by GitHub
parent 7b58a7ef1b
commit 3237f13d92

View File

@ -43,8 +43,7 @@ public final class GraphUtil {
StringBuilder sb = new StringBuilder("strict digraph {\n");
Map<V, String> ids = new HashMap<>();
int i = 0;
List<V> vertexList = new ArrayList<>();
vertexList.addAll(vertices);
List<V> vertexList = new ArrayList<>(vertices);
vertexList.sort(Comparator.comparing(Object::toString)); // for reproducibility in tests
for (V node : vertexList) {
String id = "n" + i++;