From 02e3101a0b75b6d0d45387761920b0940c186978 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Sat, 5 Dec 2020 18:03:45 +0100 Subject: Fixing reading files in sbt 1.4+ subprojects --- src/core/lombok/javac/JavacAST.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core') 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 { 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); -- cgit