diff options
author | jvanderhel <Jappe.vanderhel@gmail.com> | 2011-11-11 20:33:18 +0100 |
---|---|---|
committer | jvanderhel <Jappe.vanderhel@gmail.com> | 2011-11-11 20:47:05 +0100 |
commit | 9c469dc72ab58be4bcf175f077ba7124df8ef5f4 (patch) | |
tree | 05a506645b2defefeee6e989c1f0b5891479fc57 /src/eclipseAgent/lombok/eclipse/agent | |
parent | 9433db4ecdf1a525541581a73161ababee0c352c (diff) | |
download | lombok-9c469dc72ab58be4bcf175f077ba7124df8ef5f4.tar.gz lombok-9c469dc72ab58be4bcf175f077ba7124df8ef5f4.tar.bz2 lombok-9c469dc72ab58be4bcf175f077ba7124df8ef5f4.zip |
MethodDeclarations and their SimpleName(s) are now marked as generated when using eclipse 3.7 M5 or higher (when appropriate)
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent')
-rw-r--r-- | src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java index b52a3b23..b8418a6d 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java +++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java @@ -225,6 +225,13 @@ public class EclipsePatcher extends Agent { "org.eclipse.jdt.core.dom.ASTNode", "org.eclipse.jdt.internal.compiler.ast.ASTNode")) .transplant().build()); + sm.addScript(ScriptBuilder.wrapReturnValue() + .target(new MethodTarget("org.eclipse.jdt.core.dom.ASTConverter", "convert", "org.eclipse.jdt.core.dom.ASTNode", "boolean", "org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration")) + .request(StackRequest.PARAM2, StackRequest.RETURN_VALUE) + .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "setIsGeneratedFlag", "void", + "org.eclipse.jdt.core.dom.ASTNode", "org.eclipse.jdt.internal.compiler.ast.ASTNode")) + .transplant().build()); + sm.addScript(ScriptBuilder.wrapMethodCall() .target(new TargetMatcher() { @Override public boolean matches(String classSpec, String methodName, String descriptor) { @@ -245,6 +252,14 @@ public class EclipsePatcher extends Agent { .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "setIsGeneratedFlagForSimpleName", "void", "org.eclipse.jdt.core.dom.SimpleName", "java.lang.Object")) .transplant().build()); + + sm.addScript(ScriptBuilder.wrapMethodCall() + .target(new MethodTarget("org.eclipse.jdt.core.dom.ASTConverter", "convert", "org.eclipse.jdt.core.dom.ASTNode", "boolean", "org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration")) + .methodToWrap(new Hook("org.eclipse.jdt.core.dom.SimpleName", "<init>", "void", "org.eclipse.jdt.core.dom.AST")) + .requestExtra(StackRequest.PARAM2) + .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "setIsGeneratedFlagForSimpleName", "void", + "org.eclipse.jdt.core.dom.SimpleName", "java.lang.Object")) + .transplant().build()); } private static void patchAvoidReparsingGeneratedCode(ScriptManager sm) { |