aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac
diff options
context:
space:
mode:
authorMatthias Kurz <m.kurz@irregular.at>2020-12-05 18:03:45 +0100
committerMatthias Kurz <m.kurz@irregular.at>2020-12-05 18:03:45 +0100
commit02e3101a0b75b6d0d45387761920b0940c186978 (patch)
treeb7520adbf6d825b9feee591d11f8a33c4ae54f51 /src/core/lombok/javac
parent321727559f1c0ab91cba766cd680c9e329025cc1 (diff)
downloadlombok-02e3101a0b75b6d0d45387761920b0940c186978.tar.gz
lombok-02e3101a0b75b6d0d45387761920b0940c186978.tar.bz2
lombok-02e3101a0b75b6d0d45387761920b0940c186978.zip
Fixing reading files in sbt 1.4+ subprojects
Diffstat (limited to 'src/core/lombok/javac')
-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);