Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-3315

[Duplicate] Apache Isis sorting fails with: Comparison method violates its general contract!

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.0-M7
    • 2.0.0-RC1
    • Core
    • None
    • 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)

    Description

      Apache ISIS own comparator fails with IllegalArgumentException sorting our data. I've created a sample snippet 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:

      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
      

      Attachments

        Issue Links

          Activity

            People

              hobrom Andi Huber
              myroch Miroslav Holubec
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: