diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2011-01-02 11:57:54 -0300 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2011-01-02 11:57:54 -0300 |
commit | 1d83020a0c9f68b4175044cb937dc13b27ec0986 (patch) | |
tree | 67e8e7859262465945c31c5f1bebd0b4c7cf0e13 /src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java | |
parent | 6da38688de8eafb7b53ca8be0add444ddc116b46 (diff) | |
download | lombok-1d83020a0c9f68b4175044cb937dc13b27ec0986.tar.gz lombok-1d83020a0c9f68b4175044cb937dc13b27ec0986.tar.bz2 lombok-1d83020a0c9f68b4175044cb937dc13b27ec0986.zip |
Should fix issue #175, where annotations mysteriously appear to be copied to the methods generated by them.
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java')
-rw-r--r-- | src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java index e3cae373..ea53835a 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java +++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java @@ -67,6 +67,7 @@ public class EclipsePatcher extends Agent { patchHideGeneratedNodes(sm); patchLiveDebug(sm); patchPostCompileHookEclipse(sm); + patchFixSourceTypeConverter(sm); } else { patchPostCompileHookEcj(sm); } @@ -276,4 +277,15 @@ public class EclipsePatcher extends Agent { PatchDelegate.addPatches(sm, ecj); PatchVal.addPatches(sm, ecj); } + + private static void patchFixSourceTypeConverter(ScriptManager sm) { + final String SOURCE_TYPE_CONVERTER_SIG = "org.eclipse.jdt.internal.compiler.parser.SourceTypeConverter"; + final String I_ANNOTATABLE_SIG = "org.eclipse.jdt.core.IAnnotatable"; + final String ANNOTATION_SIG = "org.eclipse.jdt.internal.compiler.ast.Annotation"; + + sm.addScript(ScriptBuilder.wrapReturnValue() + .target(new MethodTarget(SOURCE_TYPE_CONVERTER_SIG, "convertAnnotations", ANNOTATION_SIG + "[]", I_ANNOTATABLE_SIG)) + .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "convertAnnotations", ANNOTATION_SIG + "[]", ANNOTATION_SIG + "[]", I_ANNOTATABLE_SIG)) + .request(StackRequest.PARAM1, StackRequest.RETURN_VALUE).build()); + } } |