Skip to content

Commit 1e938e3

Browse files
marschallfmbenhassine
authored andcommitted
BATCH-2161 ScopeConfiguration methods should be static
The scope bean factory methods in ScopeConfiguration are BeanFactoryPostProcessors and should therefore be static. - Declare the scope beans in ScopeConfiguration as static Issue: BATCH-2161
1 parent b49eea7 commit 1e938e3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,18 @@ protected BatchConfigurer getConfigurer(Collection<BatchConfigurer> configurers)
129129
@Configuration
130130
class ScopeConfiguration {
131131

132-
private StepScope stepScope = new StepScope();
133-
134-
private JobScope jobScope = new JobScope();
135-
136132
@Bean
137-
public StepScope stepScope() {
133+
public static StepScope stepScope() {
134+
StepScope stepScope = new StepScope();
138135
stepScope.setAutoProxy(false);
139136
return stepScope;
140137
}
141138

142139
@Bean
143-
public JobScope jobScope() {
140+
public static JobScope jobScope() {
141+
JobScope jobScope = new JobScope();
144142
jobScope.setAutoProxy(false);
145143
return jobScope;
146144
}
145+
147146
}

0 commit comments

Comments
 (0)