aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2011-12-19 21:42:12 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2011-12-19 21:42:12 +0100
commitab3d3ea0a444d39542605ee5f9c6e2cd8399ddb1 (patch)
tree09a6cddc2a2b4f86334b319380b83f56a8dde169 /src/eclipseAgent/lombok
parentb25a644f50e10540b7cb69189430d932a8750aec (diff)
parentde1bc3524fc23eb9b3e93f8faa0d959a9940b16d (diff)
downloadlombok-ab3d3ea0a444d39542605ee5f9c6e2cd8399ddb1.tar.gz
lombok-ab3d3ea0a444d39542605ee5f9c6e2cd8399ddb1.tar.bz2
lombok-ab3d3ea0a444d39542605ee5f9c6e2cd8399ddb1.zip
Merge branch 'master' of github.com:rzwitserloot/lombok
Diffstat (limited to 'src/eclipseAgent/lombok')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java7
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java7
2 files changed, 13 insertions, 1 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
index 25f7d7ce..1a3828c1 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
@@ -310,6 +310,13 @@ public class EclipsePatcher extends Agent {
.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.wrapReturnValue()
+ .target(new MethodTarget("org.eclipse.jdt.core.dom.ASTConverter", "convertToFieldDeclaration", "org.eclipse.jdt.core.dom.FieldDeclaration", "org.eclipse.jdt.internal.compiler.ast.FieldDeclaration"))
+ .request(StackRequest.PARAM1, 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() {
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
index e027b09d..affcd4f2 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
@@ -38,6 +38,7 @@ import lombok.core.AST.Kind;
import lombok.eclipse.EclipseAST;
import lombok.eclipse.EclipseNode;
import lombok.eclipse.TransformEclipseAST;
+import lombok.eclipse.handlers.SetGeneratedByVisitor;
import org.eclipse.jdt.internal.compiler.CompilationResult;
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
@@ -325,7 +326,11 @@ public class PatchDelegate {
for (BindingTuple pair : methods) {
EclipseNode annNode = typeNode.getAst().get(pair.responsible);
MethodDeclaration method = createDelegateMethod(pair.fieldName, typeNode, pair, top.compilationResult, annNode);
- if (method != null) injectMethod(typeNode, method);
+ if (method != null) {
+ SetGeneratedByVisitor visitor = new SetGeneratedByVisitor(annNode.get());
+ method.traverse(visitor, ((TypeDeclaration)typeNode.get()).scope);
+ injectMethod(typeNode, method);
+ }
}
}