From c083ff07b4038b05d23ce01adc577a6fea157740 Mon Sep 17 00:00:00 2001 From: robokaso Date: Thu, 29 Jan 2009 13:20:20 +0000 Subject: [PATCH] REOPENED - BATCH-996: use default retryLimit == 1 (not 0) in *StepFactoryBean revert back to default retryLimit == 0 which was actually correct --- .../core/step/item/FaultTolerantStepFactoryBean.java | 8 +++----- .../batch/retry/policy/SimpleRetryPolicy.java | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBean.java index 6fc594091..6549d7ad2 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBean.java @@ -44,7 +44,6 @@ import org.springframework.batch.retry.policy.NeverRetryPolicy; import org.springframework.batch.retry.policy.RetryContextCache; import org.springframework.batch.retry.policy.SimpleRetryPolicy; import org.springframework.batch.support.Classifier; -import org.springframework.util.Assert; /** * Factory bean for step that provides options for configuring skip behaviour. @@ -77,13 +76,13 @@ public class FaultTolerantStepFactoryBean extends SimpleStepFactoryBean extends SimpleStepFactoryBean= 1, "retry limit must be greater or equal to 1"); this.retryLimit = retryLimit; } @@ -219,7 +217,7 @@ public class FaultTolerantStepFactoryBean extends SimpleStepFactoryBean 1 || skipLimit > 0 || retryPolicy != null)) { + if (!(retryLimit > 0 || skipLimit > 0 || retryPolicy != null)) { // zero fault-tolerance, just use the parent's simple config return; } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/policy/SimpleRetryPolicy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/policy/SimpleRetryPolicy.java index ab50b5ade..fff8d0c0c 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/policy/SimpleRetryPolicy.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/policy/SimpleRetryPolicy.java @@ -48,7 +48,7 @@ public class SimpleRetryPolicy implements RetryPolicy { */ public final static int DEFAULT_MAX_ATTEMPTS = 3; - private volatile int maxAttempts = 1; + private volatile int maxAttempts; private BinaryExceptionClassifier retryableClassifier = new BinaryExceptionClassifier();