From 1e938e3e2b6fab5d8382e869a9ba15f84d1947af Mon Sep 17 00:00:00 2001 From: Philippe Marschall Date: Thu, 27 Aug 2015 19:20:31 +0200 Subject: [PATCH] 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 --- .../annotation/AbstractBatchConfiguration.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java index 1997a0f98..73c4173d9 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java @@ -129,19 +129,18 @@ public abstract class AbstractBatchConfiguration implements ImportAware { @Configuration class ScopeConfiguration { - private StepScope stepScope = new StepScope(); - - private JobScope jobScope = new JobScope(); - @Bean - public StepScope stepScope() { + public static StepScope stepScope() { + StepScope stepScope = new StepScope(); stepScope.setAutoProxy(false); return stepScope; } @Bean - public JobScope jobScope() { + public static JobScope jobScope() { + JobScope jobScope = new JobScope(); jobScope.setAutoProxy(false); return jobScope; } + } \ No newline at end of file