Skip to content

Commit 0501a87

Browse files
committed
Fix ItemProcessListener#afterProcess call order in ChunkOrientedStep
The javadoc of ItemProcessListener#afterProcess states that this method is still called with a null result, allowing for notification of "filtered" items.
1 parent b980c7a commit 0501a87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/step/item/ChunkOrientedStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,13 @@ private Chunk<O> process(Chunk<I> chunk, StepContribution contribution) throws E
426426
try {
427427
this.compositeItemProcessListener.beforeProcess(item);
428428
O processedItem = doProcess(item);
429-
this.compositeItemProcessListener.afterProcess(item, processedItem);
430429
if (processedItem == null) {
431430
contribution.incrementFilterCount();
432431
}
433432
else {
434433
processedChunk.add(processedItem);
435434
}
435+
this.compositeItemProcessListener.afterProcess(item, processedItem);
436436
}
437437
catch (Exception exception) {
438438
this.compositeItemProcessListener.onProcessError(item, exception);

0 commit comments

Comments
 (0)