From f737c1ca2700d54b594ddf13519aa6af9f1362f1 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 29 Dec 2009 23:55:36 +0100 Subject: EclipsePatcher now only patches needed stuff when in ECJ mode. --- .../lombok/eclipse/agent/EclipsePatcher.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/eclipseAgent/lombok/eclipse') diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java index b8f9f9a3..ce494daa 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java +++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java @@ -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); } -- cgit