diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2023-01-11 22:54:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-11 22:54:04 +0100 |
commit | 9388dbc1a990386dd7b3af6ac65e123f7cd89013 (patch) | |
tree | 32013941432178d435da9b1ae07ac6b1faa10927 /src/utils/lombok/javac | |
parent | 3705ac615a34191e3f05bf02329a9ffe09d5fa65 (diff) | |
parent | 479bd2d75d2046ee1cb337ef6aa929b707868345 (diff) | |
download | lombok-9388dbc1a990386dd7b3af6ac65e123f7cd89013.tar.gz lombok-9388dbc1a990386dd7b3af6ac65e123f7cd89013.tar.bz2 lombok-9388dbc1a990386dd7b3af6ac65e123f7cd89013.zip |
Merge pull request #3251 from Rawi01/jdk19
Add support for JDK 19
Diffstat (limited to 'src/utils/lombok/javac')
-rw-r--r-- | src/utils/lombok/javac/JavacTreeMaker.java | 8 |
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) { |