src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java
changeset 59021 cfc7bb9a5a92
parent 58713 ad69fd32778e
child 59285 7799a51dbe30
equal deleted inserted replaced
59020:aebd72de84b0 59021:cfc7bb9a5a92
   332         r = scanAndReduce(node.getCases(), p, r);
   332         r = scanAndReduce(node.getCases(), p, r);
   333         return r;
   333         return r;
   334     }
   334     }
   335 
   335 
   336     /**
   336     /**
   337      * {@preview Associated with switch expressions, a preview feature of
   337      * {@inheritDoc} This implementation scans the children in left to right order.
   338      *           the Java language.
   338      *
   339      *
   339      * @param node  {@inheritDoc}
   340      *           This method is associated with <i>switch expressions</i>, a preview
   340      * @param p  {@inheritDoc}
   341      *           feature of the Java language. Preview features
   341      * @return the result of scanning
   342      *           may be removed in a future release, or upgraded to permanent
   342      */
   343      *           features of the Java language.}
   343     @Override
   344      *
       
   345      * {@inheritDoc} This implementation scans the children in left to right order.
       
   346      *
       
   347      * @param node  {@inheritDoc}
       
   348      * @param p  {@inheritDoc}
       
   349      * @return the result of scanning
       
   350      */
       
   351     @Override
       
   352     @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
       
   353     @SuppressWarnings("preview")
       
   354     public R visitSwitchExpression(SwitchExpressionTree node, P p) {
   344     public R visitSwitchExpression(SwitchExpressionTree node, P p) {
   355         R r = scan(node.getExpression(), p);
   345         R r = scan(node.getExpression(), p);
   356         r = scanAndReduce(node.getCases(), p, r);
   346         r = scanAndReduce(node.getCases(), p, r);
   357         return r;
   347         return r;
   358     }
   348     }
   363      * @param node  {@inheritDoc}
   353      * @param node  {@inheritDoc}
   364      * @param p  {@inheritDoc}
   354      * @param p  {@inheritDoc}
   365      * @return the result of scanning
   355      * @return the result of scanning
   366      */
   356      */
   367     @Override
   357     @Override
   368     @SuppressWarnings("preview")
       
   369     public R visitCase(CaseTree node, P p) {
   358     public R visitCase(CaseTree node, P p) {
   370         R r = scan(node.getExpressions(), p);
   359         R r = scan(node.getExpressions(), p);
   371         if (node.getCaseKind() == CaseTree.CaseKind.RULE)
   360         if (node.getCaseKind() == CaseTree.CaseKind.RULE)
   372             r = scanAndReduce(node.getBody(), p, r);
   361             r = scanAndReduce(node.getBody(), p, r);
   373         else
   362         else
   936     public R visitErroneous(ErroneousTree node, P p) {
   925     public R visitErroneous(ErroneousTree node, P p) {
   937         return null;
   926         return null;
   938     }
   927     }
   939 
   928 
   940     /**
   929     /**
   941      * {@preview Associated with switch expressions, a preview feature of
       
   942      *           the Java language.
       
   943      *
       
   944      *           This method is associated with <i>switch expressions</i>, a preview
       
   945      *           feature of the Java language. Preview features
       
   946      *           may be removed in a future release, or upgraded to permanent
       
   947      *           features of the Java language.}
       
   948      *
       
   949      * {@inheritDoc} This implementation returns {@code null}.
   930      * {@inheritDoc} This implementation returns {@code null}.
   950      *
   931      *
   951      * @param node  {@inheritDoc}
   932      * @param node  {@inheritDoc}
   952      * @param p  {@inheritDoc}
   933      * @param p  {@inheritDoc}
   953      * @return the result of scanning
   934      * @return the result of scanning
   954      */
   935      */
   955     @Override
   936     @Override
   956     @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
       
   957     @SuppressWarnings("preview")
       
   958     public R visitYield(YieldTree node, P p) {
   937     public R visitYield(YieldTree node, P p) {
   959         return scan(node.getValue(), p);
   938         return scan(node.getValue(), p);
   960     }
   939     }
   961 }
   940 }