ziqizhang / jate

NEWS: JATE2.0 Beta.11 Released, see details below.
GNU Lesser General Public License v3.0
81 stars 29 forks source link

TermComponentIndex sort problem. #57

Open pengchengluo opened 3 years ago

pengchengluo commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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?