Is Collections.sort(List) still stable (java 8, 9..)?

Piotr Findeisen piotr.findeisen at
Thu Nov 16 12:49:12 UTC 2017


I just realised the Collections.sort(List) method ceased to be stable as of
Java 8 (sort of).

Although the method's documentation still promises stable sort, the
implementation delegates to List.sort(Comparator) and that interface method
bears no constraint that an implementation must sort stable.

Is "stable" missing from List.sort's documentation?
Or, instead, should it be now no longer promised by Collections.sort? (oh,
Or, what am i missing?

Best regards,

More information about the core-libs-dev mailing list