aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/HandleSynchronized.java
diff options
context:
space:
mode:
authorRawi01 <Rawi01@users.noreply.github.com>2021-01-26 22:55:08 +0100
committerRoel Spilker <r.spilker@gmail.com>2021-01-28 19:40:41 +0100
commita234a8e1d1dadc6990f8b8f1d87e93757beafe1c (patch)
treef22ae294875d08641e5ea300dedc38c873ceb9e8 /src/core/lombok/javac/handlers/HandleSynchronized.java
parent04f17f4dcfbb0e7881d605708467498e3ec56521 (diff)
downloadlombok-a234a8e1d1dadc6990f8b8f1d87e93757beafe1c.tar.gz
lombok-a234a8e1d1dadc6990f8b8f1d87e93757beafe1c.tar.bz2
lombok-a234a8e1d1dadc6990f8b8f1d87e93757beafe1c.zip
[fixes #2691] Add end positions to all generated nodes
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleSynchronized.java')
-rw-r--r--src/core/lombok/javac/handlers/HandleSynchronized.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/lombok/javac/handlers/HandleSynchronized.java b/src/core/lombok/javac/handlers/HandleSynchronized.java
index b6f1e47f..f7ac50e7 100644
--- a/src/core/lombok/javac/handlers/HandleSynchronized.java
+++ b/src/core/lombok/javac/handlers/HandleSynchronized.java
@@ -46,7 +46,6 @@ import com.sun.tools.javac.tree.JCTree.JCNewArray;
import com.sun.tools.javac.tree.JCTree.JCStatement;
import com.sun.tools.javac.tree.JCTree.JCTypeParameter;
import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
-import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.List;
/**
@@ -87,7 +86,6 @@ public class HandleSynchronized extends JavacAnnotationHandler<Synchronized> {
}
JavacTreeMaker maker = methodNode.getTreeMaker().at(ast.pos);
- Context context = methodNode.getContext();
JavacNode typeNode = upToTypeNode(annotationNode);
@@ -120,7 +118,7 @@ public class HandleSynchronized extends JavacAnnotationHandler<Synchronized> {
List.<JCExpression>of(maker.Literal(CTC_INT, 0)), null);
JCVariableDecl fieldDecl = recursiveSetGeneratedBy(maker.VarDef(
maker.Modifiers(Flags.PRIVATE | Flags.FINAL | (isStatic[0] ? Flags.STATIC : 0)),
- methodNode.toName(lockName), objectType, newObjectArray), ast, context);
+ methodNode.toName(lockName), objectType, newObjectArray), annotationNode);
injectFieldAndMarkGenerated(methodNode.up(), fieldDecl);
}
@@ -133,8 +131,8 @@ public class HandleSynchronized extends JavacAnnotationHandler<Synchronized> {
lockNode = maker.Select(maker.Ident(methodNode.toName("this")), methodNode.toName(lockName));
}
- recursiveSetGeneratedBy(lockNode, ast, context);
- method.body = setGeneratedBy(maker.Block(0, List.<JCStatement>of(setGeneratedBy(maker.Synchronized(lockNode, method.body), ast, context))), ast, context);
+ recursiveSetGeneratedBy(lockNode, annotationNode);
+ method.body = setGeneratedBy(maker.Block(0, List.<JCStatement>of(setGeneratedBy(maker.Synchronized(lockNode, method.body), annotationNode))), annotationNode);
methodNode.rebuild();
}