1
1
/*
2
- * Copyright (c) 2009 - 2020 Deutsches Elektronen-Synchroton,
2
+ * Copyright (c) 2009 - 2022 Deutsches Elektronen-Synchroton,
3
3
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
4
4
*
5
5
* This library is free software; you can redistribute it and/or modify
24
24
import com .google .common .collect .ImmutableListMultimap ;
25
25
import com .google .common .collect .ImmutableMultimap ;
26
26
import com .google .common .collect .Multimap ;
27
- import com . google . common . collect . Ordering ;
27
+ import java . util . Comparator ;
28
28
import org .slf4j .Logger ;
29
29
import org .slf4j .LoggerFactory ;
30
30
@@ -135,11 +135,11 @@ private static ImmutableMultimap<Integer, FsExport> parse(URI... exportFiles) th
135
135
}
136
136
137
137
/*
138
- * sort in reverse order to get smallest network first
138
+ * sort in reverse order to get the smallest network first
139
139
*/
140
140
return exportsBuilder
141
- .orderValuesBy (Ordering . from ( HostEntryComparator :: compare ). onResultOf ( FsExport ::client ))
142
- .build ();
141
+ .orderValuesBy (Comparator . comparing ( FsExport ::client , HostEntryComparator :: compare ))
142
+ .build ();
143
143
}
144
144
145
145
private static ImmutableMultimap <Integer , FsExport > parseExportLines (Iterable <String > lines ) throws IOException {
@@ -304,11 +304,11 @@ private static ImmutableMultimap<Integer, FsExport> parseExportLines(Iterable<St
304
304
}
305
305
306
306
/*
307
- * sort in reverse order to get smallest network first
307
+ * sort in reverse order to get the smallest network first
308
308
*/
309
309
return exportsBuilder
310
- .orderValuesBy (Ordering . from ( HostEntryComparator :: compare ). onResultOf ( FsExport ::client ))
311
- .build ();
310
+ .orderValuesBy (Comparator . comparing ( FsExport ::client , HostEntryComparator :: compare ))
311
+ .build ();
312
312
}
313
313
314
314
@ Override
@@ -331,7 +331,7 @@ public FsExport getExport(int index, InetAddress client) {
331
331
public Stream <FsExport > exports (InetAddress client ) {
332
332
return _exports .values ().stream ()
333
333
.filter (e -> e .isAllowed (client ))
334
- .sorted (Ordering . from ( HostEntryComparator :: compare ). onResultOf ( FsExport ::client ));
334
+ .sorted (Comparator . comparing ( FsExport ::client , HostEntryComparator :: compare ));
335
335
}
336
336
337
337
public final void rescan () throws IOException {
0 commit comments