diff --git a/src/main/java/io/cryostat/net/web/http/api/v2/graph/TargetNodeRecurseFetcher.java b/src/main/java/io/cryostat/net/web/http/api/v2/graph/TargetNodeRecurseFetcher.java index a0e520a57d..5a619ad4c0 100644 --- a/src/main/java/io/cryostat/net/web/http/api/v2/graph/TargetNodeRecurseFetcher.java +++ b/src/main/java/io/cryostat/net/web/http/api/v2/graph/TargetNodeRecurseFetcher.java @@ -40,7 +40,6 @@ import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; @@ -98,7 +97,7 @@ boolean blocking() { public List getAuthenticated(DataFetchingEnvironment environment) throws Exception { AbstractNode node = environment.getSource(); FilterInput filter = FilterInput.from(environment); - Set result = new HashSet<>(); + List result = new ArrayList<>(); if (node instanceof TargetNode) { result.add((TargetNode) node); } else if (node instanceof EnvironmentNode) { @@ -117,7 +116,7 @@ public List getAuthenticated(DataFetchingEnvironment environment) th result = result.stream() .filter(n -> Objects.equals(n.getName(), nodeName)) - .collect(Collectors.toSet()); + .collect(Collectors.toList()); } if (filter.contains(FilterInput.Key.LABELS)) { List labels = filter.get(FilterInput.Key.LABELS); @@ -125,7 +124,7 @@ public List getAuthenticated(DataFetchingEnvironment environment) th result = result.stream() .filter(n -> LabelSelectorMatcher.parse(label).test(n.getLabels())) - .collect(Collectors.toSet()); + .collect(Collectors.toList()); } } if (filter.contains(FilterInput.Key.ANNOTATIONS)) { @@ -146,9 +145,9 @@ public List getAuthenticated(DataFetchingEnvironment environment) th n -> LabelSelectorMatcher.parse(annotation) .test(mergedAnnotations.apply(n))) - .collect(Collectors.toSet()); + .collect(Collectors.toList()); } } - return new ArrayList<>(result); + return result; } }