spring-projects / spring-batch

Spring Batch is a framework for writing batch applications using Java and Spring
http://projects.spring.io/spring-batch/
Apache License 2.0
2.63k stars 2.31k forks source link

Fix SimpleChunkProcessor transform output chunk end property #4561

Closed myanar7 closed 3 months ago

myanar7 commented 3 months ago

This PR closes #4560.

fmbenhassine commented 3 months ago

Thank you for the PR. The change should be applied to FaultTolerantChunkProcessor as well, as it overrides SimpleChunkProcessor#transform.

My concern regarding the edge case mentioned in https://github.com/spring-projects/spring-batch/issues/4560#issuecomment-1983295279 is that it makes the method unreliable. I am not sure there is an obvious way to fix this with the current implementation, but that's probably for another issue.

myanar7 commented 3 months ago

Thank you. The change has been implemented to FaultTolerantChunkProcessor as well.

Additionally, the edge case in Chunk#isEnd has been mentioned in the javadoc of the method. I tried to explain it briefly and clearly, if it's not understandable or too long, please let me know so I can change it.

fmbenhassine commented 3 months ago

Thank you for the update. LGTM 👍 Rebased and merged as a4a8ab7aaa8e3ead006157c08d845acfe9993e85. I just amended a test in FaultTolerantChunkProcessorTests.

Thank you for your contribution!