From e02357492219c118e69ebff4e941a66f08abc390 Mon Sep 17 00:00:00 2001 From: robokaso Date: Wed, 2 Apr 2008 14:52:30 +0000 Subject: [PATCH] RESOLVED - issue BATCH-547: confusing ItemWriterRetryCallback#doWithRetry inlined the process(..) method body - it was trivial and used in one place only --- .../batch/retry/callback/ItemWriterRetryCallback.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/callback/ItemWriterRetryCallback.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/callback/ItemWriterRetryCallback.java index c63f7db8c..0fe8044e0 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/callback/ItemWriterRetryCallback.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/callback/ItemWriterRetryCallback.java @@ -105,7 +105,9 @@ public class ItemWriterRetryCallback implements RetryCallback { public Object doWithRetry(RetryContext context) throws Throwable { // This requires a collaboration with the RetryPolicy... if (!context.isExhaustedOnly()) { - process(context); + if (item != null) { + writer.write(item); + } return null; } throw new RetryException("Recovery path requested in retry callback."); @@ -115,13 +117,6 @@ public class ItemWriterRetryCallback implements RetryCallback { return item; } - private Object process(RetryContext context) throws Exception { - if (item != null) { - writer.write(item); - } - return item; - } - /** * Accessor for the {@link ItemRecoverer}. If the handler is null but the * {@link ItemWriter} is an instance of {@link ItemRecoverer}, then it will