BATCH-1915: Change minimum compiler level to 1.6 and use @Override everywhere
This commit is contained in:
@@ -88,6 +88,7 @@ public abstract class AbstractJobTests implements ApplicationContextAware {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ public class DataSourceInitializer implements InitializingBean, DisposableBean {
|
||||
DataSourceInitializer.class.getSimpleName() + "-context.xml"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
if (destroyScripts==null) return;
|
||||
for (int i = 0; i < destroyScripts.length; i++) {
|
||||
@@ -94,6 +95,7 @@ public class DataSourceInitializer implements InitializingBean, DisposableBean {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
Assert.notNull(dataSource);
|
||||
initialize();
|
||||
@@ -118,6 +120,7 @@ public class DataSourceInitializer implements InitializingBean, DisposableBean {
|
||||
TransactionTemplate transactionTemplate = new TransactionTemplate(new DataSourceTransactionManager(dataSource));
|
||||
transactionTemplate.execute(new TransactionCallback() {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
|
||||
@@ -58,6 +58,7 @@ public class JobRepositoryTestUtils extends AbstractJdbcBatchMetadataDao impleme
|
||||
|
||||
Long count = 0L;
|
||||
|
||||
@Override
|
||||
public JobParameters getNext(JobParameters parameters) {
|
||||
return new JobParameters(Collections.singletonMap("count", new JobParameter(count++)));
|
||||
}
|
||||
@@ -69,6 +70,7 @@ public class JobRepositoryTestUtils extends AbstractJdbcBatchMetadataDao impleme
|
||||
/**
|
||||
* @see InitializingBean#afterPropertiesSet()
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
Assert.notNull(jobRepository, "JobRepository must be set");
|
||||
Assert.notNull(jdbcTemplate, "DataSource must be set");
|
||||
@@ -165,6 +167,7 @@ public class JobRepositoryTestUtils extends AbstractJdbcBatchMetadataDao impleme
|
||||
List<Long> stepExecutionIds = jdbcTemplate.query(
|
||||
getQuery("select STEP_EXECUTION_ID from %PREFIX%STEP_EXECUTION where JOB_EXECUTION_ID=?"),
|
||||
new ParameterizedRowMapper<Long>() {
|
||||
@Override
|
||||
public Long mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||
return rs.getLong(1);
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@ public class StepRunner {
|
||||
//
|
||||
if (jobExecutionContext != null && !jobExecutionContext.isEmpty()) {
|
||||
job.setJobExecutionListeners(new JobExecutionListener[] { new JobExecutionListenerSupport() {
|
||||
@Override
|
||||
public void beforeJob(JobExecution jobExecution) {
|
||||
ExecutionContext jobContext = jobExecution.getExecutionContext();
|
||||
for (Map.Entry<String, Object> entry : jobExecutionContext.entrySet()) {
|
||||
|
||||
@@ -74,6 +74,7 @@ public class StepScopeTestExecutionListener implements TestExecutionListener {
|
||||
* @throws Exception if there is a problem
|
||||
* @see TestExecutionListener#prepareTestInstance(TestContext)
|
||||
*/
|
||||
@Override
|
||||
public void prepareTestInstance(TestContext testContext) throws Exception {
|
||||
StepExecution stepExecution = getStepExecution(testContext);
|
||||
if (stepExecution != null) {
|
||||
@@ -86,6 +87,7 @@ public class StepScopeTestExecutionListener implements TestExecutionListener {
|
||||
* @throws Exception if there is a problem
|
||||
* @see TestExecutionListener#beforeTestMethod(TestContext)
|
||||
*/
|
||||
@Override
|
||||
public void beforeTestMethod(org.springframework.test.context.TestContext testContext) throws Exception {
|
||||
if (testContext.hasAttribute(STEP_EXECUTION)) {
|
||||
StepExecution stepExecution = (StepExecution) testContext.getAttribute(STEP_EXECUTION);
|
||||
@@ -99,6 +101,7 @@ public class StepScopeTestExecutionListener implements TestExecutionListener {
|
||||
* @throws Exception if there is a problem
|
||||
* @see TestExecutionListener#afterTestMethod(TestContext)
|
||||
*/
|
||||
@Override
|
||||
public void afterTestMethod(TestContext testContext) throws Exception {
|
||||
if (testContext.hasAttribute(STEP_EXECUTION)) {
|
||||
StepSynchronizationManager.close();
|
||||
@@ -108,12 +111,14 @@ public class StepScopeTestExecutionListener implements TestExecutionListener {
|
||||
/*
|
||||
* Support for Spring 3.0 (empty).
|
||||
*/
|
||||
@Override
|
||||
public void afterTestClass(TestContext testContext) throws Exception {
|
||||
}
|
||||
|
||||
/*
|
||||
* Support for Spring 3.0 (empty).
|
||||
*/
|
||||
@Override
|
||||
public void beforeTestClass(TestContext testContext) throws Exception {
|
||||
}
|
||||
|
||||
@@ -168,6 +173,7 @@ public class StepScopeTestExecutionListener implements TestExecutionListener {
|
||||
return result == null ? null : result.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
|
||||
Class<?> type = method.getReturnType();
|
||||
if (preferredType.isAssignableFrom(type)) {
|
||||
|
||||
@@ -134,6 +134,7 @@ public class JobRepositoryTestUtilsTests {
|
||||
public void testCreateJobExecutionsWithIncrementer() throws Exception {
|
||||
utils = new JobRepositoryTestUtils(jobRepository, dataSource);
|
||||
utils.setJobParametersIncrementer(new JobParametersIncrementer() {
|
||||
@Override
|
||||
public JobParameters getNext(JobParameters parameters) {
|
||||
return new JobParametersBuilder().addString("foo","bar").toJobParameters();
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public class SampleStepTests implements ApplicationContextAware {
|
||||
assertEquals(2, jdbcTemplate.queryForInt("SELECT ID from TESTS where NAME = 'SampleTasklet2'"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
this.context = applicationContext;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ public class JobExecutionNotificationPublisher implements ApplicationListener, N
|
||||
*
|
||||
* @see org.springframework.jmx.export.notification.NotificationPublisherAware#setNotificationPublisher(org.springframework.jmx.export.notification.NotificationPublisher)
|
||||
*/
|
||||
@Override
|
||||
public void setNotificationPublisher(NotificationPublisher notificationPublisher) {
|
||||
this.notificationPublisher = notificationPublisher;
|
||||
}
|
||||
@@ -55,6 +56,7 @@ public class JobExecutionNotificationPublisher implements ApplicationListener, N
|
||||
*
|
||||
* @see ApplicationListener#onApplicationEvent(ApplicationEvent)
|
||||
*/
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationEvent applicationEvent) {
|
||||
if (applicationEvent instanceof SimpleMessageApplicationEvent) {
|
||||
String message = applicationEvent.toString();
|
||||
|
||||
@@ -19,8 +19,9 @@ public class SimpleMessageApplicationEvent extends ApplicationEvent {
|
||||
/* (non-Javadoc)
|
||||
* @see java.util.EventObject#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "message=["+message+"], " + super.toString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ public class StepExecutionApplicationEventAdvice implements ApplicationEventPubl
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationEventPublisherAware#setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
|
||||
this.applicationEventPublisher = applicationEventPublisher;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ public class LoggingTasklet implements Tasklet {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
|
||||
logger.info("tasklet executing: id=" + id);
|
||||
return RepeatStatus.FINISHED;
|
||||
|
||||
@@ -26,6 +26,7 @@ public class SampleTasklet implements Tasklet {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
|
||||
this.jdbcTemplate.update("insert into TESTS(ID, NAME) values (?, 'SampleTasklet" + id + "')", id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user