From 926fcf9ac005d0e6de4dbccdfdba8537475b3bc8 Mon Sep 17 00:00:00 2001 From: dsyer Date: Fri, 13 Aug 2010 08:26:47 +0000 Subject: [PATCH] BATCH-1616: changed semantics of PartitionNameProvider to revert to old (2.1.0) behaviour on restart --- .../support/SimpleStepExecutionSplitter.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitter.java index 9a81c766b..828f0176c 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitter.java @@ -191,22 +191,21 @@ public class SimpleStepExecutionSplitter implements StepExecutionSplitter, Initi result = partitioner.partition(splitSize); } else { - /* - * We need to return the same keys as the original (failed) - * execution, but the execution contexts will be discarded so they - * can be empty. - */ if (partitioner instanceof PartitionNameProvider) { result = new HashMap(); Collection names = ((PartitionNameProvider) partitioner).getPartitionNames(splitSize); for (String name : names) { + /* + * We need to return the same keys as the original (failed) + * execution, but the execution contexts will be discarded + * so they can be empty. + */ result.put(name, new ExecutionContext()); } } else { - // If no names are provided, assume they follow the default - // pattern. - result = new SimplePartitioner().partition(splitSize); + // If no names are provided, grab the partition again. + result = partitioner.partition(splitSize); } }