[
https://issues.apache.org/jira/browse/IO-782?focusedWorklogId=815043&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-815043
]
ASF GitHub Bot logged work on IO-782:
-------------------------------------
Author: ASF GitHub Bot
Created on: 09/Oct/22 15:13
Start Date: 09/Oct/22 15:13
Worklog Time Spent: 10m
Work Description: garydgregory commented on code in PR #391:
URL: https://github.com/apache/commons-io/pull/391#discussion_r990801082
##########
src/main/java/org/apache/commons/io/input/SequenceReader.java:
##########
@@ -60,8 +65,26 @@ public SequenceReader(final Reader... readers) {
*/
@Override
public void close() throws IOException {
+ if (readersIterable == null) {
+ // already closed
+ return;
+ }
+
+ final List<IOException> ioExceptionList = new ArrayList<>();
+ for (Reader reader : readersIterable) {
+ try {
+ reader.close();
+ } catch (IOException e) {
+ ioExceptionList.add(e);
Review Comment:
I'm not sure about the semantics here, which are completely different from
`SequenceInputStream`. For good or bad, I think it would be better for the
closing logic of this class to match `SequenceInputStream`.
Issue Time Tracking
-------------------
Worklog Id: (was: 815043)
Time Spent: 1h 10m (was: 1h)
> SequenceReader should close readers when its close method is called
> -------------------------------------------------------------------
>
> Key: IO-782
> URL: https://issues.apache.org/jira/browse/IO-782
> Project: Commons IO
> Issue Type: Bug
> Components: Streams/Writers
> Affects Versions: 2.11.0
> Reporter: matteodg
> Priority: Major
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> {{SequenceReader.close()}} method should close readers.
> This is to be compliant with common practice of any {{Reader}} decorator,
> like for example {{BufferedReader}} is doing.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)