aboutsummaryrefslogtreecommitdiff
path: root/src/utils/lombok/javac/JavacTreeMaker.java
diff options
context:
space:
mode:
authorRawi01 <Rawi01@users.noreply.github.com>2022-08-26 00:49:42 +0200
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2023-01-12 00:37:54 +0100
commitfedc92663e563079c3b6a09c58ab3f73372000fe (patch)
treec0852bed93a30b575bf00ae9898d5996b0e765b7 /src/utils/lombok/javac/JavacTreeMaker.java
parent79fdad30d939cd17a766de3af10faa25a20d3395 (diff)
downloadlombok-fedc92663e563079c3b6a09c58ab3f73372000fe.tar.gz
lombok-fedc92663e563079c3b6a09c58ab3f73372000fe.tar.bz2
lombok-fedc92663e563079c3b6a09c58ab3f73372000fe.zip
[jdk19] Add support for JCConstantCaseLabel
Diffstat (limited to 'src/utils/lombok/javac/JavacTreeMaker.java')
-rw-r--r--src/utils/lombok/javac/JavacTreeMaker.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/lombok/javac/JavacTreeMaker.java b/src/utils/lombok/javac/JavacTreeMaker.java
index d369b4e4..09855951 100644
--- a/src/utils/lombok/javac/JavacTreeMaker.java
+++ b/src/utils/lombok/javac/JavacTreeMaker.java
@@ -610,6 +610,8 @@ public class JavacTreeMaker {
List<JCTree> labels;
if (pat == null) {
labels = tryResolve(DefaultCaseLabel) ? List.of(DefaultCaseLabel()) : List.<JCTree>nil();
+ } else if (tryResolve(ConstantCaseLabel)) {
+ labels = List.<JCTree>of(ConstantCaseLabel(pat));
} else {
labels = List.<JCTree>of(pat);
}
@@ -622,6 +624,12 @@ public class JavacTreeMaker {
return invoke(DefaultCaseLabel);
}
+ //javac versions: 19
+ private static final MethodId<JCTree> ConstantCaseLabel = MethodId("ConstantCaseLabel", JCTree.class, JCExpression.class);
+ public JCTree ConstantCaseLabel(JCExpression expr) {
+ return invoke(ConstantCaseLabel, expr);
+ }
+
//javac versions: 6-8
private static final MethodId<JCSynchronized> Synchronized = MethodId("Synchronized");
public JCSynchronized Synchronized(JCExpression lock, JCBlock body) {