Skip to content

Commit 202ecec

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 (cherry picked from commit 1e938e3)
1 parent 8d1c1c2 commit 202ecec

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
@@ -126,19 +126,18 @@ protected BatchConfigurer getConfigurer(Collection<BatchConfigurer> configurers)
126126
@Configuration
127127
class ScopeConfiguration {
128128

129-
private StepScope stepScope = new StepScope();
130-
131-
private JobScope jobScope = new JobScope();
132-
133129
@Bean
134-
public StepScope stepScope() {
130+
public static StepScope stepScope() {
131+
StepScope stepScope = new StepScope();
135132
stepScope.setAutoProxy(false);
136133
return stepScope;
137134
}
138135

139136
@Bean
140-
public JobScope jobScope() {
137+
public static JobScope jobScope() {
138+
JobScope jobScope = new JobScope();
141139
jobScope.setAutoProxy(false);
142140
return jobScope;
143141
}
142+
144143
}

0 commit comments

Comments
 (0)