Skip to content

Commit

Permalink
Fix TerminalProvider sorting
Browse files Browse the repository at this point in the history
- Change provider sorting so that it uses provider name instead
  of provider object itself. This fixes getting a proper sorting
  list index to compare the order. Uses null check in case provider
  wrongly gives name as null.
- Fixes #846, #852
  • Loading branch information
jvalkeal authored and gnodet committed Aug 1, 2023
1 parent db731c2 commit 3c93ea7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ private Terminal doBuild() throws IOException {
List<String> order = Arrays.asList(
System.getProperty(PROP_PROVIDERS, PROP_PROVIDERS_DEFAULT).split(","));
providers.sort(Comparator.comparing(l -> {
int idx = order.indexOf(l);
int idx = order.indexOf(l.name());
return idx >= 0 ? idx : Integer.MAX_VALUE;
}));

Expand Down

0 comments on commit 3c93ea7

Please sign in to comment.