aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/HandleVal.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/HandleVal.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/HandleVal.java')
-rw-r--r--src/core/lombok/javac/handlers/HandleVal.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/lombok/javac/handlers/HandleVal.java b/src/core/lombok/javac/handlers/HandleVal.java
index 23c27bc0..54645354 100644
--- a/src/core/lombok/javac/handlers/HandleVal.java
+++ b/src/core/lombok/javac/handlers/HandleVal.java
@@ -63,6 +63,7 @@ public class HandleVal extends JavacASTAdapter {
JCTree typeTree = local.vartype;
if (typeTree == null) return;
String typeTreeToString = typeTree.toString();
+ JavacNode typeNode = localNode.getNodeFor(typeTree);
if (!(eq(typeTreeToString, "val") || eq(typeTreeToString, "var"))) return;
boolean isVal = typeMatches(val.class, localNode, typeTree);
@@ -111,7 +112,7 @@ public class HandleVal extends JavacASTAdapter {
if (isVal) local.mods.flags |= Flags.FINAL;
if (!localNode.shouldDeleteLombokAnnotations()) {
- JCAnnotation valAnnotation = recursiveSetGeneratedBy(localNode.getTreeMaker().Annotation(local.vartype, List.<JCExpression>nil()), typeTree, localNode.getContext());
+ JCAnnotation valAnnotation = recursiveSetGeneratedBy(localNode.getTreeMaker().Annotation(local.vartype, List.<JCExpression>nil()), typeNode);
local.mods.annotations = local.mods.annotations == null ? List.of(valAnnotation) : local.mods.annotations.append(valAnnotation);
}
@@ -182,7 +183,7 @@ public class HandleVal extends JavacASTAdapter {
local.vartype = JavacResolution.createJavaLangObject(localNode.getAst());
throw e;
} finally {
- recursiveSetGeneratedBy(local.vartype, typeTree, localNode.getContext());
+ recursiveSetGeneratedBy(local.vartype, typeNode);
}
}
}