diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/support/RetryTemplate.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/support/RetryTemplate.java index 2064d94e0..1f8e71494 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/support/RetryTemplate.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/support/RetryTemplate.java @@ -111,7 +111,7 @@ public class RetryTemplate implements RetryOperations { } /** - * Keep executing the callback until it eiether succeeds or the policy + * Keep executing the callback until it either succeeds or the policy * dictates that we stop, in which case the most recent exception thrown by * the callback will be rethrown. * @@ -158,7 +158,7 @@ public class RetryTemplate implements RetryOperations { * external retry to allow a recovery in handleRetryExhausted * without the callback processing (which would throw an exception). */ - while (retryPolicy.canRetry(context) && !isMarkedExhausted(context)) { + while (retryPolicy.canRetry(context) && !context.isExhaustedOnly()) { try { logger.debug("Retry: count=" + context.getRetryCount()); @@ -211,15 +211,6 @@ public class RetryTemplate implements RetryOperations { } } - /** - * Check if client has marked the context to end the retry attempts. - * @param context - * @return - */ - private boolean isMarkedExhausted(RetryContext context) { - return context.isExhaustedOnly(); - } - private boolean doOpenInterceptors(RetryCallback callback, RetryContext context) { boolean result = true;