diff options
author | Matthias Kurz <m.kurz@irregular.at> | 2020-12-05 18:03:45 +0100 |
---|---|---|
committer | Matthias Kurz <m.kurz@irregular.at> | 2020-12-05 18:03:45 +0100 |
commit | 02e3101a0b75b6d0d45387761920b0940c186978 (patch) | |
tree | b7520adbf6d825b9feee591d11f8a33c4ae54f51 /src/core/lombok | |
parent | 321727559f1c0ab91cba766cd680c9e329025cc1 (diff) | |
download | lombok-02e3101a0b75b6d0d45387761920b0940c186978.tar.gz lombok-02e3101a0b75b6d0d45387761920b0940c186978.tar.bz2 lombok-02e3101a0b75b6d0d45387761920b0940c186978.zip |
Fixing reading files in sbt 1.4+ subprojects
Diffstat (limited to 'src/core/lombok')
-rw-r--r-- | src/core/lombok/javac/JavacAST.java | 9 |
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); |