这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@effad
Copy link
Contributor

@effad effad commented Aug 28, 2025

This PR improved PDFBoxDocument by removing the need for synchronized methods:

  • getNumberOfPages and isLandscape delivered pre-computed information
  • renderPage will be the only method that accesses the PDDocument. It is always called from the service, thus no multi-threading problems
  • close will only be called once, so synchronized was never really needed here.

It also fixed the (minor) resource leak in com.dlsc.pdfviewfx.PDFBoxDocument.getSearchResults(String) by closing the PDDocument created for searching.

It does not fix the (minor) resource leak in com.dlsc.pdfviewfx.PDFBoxDocument.getPageable(), this should / will be handled as Issue #30.

It also removes the need to work around the initialisation problems found in Issue #25. Since there are no synchronized methods anymore, the Mac JDK will no longer hang. Thus the PR also removes the workaround.

It also includes some minor cleanup (unneeded imports removed)

@dlemmermann dlemmermann merged commit f21e766 into dlsc-software-consulting-gmbh:master Aug 29, 2025
1 check failed
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.

2 participants