From 16682bada52d2d2485548838b272f7c5e35ca6c7 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Thu, 10 Nov 2022 23:58:25 -0500 Subject: [PATCH] undo TargetNodeRecurseFetcher List->Set change --- .../http/api/v2/graph/TargetNodeRecurseFetcher.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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; } }