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 222286 - 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:
: 223492 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-16 16:08 UTC by markiewb
Modified: 2012-12-10 09:08 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 195275


Attachments
stacktrace (9.04 KB, text/plain)
2012-11-16 16:08 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2012-11-16 16:08:07 UTC
Build: NetBeans IDE Dev (Build 201211050001)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.5-b02, Java(TM) SE Runtime Environment, 1.7.0_09-b05
OS: Windows 7

User Comments:
markiewb: Searching in add library




Stacktrace: 
java.lang.IllegalArgumentException: Comparison method violates its general contract!
   at java.util.ComparableTimSort.mergeLo(ComparableTimSort.java:714)
   at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:451)
   at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:374)
   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 markiewb 2012-11-16 16:08:09 UTC
Created attachment 127948 [details]
stacktrace
Comment 2 Milos Kleint 2012-11-19 12:15:39 UTC
this issue is related to issue 220248, which most likely was integrated before build 201211050001 and should be therefore part of it.

the only remaining difference between equals and compare method was the version field which was processed through ComparableVersion in compare(). now equals() and hashcode() do the same.
http://hg.netbeans.org/core-main/rev/dec3d963eb5e

I can only imagine it failing in the case when 2 instances were only differing in the version field and the version name pattern in the first one was RELEASE.6.0.1 and in the other one RELEASE601.
Comment 3 Quality Engineering 2012-11-21 13:47:17 UTC
Integrated into 'main-golden', will be available in build *201211211016* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/dec3d963eb5e
User: Milos Kleint <mkleint@netbeans.org>
Log: #222286 make sure equals+hashcode use exactly the same fields as compare
Comment 4 Milos Kleint 2012-12-10 09:08:32 UTC
*** Bug 223492 has been marked as a duplicate of this bug. ***