From 246b1a61b687ae596fd7336d98882e50eb7c79eb Mon Sep 17 00:00:00 2001 From: dhgarrette Date: Mon, 30 Mar 2009 14:29:19 +0000 Subject: [PATCH] BATCH-1183: Implement toString() on Step implementations --- .../batch/core/configuration/xml/DelegatingStep.java | 4 ++++ .../org/springframework/batch/core/step/AbstractStep.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/DelegatingStep.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/DelegatingStep.java index 02e52af42..46f9029c1 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/DelegatingStep.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/DelegatingStep.java @@ -19,6 +19,7 @@ package org.springframework.batch.core.configuration.xml; import org.springframework.batch.core.JobInterruptedException; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; +import org.springframework.util.ClassUtils; /** * Class used for delegating from a definition to an individual bean @@ -61,4 +62,7 @@ public class DelegatingStep implements Step { return delegate.isAllowStartIfComplete(); } + public String toString() { + return ClassUtils.getShortName(getClass()) + ": [name=" + name + "]"; + } } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java index af45821b3..0762ade04 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java @@ -38,6 +38,7 @@ import org.springframework.batch.repeat.RepeatException; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; +import org.springframework.util.ClassUtils; /** * A {@link Step} implementation that provides common behavior to subclasses, @@ -318,6 +319,10 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw return jobRepository; } + public String toString() { + return ClassUtils.getShortName(getClass()) + ": [name=" + name + "]"; + } + /** * Default mapping from throwable to {@link ExitStatus}. Clients can modify * the exit code using a {@link StepExecutionListener}.