Skip to content

Fix JarFile leak in PackageScanner#getClasses#1415

Merged
martin-g merged 2 commits intowicketstuff:masterfrom
iamsanjaymalakar:master
Mar 5, 2026
Merged

Fix JarFile leak in PackageScanner#getClasses#1415
martin-g merged 2 commits intowicketstuff:masterfrom
iamsanjaymalakar:master

Conversation

@iamsanjaymalakar
Copy link
Contributor

Problem

PackageScanner#getClasses() opens JarFile instances when scanning "jar"/"wsjar" resources but never closes them. If scanning or class loading throws, the opened JARs are also left unclosed.

Fix

Close all opened JarFiles in a finally block. The cleanup continues closing remaining JARs even if one close fails, and rethrows the first IOException with subsequent failures added as suppressed exceptions.

@martin-g
Copy link
Member

martin-g commented Mar 5, 2026

Please update to latest master to fix the CI!
I cannot push to your fork.

@iamsanjaymalakar
Copy link
Contributor Author

Please update to latest master to fix the CI! I cannot push to your fork.
@martin-g done.

@martin-g martin-g merged commit fe7211a into wicketstuff:master Mar 5, 2026
1 check passed
@martin-g
Copy link
Member

martin-g commented Mar 5, 2026

Thank you, @iamsanjaymalakar !

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.

3 participants