From d794a62ac2ce6fbca9874f7c668e65771df501d6 Mon Sep 17 00:00:00 2001 From: dsyer Date: Thu, 24 Jun 2010 09:32:04 +0000 Subject: [PATCH] BATCH-1582: remove restrictio non step execution aggregator --- .../partition/support/DefaultStepExecutionAggregator.java | 4 ++-- .../support/DefaultStepExecutionAggregatorTests.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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); }