Skip to content

Rework getParagraph functions for XWPF#195

Closed
MariusVolkhart wants to merge 2 commits intoapache:trunkfrom
MariusVolkhart:mv/getParagraph
Closed

Rework getParagraph functions for XWPF#195
MariusVolkhart wants to merge 2 commits intoapache:trunkfrom
MariusVolkhart:mv/getParagraph

Conversation

@MariusVolkhart
Copy link
Copy Markdown
Contributor

The implementations all share an interface, so they don't need their own Javadoc, as the Javadoc is automatically inherited.

Also revise the implementation of XWPFDocument#getParagraph(CTP) to be more performant.

Make the documentation generic enough that subclasses don't need to supplement it with their own.
The previous implementation resulted in many allocations due to the repeated calls to getParagraphs(), which returns a new unmodifiable list every time. The implementation was also doing extra work with repeated index fetches.

The new version brings this implementation in line with those found in XWPFTableCell, XWPFHeaderFooter, and XWPFAbstractFootnoteEndnote.
@asfgit asfgit closed this in b8cb440 Nov 14, 2020
@MariusVolkhart MariusVolkhart deleted the mv/getParagraph branch November 14, 2020 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant