minor refactor: don't cache inner classes for the purpose of default import resolving
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 290c30e..bcfc441 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v9/ClassFinder.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v9/ClassFinder.java
@@ -85,6 +85,7 @@
public static Map<String, Set<String>> find(URI classpathEntryURI, String packageName, boolean recursive) {
return find(classpathEntryURI, packageName, recursive, true);
}
+
/**
* Returns the found classes
*
@@ -122,7 +123,7 @@
return find(uri, prefix, packageName, recursive, innerClasses);
}
- private static Map<String, Set<String>> find(URI uri, String prefix, String packageName, boolean recursive, final boolean innerClasses) {
+ static Map<String, Set<String>> find(URI uri, String prefix, String packageName, boolean recursive, final boolean innerClasses) {
boolean wfs = "file".equals(uri.getScheme());
if (wfs) prefix = prefix.replace("/", File.separator);
@@ -187,9 +188,9 @@
private static Tuple2<FileSystem, Boolean> maybeNewFileSystem(URI uri) throws IOException {
try {
- return new Tuple2(FileSystems.newFileSystem(uri, Collections.emptyMap()), true);
+ return new Tuple2<>(FileSystems.newFileSystem(uri, Collections.emptyMap()), true);
} catch (FileSystemAlreadyExistsException e) {
- return new Tuple2(FileSystems.getFileSystem(uri), false);
+ return new Tuple2<>(FileSystems.getFileSystem(uri), false);
}
}
diff --git a/src/test/org/codehaus/groovy/vmplugin/v9/ClassFinderTest.groovy b/src/test/org/codehaus/groovy/vmplugin/v9/ClassFinderTest.groovy
index 824d5ff..6ce0d51 100644
--- a/src/test/org/codehaus/groovy/vmplugin/v9/ClassFinderTest.groovy
+++ b/src/test/org/codehaus/groovy/vmplugin/v9/ClassFinderTest.groovy
@@ -106,7 +106,7 @@
@Test
void testGroovy9480() {
try {
- ClassFinder.find(URI.create("file:/"), "NOT_EXISTS", "org/", false)
+ ClassFinder.find(URI.create("file:/"), "NOT_EXISTS", "org/", false, true)
} catch (ClassFindFailedException e) {
assert e.message.contains('Failed to find classes')
}