Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ConcurrentModificationException by modifying resources outside the iteration. #1719

Conversation

PingLin8888
Copy link
Contributor

Description

When removing images from this file:
The 'Sift' strategy_ A four-step method for spotting misinformation.pdf
, a ConcurrentModificationException occurs.
Fixed the problem by

  • Changed to use a list to collect XObject names before removal.
  • Avoids ConcurrentModificationException by modifying resources outside the iteration.

Checklist:

  • I have read the Contribution Guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

Contributor License Agreement

By submitting this pull request, I acknowledge and agree that my contributions will be included in Stirling-PDF and that they can be relicensed in the future under the MPL 2.0 (Mozilla Public License Version 2.0) license.

(This does not change the general open-source nature of Stirling-PDF, simply moving from one license to another license)

- Changed  to use a list to collect XObject names before removal.
- Avoids ConcurrentModificationException by modifying resources outside the iteration.
@PingLin8888 PingLin8888 requested a review from Frooodle as a code owner August 19, 2024 15:40
@github-actions github-actions bot added the Java Pull requests that update Java code label Aug 19, 2024
@Frooodle Frooodle merged commit fa0152a into Stirling-Tools:main Aug 19, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java Pull requests that update Java code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants