File tree 1 file changed +9
-2
lines changed
spring-context/src/main/java/org/springframework/scripting/groovy 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2017 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -158,7 +158,14 @@ public void setBeanFactory(BeanFactory beanFactory) {
158
158
159
159
@ Override
160
160
public void setBeanClassLoader (ClassLoader classLoader ) {
161
- this .groovyClassLoader = buildGroovyClassLoader (classLoader );
161
+ if (classLoader instanceof GroovyClassLoader &&
162
+ (this .compilerConfiguration == null ||
163
+ ((GroovyClassLoader ) classLoader ).hasCompatibleConfiguration (this .compilerConfiguration ))) {
164
+ this .groovyClassLoader = (GroovyClassLoader ) classLoader ;
165
+ }
166
+ else {
167
+ this .groovyClassLoader = buildGroovyClassLoader (classLoader );
168
+ }
162
169
}
163
170
164
171
/**
You can’t perform that action at this time.
0 commit comments