diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java index e1328dd62..b03dcbc90 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java @@ -45,8 +45,8 @@ public class DefaultStepExecutionAggregator implements StepExecutionAggregator { */ public void aggregate(StepExecution result, Collection executions) { Assert.notNull(result, "To aggregate into a result it must be non-null."); - if (executions == null || executions.isEmpty()) { - throw new IllegalArgumentException("Cannot aggregate empty or null executions: " + executions); + if (executions == null) { + return; } for (StepExecution stepExecution : executions) { BatchStatus status = stepExecution.getStatus(); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregatorTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregatorTests.java index f8f76e6c7..3111f7d3b 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregatorTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregatorTests.java @@ -24,12 +24,12 @@ public class DefaultStepExecutionAggregatorTests { private StepExecution stepExecution2 = jobExecution.createStepExecution("foo:2"); - @Test(expected = IllegalArgumentException.class) + @Test public void testAggregateEmpty() { aggregator.aggregate(result, Collections. emptySet()); } - @Test(expected = IllegalArgumentException.class) + @Test public void testAggregateNull() { aggregator.aggregate(result, null); }