aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/apt/LombokFileObjects.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/javac/apt/LombokFileObjects.java')
-rw-r--r--src/core/lombok/javac/apt/LombokFileObjects.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/lombok/javac/apt/LombokFileObjects.java b/src/core/lombok/javac/apt/LombokFileObjects.java
index 28d3c9fa..d6c96480 100644
--- a/src/core/lombok/javac/apt/LombokFileObjects.java
+++ b/src/core/lombok/javac/apt/LombokFileObjects.java
@@ -168,7 +168,17 @@ final class LombokFileObjects {
}
@Override public JavaFileObject wrap(LombokFileObject fileObject) {
- return new Javac9BaseFileObjectWrapper(fileManager, toPath(fileObject), fileObject);
+ Path p; try {
+ p = toPath(fileObject);
+ } catch (Exception e) {
+ p = null;
+ }
+
+ // J9BFOW extends javac's internal file base impl of javax.tools.JavaFileObject.
+ // J9JFOW just straight implements it. Probably J9JFOW is fine, but we decided to extend java's internal impl possibly for a reason.
+ // Some exotic build environments don't _have_ file objects and crash with FileNotFoundEx, so if that happens, let's try the alternative.
+ if (p != null) return new Javac9BaseFileObjectWrapper(fileManager, p, fileObject);
+ return new Javac9JavaFileObjectWrapper(fileObject);
}
@Override public Method getDecoderMethod() {