src/jdk.compiler/share/classes/com/sun/source/tree/CaseTree.java
branchJDK-8226585-branch
changeset 58109 ee07de0d2c16
parent 57706 7ac414640ad5
child 58440 4c8a6d1d066c
equal deleted inserted replaced
58018:a3c63a9dfb2c 58109:ee07de0d2c16
    59      * For default case, returns an empty list.
    59      * For default case, returns an empty list.
    60      *
    60      *
    61      * @return labels for this case
    61      * @return labels for this case
    62      * @since 12
    62      * @since 12
    63      *
    63      *
    64      * @deprecated This method is modeling a case with multiple labels,
    64      * @preview This method is modeling a case with multiple labels,
    65      * which is part of a preview feature and may be removed
    65      * which is part of a preview feature and may be removed
    66      * if the preview feature is removed.
    66      * if the preview feature is removed.
    67      */
    67      */
    68     @Deprecated(forRemoval=true, since="12")
    68     @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
    69     List<? extends ExpressionTree> getExpressions();
    69     List<? extends ExpressionTree> getExpressions();
    70 
    70 
    71     /**
    71     /**
    72      * For case with kind {@linkplain CaseKind#STATEMENT},
    72      * For case with kind {@linkplain CaseKind#STATEMENT},
    73      * returns the statements labeled by the case.
    73      * returns the statements labeled by the case.
    84      * {@linkplain CaseKind#STATEMENT}.
    84      * {@linkplain CaseKind#STATEMENT}.
    85      *
    85      *
    86      * @return case value or null
    86      * @return case value or null
    87      * @since 12
    87      * @since 12
    88      *
    88      *
    89      * @deprecated This method is modeling a rule case,
    89      * @preview This method is modeling a rule case,
    90      * which is part of a preview feature and may be removed
    90      * which is part of a preview feature and may be removed
    91      * if the preview feature is removed.
    91      * if the preview feature is removed.
    92      */
    92      */
    93     @Deprecated(forRemoval=true, since="12")
    93     @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
    94     public default Tree getBody() {
    94     public default Tree getBody() {
    95         return null;
    95         return null;
    96     }
    96     }
    97 
    97 
    98     /**
    98     /**
    99      * Returns the kind of this case.
    99      * Returns the kind of this case.
   100      *
   100      *
   101      * @return the kind of this case
   101      * @return the kind of this case
   102      * @since 12
   102      * @since 12
   103      *
   103      *
   104      * @deprecated This method is used to model a rule case,
   104      * @preview This method is used to model a rule case,
   105      * which is part of a preview feature and may be removed
   105      * which is part of a preview feature and may be removed
   106      * if the preview feature is removed.
   106      * if the preview feature is removed.
   107      */
   107      */
   108     @Deprecated(forRemoval=true, since="12")
   108     @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
       
   109     @SuppressWarnings("preview")
   109     public default CaseKind getCaseKind() {
   110     public default CaseKind getCaseKind() {
   110         return CaseKind.STATEMENT;
   111         return CaseKind.STATEMENT;
   111     }
   112     }
   112 
   113 
   113     /**
   114     /**
   117      *     <li>RULE: {@code case <expression> -> <expression>/<statement>}</li>
   118      *     <li>RULE: {@code case <expression> -> <expression>/<statement>}</li>
   118      * </ul>
   119      * </ul>
   119      *
   120      *
   120      * @since 12
   121      * @since 12
   121      *
   122      *
   122      * @deprecated This enum is used to model a rule case,
   123      * @preview This enum is used to model a rule case,
   123      * which is part of a preview feature and may be removed
   124      * which is part of a preview feature and may be removed
   124      * if the preview feature is removed.
   125      * if the preview feature is removed.
   125      */
   126      */
   126     @Deprecated(forRemoval=true, since="12")
   127     @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
       
   128     @SuppressWarnings("preview")
   127     public enum CaseKind {
   129     public enum CaseKind {
   128         /**
   130         /**
   129          * Case is in the form: {@code case <expression>: <statements>}.
   131          * Case is in the form: {@code case <expression>: <statements>}.
   130          */
   132          */
   131         STATEMENT,
   133         STATEMENT,