Java indexer: properly handle file lookups in cwd
Summary: This is needed to handle automatic module-info files in Java 9.
Reviewers: #core_team, salguarnieri
Subscribers: #core_team
@@ -44,7 +44,7 @@ public class CompilationUnitBasedJavaFileStore implements JavaFileStore {
@Override
public CustomJavaFileObject find(String className, Kind kind, Set<String> pathPrefixes) {
Path file = Paths.get(className.replace('.', '/') + kind.extension);
- String dirname = file.getParent().toString();
+ String dirname = file.getParent() == null ? "." : file.getParent().toString();
String basename = file.getFileName().toString();
for (String prefix : pathPrefixes) {
String dirToLookIn = join(prefix, dirname);
