Sanity check on running patch scripts for eclipse - if its already been done we do not run them again.

This commit is contained in:
Reinier Zwitserloot committed 2009-12-30 02:29:37 +01:00
1 parent 7aa2573079
commit bed2d10358
1 file changed
+12 -1
+12 -1
View File
@@ -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} */