You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/02/23 06:07:43 UTC

[groovy] 02/02: Specify the parent classloader of `GroovyClassLoader` to find default imports

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 04199c6aeb8b0fcf1a1cbc5b9843a16082bf1f61
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Feb 23 12:52:09 2020 +0800

    Specify the parent classloader of `GroovyClassLoader` to find default imports
    
    (cherry picked from commit 38f119d9cdabd7555b9d4a3b4bb2ed9d48ddc785)
---
 src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java b/src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java
index 27c8ad6..1a87b8f 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java
@@ -84,7 +84,7 @@ public class Java9 extends Java8 {
         try {
             result.putAll(doFindClasses(URI.create("jrt:/modules/java.base/"), "java", javaPns));
 
-            GroovyClassLoader gcl = new GroovyClassLoader();
+            GroovyClassLoader gcl = new GroovyClassLoader(this.getClass().getClassLoader());
             URI gsLocation = DefaultGroovyMethods.getLocation(gcl.loadClass("groovy.lang.GroovySystem")).toURI();
             result.putAll(doFindClasses(gsLocation, "groovy", groovyPns));