History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2796
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: AlSt
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

Changes sorting fails (again)

Created: 31/Aug/16 09:14 AM   Updated: 03/Sep/16 01:43 PM
Component/s: None
Affects Version/s: 5.1.40
Fix Version/s: 6.1.24

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
Builds requests can not be processed because of this exception:

jvm 1 | java.lang.IllegalArgumentException: Comparison method violates its general contract!
jvm 1 | at java.util.ComparableTimSort.mergeLo(ComparableTimSort.java:714)
jvm 1 | at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:451)
jvm 1 | at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:376)
jvm 1 | at java.util.ComparableTimSort.sort(ComparableTimSort.java:182)
jvm 1 | at java.util.ComparableTimSort.sort(ComparableTimSort.java:146)
jvm 1 | at java.util.Arrays.sort(Arrays.java:472)
jvm 1 | at java.util.Collections.sort(Collections.java:155)
jvm 1 | at com.pmease.quickbuild.model.Build.getChanges(Build.java:621)
jvm 1 | at com.pmease.quickbuild.plugin.tracker.core.contribution.IssuesBuildListener.buildFinished(IssuesBuildListener.java:45)
jvm 1 | at com.pmease.quickbuild.DefaultBuildEngine.run(DefaultBuildEngine.java:660)
jvm 1 | at com.pmease.quickbuild.DefaultBuildEngine.process(DefaultBuildEngine.java:383)
jvm 1 | at com.pmease.quickbuild.DefaultBuildEngine.access$000(DefaultBuildEngine.java:131)
jvm 1 | at com.pmease.quickbuild.DefaultBuildEngine$2.run(DefaultBuildEngine.java:1076)
jvm 1 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
jvm 1 | at java.util.concurrent.FutureTask.run(FutureTask.java:262)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
jvm 1 | at java.lang.Thread.run(Thread.java:745)

When looking at ChangeSet.compareTo(ChangeSet) the problem can be seen pretty fast:

@Override
public int compareTo(Changeset other) {
if (getDate() == null)
return 1;
else if (other.getDate() == null)
return -1;
else
return other.getDate().compareTo(getDate());
}

When both changeset dates are null they are not considered equal, so the transitivity is not satisfied.

 All   Comments   Work Log   Change History      Sort Order:
Robin Shen [03/Sep/16 03:08 AM]
Thanks for the info. This will be fixed in QB 6.1.24.

AlSt [31/Aug/16 09:18 AM]
I cloned the issue and thought I would be able to change the description. So now here is more information:
Affected version 6.1.22

Stack trace:
java.lang.IllegalArgumentException: Comparison method violates its general contract!
        at java.util.ComparableTimSort.mergeLo(ComparableTimSort.java:744)
        at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:481)
        at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:406)
        at java.util.ComparableTimSort.sort(ComparableTimSort.java:213)
        at java.util.Arrays.sort(Arrays.java:1312)
        at java.util.Arrays.sort(Arrays.java:1506)
        at java.util.ArrayList.sort(ArrayList.java:1454)
        at java.util.Collections.sort(Collections.java:141)
        at com.pmease.quickbuild.model.Build.getChanges(Build.java:621)
        at com.pmease.quickbuild.model.Build.getCommitters(Build.java:750)
        at sun.reflect.GeneratedMethodAccessor737.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.velocity.runtime.parser.node.PropertyExecutor.execute(PropertyExecutor.java:142)
        at org.apache.velocity.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:539)
        at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:198)
        ... 25 more

AlSt [31/Aug/16 09:15 AM]
I saw the same issue yesterday in BuildChangeset.