Skip to content

Commit

Permalink
Merge pull request #2668 from mkurz/fix-sbt-subprojects
Browse files Browse the repository at this point in the history
Fixing reading files in sbt 1.4+ subprojects
  • Loading branch information
rzwitserloot authored Dec 10, 2020
2 parents 3217275 + 02e3101 commit c14aa6a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/lombok/javac/JavacAST.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,14 @@ private static URI tryGetSbtFile_(JavaFileObject sourcefile) throws Exception {
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);
Expand Down

0 comments on commit c14aa6a

Please sign in to comment.