-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
low
-
-
Java API
-
SE
Summary
Specify the List.sort method to be a stable sort.
Problem
Collections.sort specifies the sort is stable, but it defers to List.sort. This contradicts the specification.
Solution
Specify stability of the sort in List.sort.
Specification
Update the specification on List.sort:
/**
* Sorts this list according to the order induced by the specified
- * {@link Comparator}.
+ * {@link Comparator}. The sort is <i>stable</i>: this method must not
+ * reorder equal elements.
*
* <p>All elements in this list must be <i>mutually comparable</i> using the
* specified comparator (that is, {@code c.compare(e1, e2)} must not throw
- csr of
-
JDK-8191429 List.sort should specify the sort is stable
-
- Resolved
-