Skip to content

BATCH-2715: Change the method name "getStartable" to "isStartable". #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public int compare(StepExecution arg0, StepExecution arg1) {
JobExecution curJobExecution = new JobExecution(jobExecution);
StepExecution curStepExecution = new StepExecution(stepName, curJobExecution);

if(!restoreState || getStartable(curStepExecution, new ExecutionContext())) {
if(!restoreState || isStartable(curStepExecution, new ExecutionContext())) {
executions.add(curStepExecution);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public Set<StepExecution> split(StepExecution stepExecution, int gridSize) throw

StepExecution currentStepExecution = jobExecution.createStepExecution(stepName);

boolean startable = getStartable(currentStepExecution, context.getValue());
boolean startable = isStartable(currentStepExecution, context.getValue());

if (startable) {
set.add(currentStepExecution);
Expand Down Expand Up @@ -238,6 +238,11 @@ private Map<String, ExecutionContext> getContexts(StepExecution stepExecution, i
return result;
}

protected boolean isStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can avoid code duplication by making isStartable call getStartable:

protected boolean isStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException {
   return getStartable(stepExecution, context);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benas Updated the PR with your comments.

return getStartable(stepExecution, context);
}

@Deprecated
protected boolean getStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException {

JobInstance jobInstance = stepExecution.getJobExecution().getJobInstance();
Expand Down