diff options
author | Rawi01 <Rawi01@users.noreply.github.com> | 2021-01-26 22:55:08 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2021-01-28 19:40:41 +0100 |
commit | a234a8e1d1dadc6990f8b8f1d87e93757beafe1c (patch) | |
tree | f22ae294875d08641e5ea300dedc38c873ceb9e8 /src/core/lombok/javac/handlers/HandleCleanup.java | |
parent | 04f17f4dcfbb0e7881d605708467498e3ec56521 (diff) | |
download | lombok-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/HandleCleanup.java')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleCleanup.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/lombok/javac/handlers/HandleCleanup.java b/src/core/lombok/javac/handlers/HandleCleanup.java index 4aa61764..12c3b1e9 100644 --- a/src/core/lombok/javac/handlers/HandleCleanup.java +++ b/src/core/lombok/javac/handlers/HandleCleanup.java @@ -52,7 +52,6 @@ import com.sun.tools.javac.tree.JCTree.JCMethodInvocation; import com.sun.tools.javac.tree.JCTree.JCStatement; import com.sun.tools.javac.tree.JCTree.JCTypeCast; import com.sun.tools.javac.tree.JCTree.JCVariableDecl; -import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.ListBuffer; import com.sun.tools.javac.util.Name; @@ -129,10 +128,9 @@ public class HandleCleanup extends JavacAnnotationHandler<Cleanup> { JCIf ifNotNullCleanup = maker.If(isNull, maker.Block(0, cleanupCall), null); - Context context = annotationNode.getContext(); - JCBlock finalizer = recursiveSetGeneratedBy(maker.Block(0, List.<JCStatement>of(ifNotNullCleanup)), ast, context); + JCBlock finalizer = recursiveSetGeneratedBy(maker.Block(0, List.<JCStatement>of(ifNotNullCleanup)), annotationNode); - newStatements.append(setGeneratedBy(maker.Try(setGeneratedBy(maker.Block(0, tryBlock.toList()), ast, context), List.<JCCatch>nil(), finalizer), ast, context)); + newStatements.append(setGeneratedBy(maker.Try(setGeneratedBy(maker.Block(0, tryBlock.toList()), annotationNode), List.<JCCatch>nil(), finalizer), annotationNode)); if (blockNode instanceof JCBlock) { ((JCBlock)blockNode).stats = newStatements.toList(); |