-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
has: backportsLegacy label from JIRA. Superseded by "for: backport-to-x.x.x"Legacy label from JIRA. Superseded by "for: backport-to-x.x.x"in: coretype: enhancement
Milestone
Description
Kui Liu opened BATCH-2715 and commented
The following method is named as "getStartable". "getStartable" is prone to obtain something. "isStartable" is a query asking whether the stepExecution is startable, which describes what the method is doning. So, "isStartable" should be more intuitive.
protected boolean getStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException {
JobInstance jobInstance = stepExecution.getJobExecution().getJobInstance();
String stepName = stepExecution.getStepName();
StepExecution lastStepExecution = jobRepository.getLastStepExecution(jobInstance, stepName);
boolean isRestart = (lastStepExecution != null && lastStepExecution.getStatus() != BatchStatus.COMPLETED);
if (isRestart) {
stepExecution.setExecutionContext(lastStepExecution.getExecutionContext());
}
else {
stepExecution.setExecutionContext(context);
}
return shouldStart(allowStartIfComplete, stepExecution, lastStepExecution) || isRestart;
}
Affects: 4.0.1
Referenced from: pull request https://github.com/spring-projects/spring-batch/pull/600/files
Backported to: 4.1.0.M3
Metadata
Metadata
Assignees
Labels
has: backportsLegacy label from JIRA. Superseded by "for: backport-to-x.x.x"Legacy label from JIRA. Superseded by "for: backport-to-x.x.x"in: coretype: enhancement