diff -r 14e098407bb0 -r ad69fd32778e src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java Mon Oct 21 15:11:44 2019 +0200 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java Mon Oct 21 15:38:26 2019 +0200 @@ -47,7 +47,6 @@ import javax.tools.JavaFileManager.Location; -import com.sun.source.tree.CaseTree.CaseKind; import com.sun.source.tree.ModuleTree.ModuleKind; import com.sun.tools.javac.code.Directive.ExportsDirective; import com.sun.tools.javac.code.Directive.OpensDirective; @@ -1250,17 +1249,17 @@ public static class JCCase extends JCStatement implements CaseTree { //as CaseKind is deprecated for removal (as it is part of a preview feature), //using indirection through these fields to avoid unnecessary @SuppressWarnings: - @SuppressWarnings("removal") + @SuppressWarnings("preview") public static final CaseKind STATEMENT = CaseKind.STATEMENT; - @SuppressWarnings("removal") + @SuppressWarnings("preview") public static final CaseKind RULE = CaseKind.RULE; - @SuppressWarnings("removal") + @SuppressWarnings("preview") public final CaseKind caseKind; public List pats; public List stats; public JCTree body; public boolean completesNormally; - protected JCCase(@SuppressWarnings("removal") CaseKind caseKind, List pats, + protected JCCase(@SuppressWarnings("preview") CaseKind caseKind, List pats, List stats, JCTree body) { Assert.checkNonNull(pats); Assert.check(pats.isEmpty() || pats.head != null); @@ -1277,18 +1276,18 @@ @Override @DefinedBy(Api.COMPILER_TREE) public JCExpression getExpression() { return pats.head; } @Override @DefinedBy(Api.COMPILER_TREE) - @SuppressWarnings("removal") + @SuppressWarnings("preview") public List getExpressions() { return pats; } @Override @DefinedBy(Api.COMPILER_TREE) - @SuppressWarnings("removal") + @SuppressWarnings("preview") public List getStatements() { return caseKind == CaseKind.STATEMENT ? stats : null; } @Override @DefinedBy(Api.COMPILER_TREE) - @SuppressWarnings("removal") + @SuppressWarnings("preview") public JCTree getBody() { return body; } @Override @DefinedBy(Api.COMPILER_TREE) - @SuppressWarnings("removal") + @SuppressWarnings("preview") public CaseKind getCaseKind() { return caseKind; } @@ -1305,7 +1304,7 @@ /** * A "switch ( ) { }" construction. */ - @SuppressWarnings("removal") + @SuppressWarnings("preview") public static class JCSwitchExpression extends JCPolyExpression implements SwitchExpressionTree { public JCExpression selector; public List cases; @@ -1586,7 +1585,7 @@ /** * A break-with from a switch expression. */ - @SuppressWarnings("removal") + @SuppressWarnings("preview") public static class JCYield extends JCStatement implements YieldTree { public JCExpression value; public JCTree target; @@ -3105,7 +3104,7 @@ JCLabeledStatement Labelled(Name label, JCStatement body); JCSwitch Switch(JCExpression selector, List cases); JCSwitchExpression SwitchExpression(JCExpression selector, List cases); - JCCase Case(@SuppressWarnings("removal") CaseKind caseKind, List pat, + JCCase Case(@SuppressWarnings("preview") CaseTree.CaseKind caseKind, List pat, List stats, JCTree body); JCSynchronized Synchronized(JCExpression lock, JCBlock body); JCTry Try(JCBlock body, List catchers, JCBlock finalizer);