aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/eclipse/apt/Processor.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/lombok/eclipse/apt/Processor.java b/src/core/lombok/eclipse/apt/Processor.java
index 82e39885..8dde079d 100644
--- a/src/core/lombok/eclipse/apt/Processor.java
+++ b/src/core/lombok/eclipse/apt/Processor.java
@@ -62,7 +62,18 @@ public class Processor extends AbstractProcessor {
this.processingEnv = (BaseProcessingEnvImpl)procEnv;
- new LiveInjector().injectSelf();
+ if (eclipseNeedsPatching()) {
+ new LiveInjector().injectSelf();
+ }
+ }
+
+ private boolean eclipseNeedsPatching() {
+ try {
+ return Class.forName("org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration").getDeclaredField("$lombokAST") == null;
+ } catch (Exception ignore) {
+ //I guess it isn't there, then.
+ return true;
+ }
}
/** {@inheritDoc} */