aboutsummaryrefslogtreecommitdiff
path: root/src/utils/lombok/javac/JavacTreeMaker.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2021-09-16 02:07:26 +0200
committerGitHub <noreply@github.com>2021-09-16 02:07:26 +0200
commitd09d995a8ecbd15428eac92150b1d7b55a525d2c (patch)
tree3b61fab8d931e610ce271735cdbac234cdf94726 /src/utils/lombok/javac/JavacTreeMaker.java
parent14aaf25ede37228f186a7029aa9567353eb539ca (diff)
parentf516dd8ab3186121c4a880444302e2f980f393f8 (diff)
downloadlombok-d09d995a8ecbd15428eac92150b1d7b55a525d2c.tar.gz
lombok-d09d995a8ecbd15428eac92150b1d7b55a525d2c.tar.bz2
lombok-d09d995a8ecbd15428eac92150b1d7b55a525d2c.zip
Merge pull request #2936 from Rawi01/jdk-17
Add support for JDK17
Diffstat (limited to 'src/utils/lombok/javac/JavacTreeMaker.java')
-rw-r--r--src/utils/lombok/javac/JavacTreeMaker.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/utils/lombok/javac/JavacTreeMaker.java b/src/utils/lombok/javac/JavacTreeMaker.java
index 30d71606..d369b4e4 100644
--- a/src/utils/lombok/javac/JavacTreeMaker.java
+++ b/src/utils/lombok/javac/JavacTreeMaker.java
@@ -607,7 +607,19 @@ public class JavacTreeMaker {
public JCCase Case(JCExpression pat, List<JCStatement> stats) {
if (tryResolve(Case11)) return invoke(Case11, pat, stats);
- return invoke(Case12.Case12, Case12.CASE_KIND_STATEMENT, pat == null ? com.sun.tools.javac.util.List.nil() : com.sun.tools.javac.util.List.of(pat), stats, null);
+ List<JCTree> labels;
+ if (pat == null) {
+ labels = tryResolve(DefaultCaseLabel) ? List.of(DefaultCaseLabel()) : List.<JCTree>nil();
+ } else {
+ labels = List.<JCTree>of(pat);
+ }
+ return invoke(Case12.Case12, Case12.CASE_KIND_STATEMENT, labels, stats, null);
+ }
+
+ //javac versions: 17
+ private static final MethodId<JCTree> DefaultCaseLabel = MethodId("DefaultCaseLabel", JCTree.class);
+ public JCTree DefaultCaseLabel() {
+ return invoke(DefaultCaseLabel);
}
//javac versions: 6-8