mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 22:17:41 +00:00
Sanity check on running patch scripts for eclipse - if its already been done we do not run them again.
This commit is contained in:
1 parent
7aa2573079
commit
bed2d10358
1 file changed
+12
-1
@@ -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} */
|
||||
|
||||
Reference in new issue
Block a user