< prev index next >
src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java
Print this page
rev 60024 : imported patch 8248641
*** 152,162 ****
@DefinedBy(Api.COMPILER_TREE)
public JCTree visitCase(CaseTree node, P p) {
JCCase t = (JCCase) node;
List<JCExpression> pats = copy(t.pats, p);
List<JCStatement> stats = copy(t.stats, p);
! JCTree body = copy(t.body, p);
return M.at(t.pos).Case(t.caseKind, pats, stats, body);
}
@DefinedBy(Api.COMPILER_TREE)
public JCTree visitCatch(CatchTree node, P p) {
--- 152,163 ----
@DefinedBy(Api.COMPILER_TREE)
public JCTree visitCase(CaseTree node, P p) {
JCCase t = (JCCase) node;
List<JCExpression> pats = copy(t.pats, p);
List<JCStatement> stats = copy(t.stats, p);
! JCTree body = t.body instanceof JCExpression && t.stats.head.hasTag(Tag.YIELD)
! ? ((JCYield) t.stats.head).value : t.stats.head;
return M.at(t.pos).Case(t.caseKind, pats, stats, body);
}
@DefinedBy(Api.COMPILER_TREE)
public JCTree visitCatch(CatchTree node, P p) {
< prev index next >