aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/javac/apt/LombokFileObjects.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/lombok/javac/apt/LombokFileObjects.java b/src/core/lombok/javac/apt/LombokFileObjects.java
index 4edf7f6e..cb2036e9 100644
--- a/src/core/lombok/javac/apt/LombokFileObjects.java
+++ b/src/core/lombok/javac/apt/LombokFileObjects.java
@@ -22,6 +22,7 @@
package lombok.javac.apt;
+import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URI;
import java.nio.file.Path;
@@ -111,6 +112,18 @@ final class LombokFileObjects {
catch (Exception e) {}
return Compiler.JAVAC7;
}
+ if (jfmClassName.equals("com.sun.tools.javac.api.ClientCodeWrapper$WrappedStandardJavaFileManager")) {
+ try {
+ Field wrappedField = Class.forName("com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager").getDeclaredField("clientJavaFileManager");
+ wrappedField.setAccessible(true);
+ JavaFileManager wrappedManager = (JavaFileManager)wrappedField.get(jfm);
+ Class<?> superType = Class.forName("com.sun.tools.javac.file.BaseFileManager");
+ if (superType.isInstance(wrappedManager)) {
+ return new Java9Compiler(wrappedManager);
+ }
+ }
+ catch (Exception e) {}
+ }
try {
if (Class.forName("com.sun.tools.javac.file.BaseFileObject") == null) throw new NullPointerException();
return Compiler.JAVAC7;