diff options
author | Rawi01 <Rawi01@users.noreply.github.com> | 2021-02-02 09:44:36 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2021-09-06 11:58:05 +0200 |
commit | fdcbaa033d27b344adfea99d8d7bdd99cceacfb3 (patch) | |
tree | 5f385d9d193bd66ac7b5036f0f1b63fce4405cfe /src/core/lombok/javac/handlers/HandleVal.java | |
parent | e050dafc9016519e79184e383eab9ffbd579bebd (diff) | |
download | lombok-fdcbaa033d27b344adfea99d8d7bdd99cceacfb3.tar.gz lombok-fdcbaa033d27b344adfea99d8d7bdd99cceacfb3.tar.bz2 lombok-fdcbaa033d27b344adfea99d8d7bdd99cceacfb3.zip |
Replace val with native final var in Java >= 10
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleVal.java')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleVal.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/lombok/javac/handlers/HandleVal.java b/src/core/lombok/javac/handlers/HandleVal.java index 0ed831ab..d4fb1027 100644 --- a/src/core/lombok/javac/handlers/HandleVal.java +++ b/src/core/lombok/javac/handlers/HandleVal.java @@ -115,6 +115,12 @@ public class HandleVal extends JavacASTAdapter { local.mods.annotations = local.mods.annotations == null ? List.of(valAnnotation) : local.mods.annotations.append(valAnnotation); } + if (localNode.getSourceVersion() >= 10) { + local.vartype = null; + localNode.getAst().setChanged(); + return; + } + if (JavacResolution.platformHasTargetTyping()) { local.vartype = localNode.getAst().getTreeMaker().Ident(localNode.getAst().toName("___Lombok_VAL_Attrib__")); } else { |