Skip to content

Commit f7ec69e

Browse files
hpoettkerfmbenhassine
authored andcommitted
Take care of some deprecations
1 parent cf1f34b commit f7ec69e

File tree

10 files changed

+15
-20
lines changed

10 files changed

+15
-20
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchRegistrar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, B
6868
registerAutomaticJobRegistrar(registry, batchAnnotation);
6969
watch.stop();
7070
LOGGER.info(LogMessage.format("Finished Spring Batch infrastructure beans configuration in %s ms.",
71-
watch.getLastTaskTimeMillis()));
71+
watch.lastTaskInfo().getTimeMillis()));
7272
}
7373

7474
private void validateState(AnnotationMetadata importingClassMetadata) {

spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SystemExiter.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2007 the original author or authors.
2+
* Copyright 2006-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,8 +28,6 @@ public interface SystemExiter {
2828
/**
2929
* Terminate the currently running Java Virtual Machine.
3030
* @param status exit status.
31-
* @throws SecurityException if a security manager exists and its
32-
* <code>checkExit</code> method doesn't allow exit with the specified status.
3331
* @see System#exit(int)
3432
*/
3533
void exit(int status);

spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/CommandRunner.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2022 the original author or authors.
2+
* Copyright 2006-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,9 +39,6 @@ public interface CommandRunner {
3939
* @param dir the working directory of the subprocess, or {@code null} if the
4040
* subprocess should inherit the working directory of the current process.
4141
* @return A new {@link Process} object for managing the subprocess
42-
* @throws SecurityException If a security manager exists and its
43-
* {@link SecurityManager#checkExec checkExec} method doesn't allow creation of the
44-
* subprocess
4542
* @throws IOException If an I/O error occurs
4643
* @throws NullPointerException If {@code command} is {@code null}, or one of the
4744
* elements of {@code envp} is {@code null}

spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepWithFaultTolerantProcessTaskJobParserTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2022 the original author or authors.
2+
* Copyright 2006-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,8 +31,8 @@
3131
import org.springframework.batch.item.ItemStream;
3232
import org.springframework.beans.factory.annotation.Autowired;
3333
import org.springframework.beans.factory.annotation.Qualifier;
34+
import org.springframework.core.task.SyncTaskExecutor;
3435
import org.springframework.retry.RetryListener;
35-
import org.springframework.scheduling.concurrent.ConcurrentTaskExecutor;
3636
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
3737
import org.springframework.test.util.ReflectionTestUtils;
3838
import org.springframework.transaction.annotation.Isolation;
@@ -90,7 +90,7 @@ void testStepWithTask() throws Exception {
9090
Object txq = ReflectionTestUtils.getField(factory, "readerTransactionalQueue");
9191
assertEquals(true, txq, "wrong reader-transactional-queue:");
9292
Object te = ReflectionTestUtils.getField(factory, "taskExecutor");
93-
assertEquals(ConcurrentTaskExecutor.class, te.getClass(), "wrong task-executor:");
93+
assertEquals(SyncTaskExecutor.class, te.getClass(), "wrong task-executor:");
9494
Object listeners = ReflectionTestUtils.getField(factory, "stepExecutionListeners");
9595
assertEquals(2, ((Set<StepExecutionListener>) listeners).size(), "wrong number of listeners:");
9696
Object retryListeners = ReflectionTestUtils.getField(factory, "retryListeners");

spring-batch-core/src/test/java/org/springframework/batch/core/job/builder/FlowJobBuilderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void testNestedSplitsWithSingleThread() {
181181
FlowBuilder.SplitBuilder<SimpleFlow> splitBuilder = flowBuilder.split(taskExecutor);
182182
splitBuilder.add(new FlowBuilder<Flow>("subflow1").from(step1).end());
183183
splitBuilder.add(new FlowBuilder<Flow>("subflow2").from(step2).end());
184-
Job job = new JobBuilder("job").repository(jobRepository).start(flowBuilder.build()).end().build();
184+
Job job = new JobBuilder("job", jobRepository).start(flowBuilder.build()).end().build();
185185
job.execute(execution);
186186

187187
assertEquals(BatchStatus.COMPLETED, execution.getStatus());

spring-batch-core/src/test/java/org/springframework/batch/core/step/builder/StepBuilderTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
2323
import org.junit.jupiter.api.Test;
2424

2525
import org.springframework.batch.core.BatchStatus;
26+
import org.springframework.batch.core.ChunkListener;
2627
import org.springframework.batch.core.ExitStatus;
2728
import org.springframework.batch.core.ItemReadListener;
2829
import org.springframework.batch.core.JobParameters;
@@ -42,7 +43,6 @@
4243
import org.springframework.batch.core.configuration.xml.DummyItemReader;
4344
import org.springframework.batch.core.configuration.xml.DummyItemWriter;
4445
import org.springframework.batch.core.job.SimpleJob;
45-
import org.springframework.batch.core.listener.ChunkListenerSupport;
4646
import org.springframework.batch.core.repository.JobRepository;
4747
import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean;
4848
import org.springframework.batch.item.ItemReader;
@@ -237,7 +237,7 @@ private void assertStepFunctions(boolean faultTolerantStep) throws Exception {
237237

238238
@Test
239239
void testReturnedTypeOfChunkListenerIsAssignableToSimpleStepBuilder() throws Exception {
240-
testReturnedTypeOfSetterIsAssignableToSimpleStepBuilder(builder -> builder.listener(new ChunkListenerSupport() {
240+
testReturnedTypeOfSetterIsAssignableToSimpleStepBuilder(builder -> builder.listener(new ChunkListener() {
241241
}));
242242
}
243243

spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@
6262
import org.springframework.batch.item.WriterNotOpenException;
6363
import org.springframework.batch.item.support.AbstractItemStreamItemReader;
6464
import org.springframework.beans.factory.FactoryBean;
65+
import org.springframework.core.task.SyncTaskExecutor;
6566
import org.springframework.jdbc.support.JdbcTransactionManager;
6667
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
6768
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
6869
import org.springframework.lang.Nullable;
69-
import org.springframework.scheduling.concurrent.ConcurrentTaskExecutor;
7070
import org.springframework.test.util.ReflectionTestUtils;
7171
import org.springframework.util.StringUtils;
7272

@@ -870,7 +870,7 @@ public String read() {
870870
};
871871

872872
factory.setItemReader(reader);
873-
factory.setTaskExecutor(new ConcurrentTaskExecutor());
873+
factory.setTaskExecutor(new SyncTaskExecutor());
874874

875875
Step step = factory.getObject();
876876

spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserBadRetryListenerTests-context.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@
4444

4545
<beans:bean id="retryListener" class="org.springframework.batch.core.configuration.xml.TestRetryListener" />
4646

47-
<beans:bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ConcurrentTaskExecutor" />
47+
<beans:bean id="taskExecutor" class="org.springframework.core.task.SyncTaskExecutor" />
4848

4949
</beans:beans>

spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
<beans:bean id="listener" class="org.springframework.batch.core.configuration.xml.TestListener" />
4949

50-
<beans:bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ConcurrentTaskExecutor" />
50+
<beans:bean id="taskExecutor" class="org.springframework.core.task.SyncTaskExecutor" />
5151

5252
<job-repository id="jobRepository" table-prefix="BATCH_"/>
5353

spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithFaultTolerantProcessTaskJobParserTests-context.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353

5454
<beans:bean id="retryListener" class="org.springframework.batch.core.configuration.xml.TestRetryListener" />
5555

56-
<beans:bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ConcurrentTaskExecutor" />
56+
<beans:bean id="taskExecutor" class="org.springframework.core.task.SyncTaskExecutor" />
5757

5858
</beans:beans>

0 commit comments

Comments
 (0)