Fix for Issue 315: HandleLogger now sets all its sourcepositions and generatedBy's. convertToFieldDeclaration now als marks the resulting FieldDeclaration as isGenerated

This commit is contained in:
jvanderhel committed 2011-12-13 00:32:48 +01:00
1 parent b476825fc7
commit 71c48fb991
2 files changed
+10 -1

No files matched your search

@@ -71,7 +71,9 @@ public class HandleLog {
ClassLiteralAccess loggingType = selfType(owner, source);
injectField(owner, createField(framework, source, loggingType));
FieldDeclaration fieldDeclaration = createField(framework, source, loggingType);
fieldDeclaration.traverse(new SetGeneratedByVisitor(source), typeDecl.staticInitializerScope);
injectField(owner, fieldDeclaration);
owner.rebuild();
break;
default:
@@ -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() {