aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2009-12-29 23:55:36 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2009-12-29 23:55:36 +0100
commitf737c1ca2700d54b594ddf13519aa6af9f1362f1 (patch)
tree06d2c48368e10afaa4cd9ca5195749df50eb61f3 /src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
parent0917f20f74728ab311160252e06b5368d6ab4a55 (diff)
downloadlombok-f737c1ca2700d54b594ddf13519aa6af9f1362f1.tar.gz
lombok-f737c1ca2700d54b594ddf13519aa6af9f1362f1.tar.bz2
lombok-f737c1ca2700d54b594ddf13519aa6af9f1362f1.zip
EclipsePatcher now only patches needed stuff when in ECJ mode.
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java21
1 files changed, 13 insertions, 8 deletions
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);
}