Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Trivial
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.8.6, 2.0-beta-3
-
Component/s: GroovyScriptEngine
-
Labels:None
-
Testcase included:yes
-
Patch Submitted:Yes
-
Number of attachments :
Description
Today when a GroovyScriptEngineImpl instance is created (directly or via GroovyScriptEngineFactory), a new GroovyClassLoader is systematically instantiated. This behavior is perfect for most of the cases, but sometimes the embedded class loader might be overwritten for class loading tweaking purposes, or to ensure the usage of a custom compiler configuration.
The idea of this change is to provide an extra constructor which allows passing a custom class loader as parameter, so we avoid wasting time and resources creating a class loader which will be overridden afterwards.
https://github.com/groovy/groovy-core/pull/6#issuecomment-3542655
https://github.com/tiagofernandez/groovy-core/commit/bbada97d89a45708d1fad86313544df153e2040d
The patch file can be retrieved directly from the pull request:
https://github.com/groovy/groovy-core/pull/6.patch