mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 16:14:46 +00:00
Merge pull request #2668 from mkurz/fix-sbt-subprojects
Fixing reading files in sbt 1.4+ subprojects
This commit is contained in:
1 file changed
+8
-1
@@ -174,7 +174,14 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> {
|
||||
if (sbtMappedVirtualFileRootsField == null) return null;
|
||||
|
||||
String encodedPath = (String) sbtMappedVirtualFilePathField.get(mappedVirtualFile);
|
||||
if (!encodedPath.startsWith("${")) return null;
|
||||
if (!encodedPath.startsWith("${")) {
|
||||
File maybeAbsoluteFile = new File(encodedPath);
|
||||
if (maybeAbsoluteFile.exists()) {
|
||||
return maybeAbsoluteFile.toURI();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
int idx = encodedPath.indexOf('}');
|
||||
if (idx == -1) return null;
|
||||
String base = encodedPath.substring(2, idx);
|
||||
|
||||
Reference in new issue
Block a user