diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-12-01 13:53:07 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-12-01 13:53:07 +0100 |
commit | 199f7f74fd35462dced087280af066cf2cad7596 (patch) | |
tree | 6c0befb9bccede364c07bb843de4f4f5edb87404 /src/eclipseAgent | |
parent | 92e2afe9b0dccc7d0055b52d07ab3128c2adf4de (diff) | |
download | lombok-199f7f74fd35462dced087280af066cf2cad7596.tar.gz lombok-199f7f74fd35462dced087280af066cf2cad7596.tar.bz2 lombok-199f7f74fd35462dced087280af066cf2cad7596.zip |
Generalized the agent mechanism; now 1 lombok.jar can serve as the agent for BOTH netbeans AND eclipse, and is future-ready for an IntelliJ agent.
Diffstat (limited to 'src/eclipseAgent')
-rw-r--r-- | src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java index 7d2a28bc..741328f1 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java +++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java @@ -26,6 +26,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import lombok.core.Agent; import lombok.patcher.Hook; import lombok.patcher.MethodTarget; import lombok.patcher.ScriptManager; @@ -41,15 +42,10 @@ import lombok.patcher.scripts.ScriptBuilder; * classes in this package for more information about which classes are transformed and how they are * transformed. */ -public class EclipsePatcher { - private EclipsePatcher() {} - - public static void agentmain(@SuppressWarnings("unused") String agentArgs, Instrumentation instrumentation) throws Exception { - registerPatchScripts(instrumentation, true); - } - - public static void premain(@SuppressWarnings("unused") String agentArgs, Instrumentation instrumentation) throws Exception { - registerPatchScripts(instrumentation, false); +public class EclipsePatcher extends Agent { + @Override + public void runAgent(String agentArgs, Instrumentation instrumentation, boolean injected) throws Exception { + registerPatchScripts(instrumentation, injected); } private static void registerPatchScripts(Instrumentation instrumentation, boolean reloadExistingClasses) { |