SpringSource/spring-batch — pull request #125 by ddebree (2013-02-20 09:55:29+00:00)
Title:  BATCH-1969: List should be final in CompositeItemStream

The composite support classes all include a list of items that get processed within a loop.
In the CompositeItemStream this list is used in a synchronized code section. This list should be declared final to avoid any potential threading issues.
Also, since the setStreams method uses the Arrays.asList any changes made to array after the method call (potentially in another thread) will affect the list and thus bypass any thread protection we have put in place. To avoid this, we now use the addAll function that copies the contents of the array into the list, and so the list and the array are now separated.
Similar code is also found in the CompositeItemProcessor and CompositeItemWriter classes, so I have made similar modification in all three classes.