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/19 00:19:52 UTC

[groovy] branch danielsun/tweak-resolving updated: Fix the failing build

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

sunlan pushed a commit to branch danielsun/tweak-resolving
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/danielsun/tweak-resolving by this push:
     new 3154026  Fix the failing build
3154026 is described below

commit 31540266d338a301554e54591fd20c36aa38011e
Author: Daniel Sun <su...@apache.org>
AuthorDate: Wed Feb 19 08:19:35 2020 +0800

    Fix the failing build
---
 src/main/java/org/codehaus/groovy/vmplugin/v9/ClassFinder.java  | 2 +-
 src/test/org/codehaus/groovy/vmplugin/v9/ClassFinderTest.groovy | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/vmplugin/v9/ClassFinder.java b/src/main/java/org/codehaus/groovy/vmplugin/v9/ClassFinder.java
index 264b00a..5fa6708 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v9/ClassFinder.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v9/ClassFinder.java
@@ -97,7 +97,7 @@ public class ClassFinder {
                         return FileVisitResult.CONTINUE;
                     }
 
-                    String packagePathStr = Arrays.stream(Arrays.copyOfRange(pathElems, prefixElemCnt + (pathElems[0].isEmpty() ? 1 : 0), nameCount - 1)).collect(Collectors.joining("/"));
+                    String packagePathStr = Arrays.stream(Arrays.copyOfRange(pathElems, prefixElemCnt + (!wfs && pathElems[0].isEmpty() ? 1 : 0), nameCount - 1)).collect(Collectors.joining("/"));
 
                     if (recursive || packageName.equals(packagePathStr)) {
                         Set<String> packageNameSet = result.computeIfAbsent(filename.substring(0, filename.lastIndexOf(".")), f -> new HashSet<>());
diff --git a/src/test/org/codehaus/groovy/vmplugin/v9/ClassFinderTest.groovy b/src/test/org/codehaus/groovy/vmplugin/v9/ClassFinderTest.groovy
index 01f693e..e3afd8a 100644
--- a/src/test/org/codehaus/groovy/vmplugin/v9/ClassFinderTest.groovy
+++ b/src/test/org/codehaus/groovy/vmplugin/v9/ClassFinderTest.groovy
@@ -24,7 +24,6 @@ import org.junit.Test
 class ClassFinderTest {
     @Test
     void findGroovyClass() {
-        assert "GroovySystem.location.toURI():" == "${GroovySystem.location.toURI()}"
         Map<String, Set<String>> result = ClassFinder.find(GroovySystem.location.toURI(), "groovy/lang")
         assert ["groovy/lang"] == result.get("GString")?.toList()
         assert null == result.get("GroovydocHolder")