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

TermComponentIndex sort problem. #57

Open
pengchengluo opened this issue May 26, 2021 · 2 comments
Open

TermComponentIndex sort problem. #57

pengchengluo opened this issue May 26, 2021 · 2 comments

Comments

@pengchengluo
Copy link

Why the getSorted function sorts list of pairs with "(o1, o2) -> o2.first().compareTo(String.valueOf(o1.second()))".
And this cause "java.lang.IllegalArgumentException: Comparison method violates its general contract!"
image

image

@jerrygaoLondon
Copy link
Collaborator

jerrygaoLondon commented May 27, 2021

Issue caused by new java sort algorithm in jdk1.8. will need to be fixed later. Workaround is to pass "-Djava.util.Arrays.useLegacyMergeSort=true" to java/jvm

@pengchengluo
Copy link
Author

@jerrygaoLondon Thank you for your reply. My another question is why the lambda funtion compare o2.first to o1.second. The first element is a string, but the second element is a integer. Is this a logical error?

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

No branches or pull requests

2 participants