[
https://issues.apache.org/jira/browse/PDFBOX-2996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15028497#comment-15028497
]
Lars Torunski commented on PDFBOX-2996:
---------------------------------------
Hopefully that helps to fix the problem.
But my current assumption is that my QuickSort and the quicksort.patch won't
work, because the TextPositionComparator is not transitive PDFBOX-1512 and we
are using a not stable sorting algorithm.
See https://en.wikipedia.org/wiki/Sorting_algorithm#Stability
"In efficient implementations it is not a stable sort, meaning that the
relative order of equal sort items is not preserved."
See https://en.wikipedia.org/wiki/Quicksort
In legacy merge sort in Java 6 is maybe stable and the PDFBOX-1512 problem
won't show up.
"Most implementations produce a stable sort, which means that the
implementation preserves the input order of equal elements in the sorted
output."
See https://en.wikipedia.org/wiki/Merge_sort
Hence if the assumed fix of the quicksort.patch won't work and I can't fix my
quicksort with the file PDFBOX-3110-poems-beads.pdf, someone should adapt the
legacy mergesort of Java 6.
> StackOverflow in Quicksort
> --------------------------
>
> Key: PDFBOX-2996
> URL: https://issues.apache.org/jira/browse/PDFBOX-2996
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 1.8.10, 2.0.0
> Environment: Java 7
> Reporter: Manuel Aristaran
> Attachments: 001991.pdf, QuickSort.java,
> artikel1_20_arab.pdf-sorted-diff.txt, artikel1_20_arab.pdf-sorted-iter.txt,
> artikel1_20_arab.pdf-sorted-rekur.txt, failing_sort.pdf, quicksort.patch
>
>
> Running PDFTextStripper through ExtractText triggers a StackOverflow
> exception in the QuickSort implementation for [this particular
> document|https://www.dropbox.com/s/6crie7y5gqadwa5/1.pdf?dl=0].
> To reproduce: {{java -jar pdfbox-app-1.8.11-SNAPSHOT.jar ExtractText -sort
> failing_sort.pdf}}
> (Related to PDFBOX-1512)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]