Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error - java.lang.IllegalArgumentException: Comparison method violates its general contract! #2123

Open
PriyankaKeer opened this issue Mar 5, 2021 · 1 comment

Comments

@PriyankaKeer
Copy link

@PriyankaKeer PriyankaKeer commented Mar 5, 2021

Hi Team,

Getting below error in Junit testcase for comparator.

Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeHi(TimSort.java:899)
at java.util.TimSort.mergeAt(TimSort.java:516)
at java.util.TimSort.mergeForceCollapse(TimSort.java:457)
at java.util.TimSort.sort(TimSort.java:254)
at java.util.Arrays.sort(Arrays.java:1438)
at java.util.List.sort(List.java:478)
at java.util.Collections.sort(Collections.java:175)

While using below VM argument, it is working fine - For JDK 1.8.
-Djava.util.Arrays.useLegacyMergeSort=true

But the same is failing in Open JDK 1.8.

Thanks in Advance!

@estevamdf2
Copy link

@estevamdf2 estevamdf2 commented May 28, 2021

How can i do repeat this test @PriyankaKeer ?
@lucas85cunha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants