You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2023/01/03 08:39:00 UTC

[jira] [Commented] (ISIS-3315) [Duplicate] Apache Isis sorting fails with: Comparison method violates its general contract!

    [ https://issues.apache.org/jira/browse/ISIS-3315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17653864#comment-17653864 ] 

ASF subversion and git services commented on ISIS-3315:
-------------------------------------------------------

Commit 2763905841c9584ca98fbe0b3d2bcbad70d518fa in isis's branch refs/heads/ISIS-3255 from Andi Huber
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=2763905841 ]

ISIS-3315: adds test-case for ManagedObjects.NATURAL_NULL_FIRST
comparator

> [Duplicate] Apache Isis sorting fails with: Comparison method violates its general contract!
> --------------------------------------------------------------------------------------------
>
>                 Key: ISIS-3315
>                 URL: https://issues.apache.org/jira/browse/ISIS-3315
>             Project: Isis
>          Issue Type: Bug
>          Components: Isis Core
>    Affects Versions: 2.0.0-M7
>         Environment: OpenJDK 64-Bit Server VM (build 18.0.2.1+1-1, mixed mode, sharing)
> OpenJDK 64-Bit Server VM Temurin-18+36 (build 18+36, mixed mode, sharing)
>            Reporter: Miroslav Holubec
>            Assignee: Andi Huber
>            Priority: Major
>             Fix For: 2.0.0-RC1
>
>
> Apache ISIS own comparator fails with IllegalArgumentException sorting our data. I've created a [sample snippet|https://gist.github.com/myroch/c26b97ec83e9168176e43b2ced4f9a08] to proof this.
> The comparator used in the snippet is that one from ManagedObjects.NATURAL_NULL_FIRST, I've just put for simplicity the complexity of ManagedObject away.
> Occured on 2.0.0-M7, but as I checked the code this affects propably all 2.0.0 versions
> Stacktrace:
> {noformat}
> Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
> 	at java.util.TimSort.mergeLo(TimSort.java:781) ~[?:?]
> 	at java.util.TimSort.mergeAt(TimSort.java:518) ~[?:?]
> 	at java.util.TimSort.mergeCollapse(TimSort.java:448) ~[?:?]
> 	at java.util.TimSort.sort(TimSort.java:245) ~[?:?]
> 	at java.util.Arrays.sort(Arrays.java:1307) ~[?:?]
> 	at java.util.ArrayList.sort(ArrayList.java:1721) ~[?:?]
> 	at org.apache.isis.commons.collections.Can_Multiple.sorted(Can_Multiple.java:121) ~[isis-commons-2.0.0-M7.jar:2.0.0-M7]
> 	at org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.CollectionContentsSortableDataProvider.sorted(CollectionContentsSortableDataProvider.java:83) ~[isis-viewer-wicket-ui-2.0.0-M7.jar:2.0.0-M7]
> 	at org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.CollectionContentsSortableDataProvider.iterator(CollectionContentsSortableDataProvider.java:73) ~[isis-viewer-wicket-ui-2.0.0-M7.jar:2.0.0-M7]
> 	at org.apache.wicket.markup.repeater.data.DataViewBase$ModelIterator.<init>(DataViewBase.java:107) ~[wicket-core-8.13.0.jar:8.13.0]
> 	at org.apache.wicket.markup.repeater.data.DataViewBase.getItemModels(DataViewBase.java:74) ~[wicket-core-8.13.0.jar:8.13.0]
> 	at org.apache.wicket.markup.repeater.AbstractPageableView.getItemModels(AbstractPageableView.java:99) ~[wicket-core-8.13.0.jar:8.13.0]
> 	at org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:93) ~[wicket-core-8.13.0.jar:8.13.0]
> 	at org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124) ~[wicket-core-8.13.0.jar:8.13.0]
> 	at org.apache.wicket.markup.repeater.AbstractPageableView.onBeforeRender(AbstractPageableView.java:113) ~[wicket-core-8.13.0.jar:8.13.0]
> 	at org.apache.wicket.Component.beforeRender(Component.java:947) ~[wicket-core-8.13.0.jar:8.13.0]
> 	at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1741) ~[wicket-core-8.13.0.jar:8.13.0]
> 	... 107 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)