EclipsePatcher now only patches needed stuff when in ECJ mode.

This commit is contained in:
Reinier Zwitserloot committed 2009-12-29 23:55:36 +01:00
1 parent 0917f20f74
commit f737c1ca27
1 file changed
+13 -8
@@ -45,20 +45,25 @@ import lombok.patcher.scripts.ScriptBuilder;
public class EclipsePatcher extends Agent {
@Override
public void runAgent(String agentArgs, Instrumentation instrumentation, boolean injected) throws Exception {
registerPatchScripts(instrumentation, injected);
registerPatchScripts(instrumentation, injected, injected);
}
private static void registerPatchScripts(Instrumentation instrumentation, boolean reloadExistingClasses) {
private static void registerPatchScripts(Instrumentation instrumentation, boolean reloadExistingClasses, boolean ecjOnly) {
ScriptManager sm = new ScriptManager();
sm.registerTransformer(instrumentation);
EquinoxClassLoader.addPrefix("lombok.");
EquinoxClassLoader.registerScripts(sm);
if (!ecjOnly) {
EquinoxClassLoader.addPrefix("lombok.");
EquinoxClassLoader.registerScripts(sm);
}
// patchLombokizeAST(sm);
patchAvoidReparsingGeneratedCode(sm);
// patchCatchReparse(sm);
// patchSetGeneratedFlag(sm);
// patchHideGeneratedNodes(sm);
if (!ecjOnly) {
patchLombokizeAST(sm);
patchCatchReparse(sm);
patchSetGeneratedFlag(sm);
patchHideGeneratedNodes(sm);
}
if (reloadExistingClasses) sm.reloadClasses(instrumentation);
}