File tree Expand file tree Collapse file tree
check_api/src/main/java/com/google/errorprone/fixes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919import static com .google .common .base .Preconditions .checkArgument ;
2020
2121import com .google .common .base .Joiner ;
22- import com .google .common .collect .ComparisonChain ;
2322import com .google .common .collect .ImmutableSet ;
24- import com .google .common .collect .Ordering ;
2523import com .google .common .collect .Range ;
2624import com .google .common .collect .RangeMap ;
2725import com .google .common .collect .TreeRangeMap ;
@@ -41,15 +39,9 @@ public class Replacements {
4139 * length of the input don't affect the position of earlier replacements.
4240 */
4341 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 ();
5345
5446 private final TreeMap <Range <Integer >, Replacement > replacements = new TreeMap <>(DESCENDING );
5547 private final RangeMap <Integer , Replacement > overlaps = TreeRangeMap .create ();
You can’t perform that action at this time.
0 commit comments