Update Javadocs about exception handling when closing composite streams

Related to #4764 and #4750
This commit is contained in:
Mahmoud Ben Hassine
2025-02-24 10:49:07 +01:00
parent f40ab202a0
commit 75edb29d28
3 changed files with 14 additions and 1 deletions

View File

@@ -79,6 +79,12 @@ public class CompositeItemReader<T> implements ItemStreamReader<T> {
}
}
/**
* Close all delegates.
* @throws ItemStreamException thrown if one of the delegates fails to close. Original
* exceptions thrown by delegates are added as suppressed exceptions into this one, in
* the same order as delegates were registered.
*/
@Override
public void close() throws ItemStreamException {
List<Exception> exceptions = new ArrayList<>();

View File

@@ -102,7 +102,8 @@ public class CompositeItemStream implements ItemStream {
/**
* Broadcast the call to close.
* @throws ItemStreamException thrown if one of the {@link ItemStream}s in the list
* fails to close.
* fails to close. Original exceptions thrown by delegates are added as suppressed
* exceptions into this one, in the same order as delegates were registered.
*/
@Override
public void close() throws ItemStreamException {

View File

@@ -105,6 +105,12 @@ public class CompositeItemWriter<T> implements ItemStreamWriter<T>, Initializing
this.delegates = delegates;
}
/**
* Close all delegates.
* @throws ItemStreamException thrown if one of the delegates fails to close. Original
* exceptions thrown by delegates are added as suppressed exceptions into this one, in
* the same order as delegates were registered.
*/
@Override
public void close() throws ItemStreamException {
List<Exception> exceptions = new ArrayList<>();