40
40
import java .util .ArrayList ;
41
41
import java .util .EnumSet ;
42
42
import java .util .HashMap ;
43
- import java .util .HashSet ;
44
43
import java .util .List ;
45
44
import java .util .Map ;
46
45
import java .util .Objects ;
@@ -98,7 +97,7 @@ boolean blocking() {
98
97
public List <TargetNode > getAuthenticated (DataFetchingEnvironment environment ) throws Exception {
99
98
AbstractNode node = environment .getSource ();
100
99
FilterInput filter = FilterInput .from (environment );
101
- Set <TargetNode > result = new HashSet <>();
100
+ List <TargetNode > result = new ArrayList <>();
102
101
if (node instanceof TargetNode ) {
103
102
result .add ((TargetNode ) node );
104
103
} else if (node instanceof EnvironmentNode ) {
@@ -117,15 +116,15 @@ public List<TargetNode> getAuthenticated(DataFetchingEnvironment environment) th
117
116
result =
118
117
result .stream ()
119
118
.filter (n -> Objects .equals (n .getName (), nodeName ))
120
- .collect (Collectors .toSet ());
119
+ .collect (Collectors .toList ());
121
120
}
122
121
if (filter .contains (FilterInput .Key .LABELS )) {
123
122
List <String > labels = filter .get (FilterInput .Key .LABELS );
124
123
for (String label : labels ) {
125
124
result =
126
125
result .stream ()
127
126
.filter (n -> LabelSelectorMatcher .parse (label ).test (n .getLabels ()))
128
- .collect (Collectors .toSet ());
127
+ .collect (Collectors .toList ());
129
128
}
130
129
}
131
130
if (filter .contains (FilterInput .Key .ANNOTATIONS )) {
@@ -146,9 +145,9 @@ public List<TargetNode> getAuthenticated(DataFetchingEnvironment environment) th
146
145
n ->
147
146
LabelSelectorMatcher .parse (annotation )
148
147
.test (mergedAnnotations .apply (n )))
149
- .collect (Collectors .toSet ());
148
+ .collect (Collectors .toList ());
150
149
}
151
150
}
152
- return new ArrayList <>( result ) ;
151
+ return result ;
153
152
}
154
153
}
0 commit comments