Skip to content

Fix ConcatReader.close() to close all readers on failure#490

Open
iamsanjaymalakar wants to merge 1 commit intoSuperMonster003:masterfrom
iamsanjaymalakar:master
Open

Fix ConcatReader.close() to close all readers on failure#490
iamsanjaymalakar wants to merge 1 commit intoSuperMonster003:masterfrom
iamsanjaymalakar:master

Conversation

@iamsanjaymalakar
Copy link

This PR makes ConcatReader.close() exception-safe in both com.stardust.io.ConcatReader and org.autojs.autojs.io.ConcatReader.

Problem
If closing one underlying Reader throws an IOException, close() exits early and the remaining readers are never closed.

Fix
Close all readers in the queue, collect the first IOException, suppress subsequent close failures, and throw after cleanup is complete.

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