You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2018/05/27 10:40:40 UTC

[Bug 62412] New: XWPFParagraph.searchText returns null although the paragraph contains the searched value

https://bz.apache.org/bugzilla/show_bug.cgi?id=62412

            Bug ID: 62412
           Summary: XWPFParagraph.searchText returns null although the
                    paragraph contains the searched value
           Product: POI
           Version: 3.17-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XWPF
          Assignee: dev@poi.apache.org
          Reporter: sommer.florian@gmx.de
  Target Milestone: ---

The current Implementation of XWPFParagraph.searchText(...) is basically a
buggy version of the KMP Algorithm to search text
(https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm)

Example:
Searched = "yoyoPlayer"
Text = "yoyoyoPlayer"
Result = null, expected = found at beginChar=2

The testcase, a lengthy explanation of the bug's cause and the fix are provided
in this repo:

https://github.com/fsomme2s/apache-poi-bug57727

Go to test class 'YoyoPlayerTest' (test folder).
The fix is provided in class 'FixedParagraphSearchText' (main folder)

Note: In a second test case I also demonstrate the bug 57727, which is also
fixed in the FixedParagraphSearchText class. Sorry for the mess

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 62412] XWPFParagraph.searchText returns null although the paragraph contains the searched value

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62412

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
Some existing test-cases are failing with this applied, so it seems to need
some more work to work for those cases as well.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org