[jira] [Commented] (ISIS-3315) 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=17650012#comment-17650012 ] Miroslav Holubec commented on ISIS-3315: btw. I was able to fix this by adding {noformat} if (qPojo == null) { return 1; } else if (pPojo == null) { return -1; } {noformat} after {noformat} if (Objects.equals(pPojo, qPojo)) { return 0; } {noformat} > 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 >Priority: Major > > 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.(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)
[jira] [Commented] (ISIS-3315) 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=17650191#comment-17650191 ] Andi Huber commented on ISIS-3315: -- It seems we already fixed this one: https://github.com/apache/isis/commit/ecb6676879f894da2da0dd3240e47ffecccd704d > 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.(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)