java.lang.IllegalArgumentException: Comparison method violates its general contract!


Solutions on the web50

Solution icon of github
Comparison method violates its general contract!

Solution icon of github
via GitHub by jaredlll08
, 11 months ago
Comparison method violates its general contract!

Solution icon of github
Comparison method violates its general contract!

Solution icon of github
Comparison method violates its general contract!

Solution icon of github
via GitHub by hurzl
, 1 year ago
Comparison method violates its general contract!

Solution icon of github
Comparison method violates its general contract!

Solution icon of github
Comparison method violates its general contract!

Solution icon of github
Comparison method violates its general contract!

Solution icon of github
Comparison method violates its general contract!

Solution icon of github
via GitHub by Osfognarg
, 1 year ago
Comparison method violates its general contract!

Stack trace

java.lang.IllegalArgumentException: Comparison method violates its general contract!
	at java.util.ComparableTimSort.mergeLo(ComparableTimSort.java:744)
	at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:481)
	at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:406)
	at java.util.ComparableTimSort.sort(ComparableTimSort.java:213)
	at java.util.Arrays.sort(Arrays.java:1312)
	at java.util.Arrays.sort(Arrays.java:1506)
	at java.util.ArrayList.sort(ArrayList.java:1454)
	at java.util.Collections.sort(Collections.java:141)
	at Main.main(Main.java:23)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 weeks ago
Samebug visitor profile picture
Unknown user
Once, 7 months ago
Samebug visitor profile picture
Unknown user
Once, 9 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
13 more bugmates