Skip to content

Fix ParallelWorldClassLoader#close to close all JarFiles even on failure#752

Open
iamsanjaymalakar wants to merge 1 commit intodragonwell-project:masterfrom
iamsanjaymalakar:master
Open

Fix ParallelWorldClassLoader#close to close all JarFiles even on failure#752
iamsanjaymalakar wants to merge 1 commit intodragonwell-project:masterfrom
iamsanjaymalakar:master

Conversation

@iamsanjaymalakar
Copy link
Copy Markdown

Problem

ParallelWorldClassLoader#close() attempts to close all tracked JarFile instances. it closes them sequentially without handling exceptions. If one close() throws, the method exits immediately and the remaining JarFiles are never closed.

Fix

  • Wrap each jar.close() in a try/catch.
  • Continue closing the remaining streams even after a failure.
  • After attempting all closes, throw the first exception (and attach later ones as suppressed, if present).

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