sorts the specified list according to the order induced by the specified comparator . all elements in the list must be mutually comparable using the specified comparator that is , c.compare e1 , e2 must not throw a classcastexception for any elements e1 and e2 in the list . this sort is guaranteed to be stable : equal elements will not be reordered as a result of the sort . the sorting algorithm is a modified mergesort in which the merge is omitted if the highest element in the low sublist is less than the lowest element in the high sublist . this algorithm offers guaranteed n log n performance . the specified list must be modifiable , but need not be resizable . this implementation dumps the specified list into an array , sorts the array , and iterates over the list resetting each element from the corresponding position in the array . this avoids the n2 log n performance that would result from attempting to sort a linked list in place . concode_field_sep int REVERSE_THRESHOLD concode_field_sep void swap concode_elem_sep Object[] toArray concode_elem_sep T[] toArray concode_elem_sep void reverse
void function ( List < T > arg0 , Comparator < ? super T > arg1 ) { Object [ ] loc0 = toArray ( arg0 ) ; Arrays . sort ( loc0 , ( Comparator ) arg1 ) ; ListIterator loc1 = arg0 . listIterator ( ) ; for ( int loc2 = 0 ; loc2 < loc0 . length ; loc2 ++ ) { loc1 . next ( ) ; loc1 . set ( loc0 [ loc2 ] ) ; } }