// takes ~70 ms to set up, do it only once if possible sclass ClassNameResolver { settable File byteCodePath = byteCodePathForClass(getClass()); LS importedPackages = itemPlusList("java.lang", endingWith_dropSuffix(standardImports(), ".*")); simplyCached Set allFullyQualifiedClassNames() { new Set set; assertNotNull(byteCodePath); set.addAll(classNamesInJarOrDir(byteCodePath)); printVars ClassNameResolver(+byteCodePath, classesFound := l(set)); set.addAll(classNamesInLoadedJigsawModules()); ret set; } selfType init() { allFullyQualifiedClassNames(); this; } S findClass(S name) { for (S pkg : importedPackages) { S fullName = pkg + "." + name; if (allFullyQualifiedClassNames().contains(fullName)) ret fullName; } null; } void printMe { printVars("ClassNameResolver", +byteCodePath); print(+importedPackages); } }