aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2020-06-26 00:06:37 +0200
committerRoel Spilker <r.spilker@gmail.com>2020-06-26 00:06:50 +0200
commitf2b25550457628650213a3bfcac6a28a30648e6c (patch)
treec83debd4b65c3feeb2a5cce76b140f607aabb9a6
parent625acfa2a4ce49863ea562dd676500b5bb7898fc (diff)
downloadlombok-f2b25550457628650213a3bfcac6a28a30648e6c.tar.gz
lombok-f2b25550457628650213a3bfcac6a28a30648e6c.tar.bz2
lombok-f2b25550457628650213a3bfcac6a28a30648e6c.zip
Potential fix for #2412
-rw-r--r--src/core/lombok/core/AnnotationProcessor.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/lombok/core/AnnotationProcessor.java b/src/core/lombok/core/AnnotationProcessor.java
index ce93a069..d4a92408 100644
--- a/src/core/lombok/core/AnnotationProcessor.java
+++ b/src/core/lombok/core/AnnotationProcessor.java
@@ -83,7 +83,12 @@ public class AnnotationProcessor extends AbstractProcessor {
for (Class<?> procEnvClass = procEnv.getClass(); procEnvClass != null; procEnvClass = procEnvClass.getSuperclass()) {
try {
- Field field = Permit.getField(procEnvClass, "delegate");
+ Field field;
+ try {
+ field = Permit.getField(procEnvClass, "delegate");
+ } catch (NoSuchFieldException e) {
+ field = Permit.getField(procEnvClass, "processingEnv");
+ }
Object delegate = field.get(procEnv);
return tryRecursivelyObtainJavacProcessingEnvironment((ProcessingEnvironment) delegate);