diff --git a/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java b/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java index f4ee38938..573eb4bfd 100644 --- a/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java +++ b/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java @@ -157,7 +157,6 @@ public class SimpleStepExecutor implements StepExecutor { Assert.notNull(step); final Tasklet module = configuration.getTasklet(); - step.setStepExecution(stepExecution); ExitStatus status = ExitStatus.FAILED; diff --git a/execution/src/test/java/org/springframework/batch/execution/step/simple/DefaultStepExecutorTests.java b/execution/src/test/java/org/springframework/batch/execution/step/simple/DefaultStepExecutorTests.java index 9c8e95185..05c878ad1 100644 --- a/execution/src/test/java/org/springframework/batch/execution/step/simple/DefaultStepExecutorTests.java +++ b/execution/src/test/java/org/springframework/batch/execution/step/simple/DefaultStepExecutorTests.java @@ -118,7 +118,6 @@ public class DefaultStepExecutorTests extends TestCase { SimpleJobIdentifier jobIdentifier = new SimpleJobIdentifier("FOO"); JobExecution jobExecution = new JobExecution(new JobInstance( jobIdentifier, new Long(1))); - step.setStepExecution(new StepExecution(step, jobExecution)); StepExecution stepExecution = new StepExecution(step, jobExecution); stepExecutor.processChunk(stepConfiguration, stepExecution); @@ -138,7 +137,6 @@ public class DefaultStepExecutorTests extends TestCase { SimpleJobIdentifier jobIdentifier = new SimpleJobIdentifier("FOO"); final JobExecution jobExecution = new JobExecution(new JobInstance( jobIdentifier, new Long(3))); - step.setStepExecution(new StepExecution(step, jobExecution)); final StepExecution stepExecution = new StepExecution(step, jobExecution); @@ -204,8 +202,7 @@ public class DefaultStepExecutorTests extends TestCase { try { stepExecutor.process(stepConfiguration, stepExecution); } catch (Exception ex) { - assertEquals(step.getStepExecution().getRollbackCount(), - new Integer(1)); + assertEquals(stepExecution.getRollbackCount(), new Integer(1)); } } @@ -240,7 +237,7 @@ public class DefaultStepExecutorTests extends TestCase { } catch (Exception ex) { assertEquals(new ExitStatus(false, ExitCodeExceptionClassifier.FATAL_EXCEPTION, - "java.lang.RuntimeException"), step.getStepExecution() + "java.lang.RuntimeException"), stepExecution .getExitStatus()); } }