Skip to content

Commit 16682ba

Browse files
committed
undo TargetNodeRecurseFetcher List->Set change
1 parent 73664fb commit 16682ba

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/java/io/cryostat/net/web/http/api/v2/graph/TargetNodeRecurseFetcher.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import java.util.ArrayList;
4141
import java.util.EnumSet;
4242
import java.util.HashMap;
43-
import java.util.HashSet;
4443
import java.util.List;
4544
import java.util.Map;
4645
import java.util.Objects;
@@ -98,7 +97,7 @@ boolean blocking() {
9897
public List<TargetNode> getAuthenticated(DataFetchingEnvironment environment) throws Exception {
9998
AbstractNode node = environment.getSource();
10099
FilterInput filter = FilterInput.from(environment);
101-
Set<TargetNode> result = new HashSet<>();
100+
List<TargetNode> result = new ArrayList<>();
102101
if (node instanceof TargetNode) {
103102
result.add((TargetNode) node);
104103
} else if (node instanceof EnvironmentNode) {
@@ -117,15 +116,15 @@ public List<TargetNode> getAuthenticated(DataFetchingEnvironment environment) th
117116
result =
118117
result.stream()
119118
.filter(n -> Objects.equals(n.getName(), nodeName))
120-
.collect(Collectors.toSet());
119+
.collect(Collectors.toList());
121120
}
122121
if (filter.contains(FilterInput.Key.LABELS)) {
123122
List<String> labels = filter.get(FilterInput.Key.LABELS);
124123
for (String label : labels) {
125124
result =
126125
result.stream()
127126
.filter(n -> LabelSelectorMatcher.parse(label).test(n.getLabels()))
128-
.collect(Collectors.toSet());
127+
.collect(Collectors.toList());
129128
}
130129
}
131130
if (filter.contains(FilterInput.Key.ANNOTATIONS)) {
@@ -146,9 +145,9 @@ public List<TargetNode> getAuthenticated(DataFetchingEnvironment environment) th
146145
n ->
147146
LabelSelectorMatcher.parse(annotation)
148147
.test(mergedAnnotations.apply(n)))
149-
.collect(Collectors.toSet());
148+
.collect(Collectors.toList());
150149
}
151150
}
152-
return new ArrayList<>(result);
151+
return result;
153152
}
154153
}

0 commit comments

Comments
 (0)