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

Summary: IllegalArgumentException: Comparison method violates its general contract!
Product: projects Reporter: markiewb
Component: MavenAssignee: Milos Kleint <mkleint>
Status: RESOLVED FIXED    
Severity: normal CC: mpetras
Priority: P3    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 195275
Attachments: stacktrace

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. ***