This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new bbe4557ca3 avoid GrapeIvy as mentioned class (pre-work for
replacing/making optional GrapeIvy)
bbe4557ca3 is described below
commit bbe4557ca32fd967e11a0ef5cc502f45513b06ac
Author: Paul King <[email protected]>
AuthorDate: Fri May 3 11:52:17 2024 +1000
avoid GrapeIvy as mentioned class (pre-work for replacing/making optional
GrapeIvy)
---
src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
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 14d37343db..76ac1af03f 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java
@@ -103,17 +103,18 @@ public class Java9 extends Java8 {
CompletableFuture<Map<String, Set<String>>>
javaDefaultImportsFuture =
CompletableFuture.supplyAsync(() ->
doFindClasses(URI.create("jrt:/modules/java.base/"), "java", javaPackages));
try {
- URI gsLocation =
DefaultGroovyMethods.getLocation(gcl.loadClass("groovy.lang.GroovySystem")).toURI();
+ // groovy-core (Java source)
+ URI gcjLocation =
DefaultGroovyMethods.getLocation(gcl.loadClass("groovy.lang.GroovySystem")).toURI();
CompletableFuture<Map<String, Set<String>>>
groovyDefaultImportsFuture1 =
- CompletableFuture.supplyAsync(() ->
doFindClasses(gsLocation, "groovy", groovyPackages));
+ CompletableFuture.supplyAsync(() ->
doFindClasses(gcjLocation, "groovy", groovyPackages));
- // in production environment, groovy-core classes, e.g.
`GroovySystem`(java class) and `GrapeIvy`(groovy class) are all packaged in the
groovy-core jar file,
+ // in production environment, groovy-core classes, e.g.
`GroovySystem`(java class) and `ListenerLister`(groovy class) are all packaged
in the groovy-core jar file,
// but in Groovy development environment, groovy-core classes
are distributed in different directories
- URI giLocation =
DefaultGroovyMethods.getLocation(gcl.loadClass("groovy.grape.GrapeIvy")).toURI();
+ URI gcgLocation =
DefaultGroovyMethods.getLocation(gcl.loadClass("groovy.beans.ListenerList")).toURI();
CompletableFuture<Map<String, Set<String>>>
groovyDefaultImportsFuture2 =
- gsLocation.equals(giLocation)
+ gcjLocation.equals(gcgLocation)
?
CompletableFuture.completedFuture(Collections.emptyMap())
- : CompletableFuture.supplyAsync(() ->
doFindClasses(giLocation, "groovy", groovyPackages));
+ : CompletableFuture.supplyAsync(() ->
doFindClasses(gcgLocation, "groovy", groovyPackages));
result.putAll(groovyDefaultImportsFuture1.get());
result.putAll(groovyDefaultImportsFuture2.get());