@@ -36,7 +36,7 @@ public final class TraceMatcher {
3636
3737 /** Configures {@link #trace(UnaryOperator, SpanMatcher...)} to sort spans by start time. */
3838 public static final UnaryOperator <Options > SORT_BY_START_TIME =
39- options -> options .sorter (START_TIME_COMPARATOR );
39+ options -> options .sort (START_TIME_COMPARATOR );
4040
4141 /**
4242 * Configures {@link #trace(UnaryOperator, SpanMatcher...)} to order spans root→leaf by following
@@ -84,8 +84,8 @@ void assertTrace(List<DecodedSpan> spans, int traceIndex) {
8484 ordered = chainOrder (spans );
8585 } else {
8686 ordered = new ArrayList <>(spans );
87- if (options .sorter != null ) {
88- ordered .sort (options .sorter );
87+ if (options .comparator != null ) {
88+ ordered .sort (options .comparator );
8989 }
9090 }
9191 for (int i = 0 ; i < spanMatchers .length ; i ++) {
@@ -153,13 +153,12 @@ private static List<DecodedSpan> chainOrder(List<DecodedSpan> spans) {
153153 return ordered ;
154154 }
155155
156- /** Per-trace matching options. */
157156 public static final class Options {
158- Comparator <DecodedSpan > sorter = null ; // null => keep received order
157+ Comparator <DecodedSpan > comparator = null ; // null => keep received order
159158 boolean linearizeByParentChain = false ;
160159
161- public Options sorter (Comparator <DecodedSpan > sorter ) {
162- this .sorter = sorter ;
160+ public Options sort (Comparator <DecodedSpan > comparator ) {
161+ this .comparator = comparator ;
163162 return this ;
164163 }
165164
0 commit comments