diff options
author | jvanderhel <Jappe.vanderhel@gmail.com> | 2011-11-11 20:38:58 +0100 |
---|---|---|
committer | jvanderhel <Jappe.vanderhel@gmail.com> | 2011-11-11 20:47:14 +0100 |
commit | b43cd3509311e25b64a559cd7dd02d11a45d9f0e (patch) | |
tree | 1ff7cce77972d05b8e376e398383fe33f25f1008 /src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java | |
parent | 9c469dc72ab58be4bcf175f077ba7124df8ef5f4 (diff) | |
download | lombok-b43cd3509311e25b64a559cd7dd02d11a45d9f0e.tar.gz lombok-b43cd3509311e25b64a559cd7dd02d11a45d9f0e.tar.bz2 lombok-b43cd3509311e25b64a559cd7dd02d11a45d9f0e.zip |
Lombok generated members are now handled better in a ListRewrite (like generate equals & hashcode)
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java')
-rw-r--r-- | src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java index b8418a6d..195cdf6c 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java +++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java @@ -89,6 +89,7 @@ public class EclipsePatcher extends Agent { patchHideGeneratedNodes(sm); patchPostCompileHookEclipse(sm); patchFixSourceTypeConverter(sm); + patchListRewriteHandleGeneratedMethods(sm); } else { patchPostCompileHookEcj(sm); } @@ -99,6 +100,14 @@ public class EclipsePatcher extends Agent { if (reloadExistingClasses) sm.reloadClasses(instrumentation); } + private static void patchListRewriteHandleGeneratedMethods(ScriptManager sm) { + sm.addScript(ScriptBuilder.replaceMethodCall() + .target(new MethodTarget("org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ListRewriter", "rewriteList")) + .methodToReplace(new Hook("org.eclipse.jdt.internal.core.dom.rewrite.RewriteEvent", "getChildren", "org.eclipse.jdt.internal.core.dom.rewrite.RewriteEvent[]")) + .replacementMethod(new Hook("lombok.eclipse.agent.PatchFixes", "listRewriteHandleGeneratedMethods", "org.eclipse.jdt.internal.core.dom.rewrite.RewriteEvent[]", "org.eclipse.jdt.internal.core.dom.rewrite.RewriteEvent")) + .build()); + } + private static void patchDomAstReparseIssues(ScriptManager sm) { sm.addScript(ScriptBuilder.replaceMethodCall() .target(new MethodTarget("org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer", "visit")) |