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.flor...@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-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org