Added @Nullable annotation to overriding methods.
Resolves BATCH-2839
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
4ec227cd6e
commit
a7092a21e4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
* Copyright 2006-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,6 +27,7 @@ import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.core.task.SyncTaskExecutor;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -91,6 +92,7 @@ public class AsyncItemProcessor<I, O> implements ItemProcessor<I, Future<O>>, In
|
||||
*
|
||||
* @see ItemProcessor#process(Object)
|
||||
*/
|
||||
@Nullable
|
||||
public Future<O> process(final I item) throws Exception {
|
||||
final StepExecution stepExecution = getStepExecution();
|
||||
FutureTask<O> task = new FutureTask<>(new Callable<O>() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
* Copyright 2006-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,6 +35,7 @@ import org.springframework.batch.item.ItemStream;
|
||||
import org.springframework.batch.item.ItemStreamException;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.integration.core.MessagingTemplate;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.PollableChannel;
|
||||
import org.springframework.messaging.support.GenericMessage;
|
||||
@@ -116,6 +117,7 @@ public class ChunkMessageChannelItemWriter<T> extends StepExecutionListenerSuppo
|
||||
localState.setStepExecution(stepExecution);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ExitStatus afterStep(StepExecution stepExecution) {
|
||||
if (!(stepExecution.getStatus() == BatchStatus.COMPLETED)) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.springframework.beans.BeansException;
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -30,6 +31,7 @@ public class BeanFactoryStepLocator implements StepLocator, BeanFactoryAware {
|
||||
* 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user