This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 226100 - IllegalArgumentException: Comparison method violates its general contract!
Summary: IllegalArgumentException: Comparison method violates its general contract!
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
: 230698 231488 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-02-14 07:17 UTC by abien
Modified: 2014-01-26 02:16 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 198592


Attachments
stacktrace (7.31 KB, text/plain)
2013-02-14 07:17 UTC, abien
Details

Note You need to log in before you can comment on or make changes to this bug.
Description abien 2013-02-14 07:17:22 UTC
This bug was originally marked as duplicate of bug 220248, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.3 RC2 (Build 201302050851)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_13-b20
OS: Mac OS X

User Comments:
abien: Happend during "add dependency" in a pom.xml and searching for juni




Stacktrace: 
java.lang.IllegalArgumentException: Comparison method violates its general contract!
   at java.util.ComparableTimSort.mergeHi(ComparableTimSort.java:835)
   at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:453)
   at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:376)
   at java.util.ComparableTimSort.sort(ComparableTimSort.java:182)
   at java.util.ComparableTimSort.sort(ComparableTimSort.java:146)
   at java.util.Arrays.sort(Arrays.java:472)
Comment 1 abien 2013-02-14 07:17:25 UTC
Created attachment 131375 [details]
stacktrace
Comment 2 Milos Kleint 2013-02-21 14:40:34 UTC
https://jira.codehaus.org/browse/MPIR-247 could be related, my current thinking is that the error surfaces at some yet unknown times in org.apache.maven.artifact.versioning.ComparableVersion that we are using for comparing the versions properly
Comment 3 Milos Kleint 2013-06-04 05:12:27 UTC
*** Bug 230698 has been marked as a duplicate of this bug. ***
Comment 4 Milos Kleint 2013-06-19 06:48:57 UTC
*** Bug 231488 has been marked as a duplicate of this bug. ***
Comment 5 Exceptions Reporter 2013-06-30 16:12:03 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=198592
Comment 6 Milos Kleint 2013-07-01 11:21:23 UTC
http://hg.netbeans.org/core-main/rev/7c3aee67814e
adds more logging - lists all versions so that we at least can write a testcase with given version numbers to reproduce the issue.

at the same time, we rethrow the exception only when in early access mode (dev builds and betas) and ignore (log only) in releases. That means the results will be unsorted when the issue is encountered in release builds.

closing as fixed, but I expect to reopen the issue when the new exception with additional logging appears.
Comment 7 Quality Engineering 2013-07-02 02:15:30 UTC
Integrated into 'main-silver', will be available in build *201307012300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/7c3aee67814e
User: Milos Kleint <mkleint@netbeans.org>
Log: #226100 log version numbers used when sorting, only rethrow the exception in -ea builds, in final ones, just keep the list unsorted/half-sorted
Comment 8 Quality Engineering 2014-01-24 02:39:10 UTC
Integrated into 'main-silver', will be available in build *201401240001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/459d48e8853f
User: Milos Kleint <mkleint@netbeans.org>
Log: #240845, #226100 apparently returning -1 * ComparableVersion.compareTo() is responsible for the IllegalArgumentException coming from the sort algorithm on 1.7.  Experimentally verified with help of provided versions that keeping the low-to-high version ordering is not causing trouble. I suspect that some other result set might though.

As a result, versions are now sorted in opposite way than they used to.
Comment 9 Milos Kleint 2014-01-24 07:09:42 UTC
thanks to jhavlin we have a reproducible testcase that I can file upstream - https://jira.codehaus.org/browse/MNG-5568

I'm going to revert the 459d48e8853f changeset and will remove the exception being logged with asserts
Comment 10 Quality Engineering 2014-01-26 02:16:53 UTC
Integrated into 'main-silver', will be available in build *201401260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/05bfed97ef39
User: Milos Kleint <mkleint@netbeans.org>
Log: #240845, #226100 thanks to jhavlin we now have a reproducible testcase to file upstream, disabling the assert + reverting to -c for version comparisons