Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Jena 2.10.1, Jena 3.16.0, Jena 4.5.0
-
None
Description
Sorting by labels fail on this data set.
Simple Java example to reproduce attached.
Looks like a race condition involved.
SELECT ?label WHERE { ?object <http://www.w3.org/2000/01/rdf-schema#label> ?label . } ORDER BY ASC(?label)
java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.base/java.util.TimSort.mergeLo(TimSort.java:781) at java.base/java.util.TimSort.mergeAt(TimSort.java:518) at java.base/java.util.TimSort.mergeCollapse(TimSort.java:448) at java.base/java.util.TimSort.sort(TimSort.java:245) at java.base/java.util.Arrays.sort(Arrays.java:1441) at org.apache.jena.atlas.data.AbortableComparator.abortableSort(AbortableComparator.java:57) at org.apache.jena.atlas.data.SortedDataBag.iterator(SortedDataBag.java:205) at org.apache.jena.atlas.data.SortedDataBag.iterator(SortedDataBag.java:192) at org.apache.jena.sparql.engine.iterator.QueryIterSort$SortedBindingIterator.initializeIterator(QueryIterSort.java:88) at org.apache.jena.atlas.iterator.IteratorDelayedInitialization.init(IteratorDelayedInitialization.java:38) at org.apache.jena.atlas.iterator.IteratorDelayedInitialization.hasNext(IteratorDelayedInitialization.java:48) at org.apache.jena.sparql.engine.iterator.QueryIterPlainWrapper.hasNextBinding(QueryIterPlainWrapper.java:59) at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114) at org.apache.jena.sparql.engine.iterator.QueryIterConvert.hasNextBinding(QueryIterConvert.java:58) at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114) at org.apache.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:38) at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114) at org.apache.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:38) at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114) at org.apache.jena.sparql.exec.RowSetStream.hasNext(RowSetStream.java:47) at org.apache.jena.sparql.engine.ResultSetStream.hasNext(ResultSetStream.java:81) at test.SortingBug.isReproduced(SortingBug.java:53) at test.SortingBug.main(SortingBug.java:39)