aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2020-12-10 17:23:52 +0100
committerGitHub <noreply@github.com>2020-12-10 17:23:52 +0100
commitc14aa6a6988f2bffa260f311b7b283078d8108d9 (patch)
treeb7520adbf6d825b9feee591d11f8a33c4ae54f51
parent321727559f1c0ab91cba766cd680c9e329025cc1 (diff)
parent02e3101a0b75b6d0d45387761920b0940c186978 (diff)
downloadlombok-c14aa6a6988f2bffa260f311b7b283078d8108d9.tar.gz
lombok-c14aa6a6988f2bffa260f311b7b283078d8108d9.tar.bz2
lombok-c14aa6a6988f2bffa260f311b7b283078d8108d9.zip
Merge pull request #2668 from mkurz/fix-sbt-subprojects
Fixing reading files in sbt 1.4+ subprojects
-rw-r--r--src/core/lombok/javac/JavacAST.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/lombok/javac/JavacAST.java b/src/core/lombok/javac/JavacAST.java
index b3e8930e..f58de60f 100644
--- a/src/core/lombok/javac/JavacAST.java
+++ b/src/core/lombok/javac/JavacAST.java
@@ -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);