Skip to content

Commit

Permalink
Polish a7092a2
Browse files Browse the repository at this point in the history
  • Loading branch information
fmbenhassine committed Sep 17, 2019
1 parent a7092a2 commit 2306141
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public String getName() {
* @param stepName name of the step
* @return the Step
*/
@Nullable
@Override
public abstract Step getStep(String stepName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.repository.JobRestartException;
import org.springframework.batch.core.step.StepLocator;
import org.springframework.lang.Nullable;

/**
* Simple implementation of {@link Job} interface providing the ability to run a
Expand All @@ -40,6 +39,7 @@
* @author Lucas Ward
* @author Dave Syer
* @author Michael Minella
* @author Mahmoud Ben Hassine
*/
public class SimpleJob extends AbstractJob {

Expand Down Expand Up @@ -103,7 +103,6 @@ public void addStep(Step step) {
* @see
* org.springframework.batch.core.job.AbstractJob#getStep(java.lang.String)
*/
@Nullable
@Override
public Step getStep(String stepName) {
for (Step step : this.steps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.springframework.batch.core.job.SimpleStepHandler;
import org.springframework.batch.core.step.StepHolder;
import org.springframework.batch.core.step.StepLocator;
import org.springframework.lang.Nullable;

/**
* Implementation of the {@link Job} interface that allows for complex flows of
Expand All @@ -36,6 +35,7 @@
* namespace to abstract away details.
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
* @since 2.0
*/
public class FlowJob extends AbstractJob {
Expand Down Expand Up @@ -74,7 +74,6 @@ public void setFlow(Flow flow) {
/**
* {@inheritDoc}
*/
@Nullable
@Override
public Step getStep(String stepName) {
if (!initialized) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
import org.springframework.batch.core.step.NoSuchStepException;
import org.springframework.batch.core.step.StepHolder;
import org.springframework.batch.core.step.StepLocator;
import org.springframework.lang.Nullable;

/**
* {@link State} implementation that delegates to a {@link FlowExecutor} to
* execute the specified {@link Step}.
*
* @author Dave Syer
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 2.0
*/
public class StepState extends AbstractState implements StepLocator, StepHolder {
Expand Down Expand Up @@ -100,7 +100,6 @@ public Collection<String> getStepNames() {
/* (non-Javadoc)
* @see org.springframework.batch.core.step.StepLocator#getStep(java.lang.String)
*/
@Nullable
@Override
public Step getStep(String stepName) throws NoSuchStepException {
Step result = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
import org.springframework.batch.core.step.NoSuchStepException;
import org.springframework.batch.core.step.StepLocator;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.lang.Nullable;

/**
* An extension of the {@link PartitionStep} that provides additional semantics
* required by JSR-352. Specifically, this implementation adds the required
* lifecycle calls to the {@link PartitionReducer} if it is used.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class PartitionStep extends org.springframework.batch.core.partition.support.PartitionStep implements StepLocator {
Expand Down Expand Up @@ -103,7 +103,6 @@ public Collection<String> getStepNames() {
/* (non-Javadoc)
* @see org.springframework.batch.core.step.StepLocator#getStep(java.lang.String)
*/
@Nullable
@Override
public Step getStep(String stepName) throws NoSuchStepException {
JsrPartitionHandler partitionHandler = (JsrPartitionHandler) getPartitionHandler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
/**
* @author Dave Syer
* @author Stephane Nicoll
* @author Mahmoud Ben Hassine
*/
public class DefaultJobLoaderTests {

Expand Down Expand Up @@ -266,7 +267,6 @@ public Collection<String> getStepNames() {
return Collections.emptyList();
}

@Nullable
@Override
public Step getStep(String stepName) throws NoSuchStepException {
throw new NoSuchStepException("Step [" + stepName + "] does not exist");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

/**
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class ExtendedAbstractJobTests {
Expand Down Expand Up @@ -215,7 +216,6 @@ public StubJob() {
protected void doExecute(JobExecution execution) throws JobExecutionException {
}

@Nullable
@Override
public Step getStep(String stepName) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
*
* @author Lucas Ward
* @author Dave Syer
* @author Mahmoud Ben Hassine
*/
public class JobSupport implements BeanNameAware, Job, StepLocator {

Expand Down Expand Up @@ -192,7 +193,6 @@ public Collection<String> getStepNames() {
return steps.keySet();
}

@Nullable
@Override
public Step getStep(String stepName) throws NoSuchStepException {
final Step step = steps.get(stepName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ class MockJob extends AbstractJob {

private TaskletStep taskletStep;

@Nullable
@Override
public Step getStep(String stepName) {
return taskletStep;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ protected T doRead() throws Exception {
* @return next line (skip comments).getCurrentResource
*/
@Nullable
protected String readLine() {
private String readLine() {

if (reader == null) {
throw new ReaderNotOpenException("Reader must be open before it can be read.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

/**
* A {@link StepLocator} implementation that just looks in its enclosing bean
* factory for components of type {@link Step}.
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class BeanFactoryStepLocator implements StepLocator, BeanFactoryAware {
Expand All @@ -31,7 +31,6 @@ public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
* Look up a bean with the provided name of type {@link Step}.
* @see StepLocator#getStep(String)
*/
@Nullable
public Step getStep(String stepName) {
return beanFactory.getBean(stepName, Step.class);
}
Expand Down

0 comments on commit 2306141

Please sign in to comment.