File tree 1 file changed +3
-11
lines changed
check_api/src/main/java/com/google/errorprone/fixes
1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change 19
19
import static com .google .common .base .Preconditions .checkArgument ;
20
20
21
21
import com .google .common .base .Joiner ;
22
- import com .google .common .collect .ComparisonChain ;
23
22
import com .google .common .collect .ImmutableSet ;
24
- import com .google .common .collect .Ordering ;
25
23
import com .google .common .collect .Range ;
26
24
import com .google .common .collect .RangeMap ;
27
25
import com .google .common .collect .TreeRangeMap ;
@@ -41,15 +39,9 @@ public class Replacements {
41
39
* length of the input don't affect the position of earlier replacements.
42
40
*/
43
41
private static final Comparator <Range <Integer >> DESCENDING =
44
- new Comparator <Range <Integer >>() {
45
- @ Override
46
- public int compare (Range <Integer > o1 , Range <Integer > o2 ) {
47
- return ComparisonChain .start ()
48
- .compare (o1 .lowerEndpoint (), o2 .lowerEndpoint (), Ordering .natural ().reverse ())
49
- .compare (o1 .upperEndpoint (), o2 .upperEndpoint (), Ordering .natural ().reverse ())
50
- .result ();
51
- }
52
- };
42
+ Comparator .<Range <Integer >, Integer >comparing (Range ::lowerEndpoint )
43
+ .thenComparing (Range ::upperEndpoint )
44
+ .reversed ();
53
45
54
46
private final TreeMap <Range <Integer >, Replacement > replacements = new TreeMap <>(DESCENDING );
55
47
private final RangeMap <Integer , Replacement > overlaps = TreeRangeMap .create ();
You can’t perform that action at this time.
0 commit comments