changeset 55892:4607ed53ae2e switch2

Introducing break-with statement (not disambiguation changes yet).
author jlahoda
date Tue, 23 Apr 2019 16:21:07 +0200
parents e5c7a01a6e46
children 427b3a55b5d4
files src/jdk.compiler/share/classes/com/sun/source/tree/BreakTree.java src/jdk.compiler/share/classes/com/sun/source/tree/BreakWithTree.java src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/CRTable.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java src/jdk.compiler/share/classes/com/sun/tools/javac/parser/Tokens.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java test/langtools/tools/javac/lib/DPrinter.java test/langtools/tools/javac/parser/JavacParserTest.java test/langtools/tools/javac/switchexpr/BreakTest.java test/langtools/tools/javac/switchexpr/DefiniteAssignment1.java test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java test/langtools/tools/javac/switchexpr/ExpressionSwitch.java test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks1.java test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.java test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.out test/langtools/tools/javac/switchexpr/ExpressionSwitchBugs.java test/langtools/tools/javac/switchexpr/ExpressionSwitchDA.java test/langtools/tools/javac/switchexpr/ExpressionSwitchEmbedding.java test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough.java test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough1.java test/langtools/tools/javac/switchexpr/ExpressionSwitchFlow.java test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.java test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.out test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.java test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.out test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java test/langtools/tools/javac/switchexpr/ParseIncomplete.java test/langtools/tools/javac/switchexpr/SwitchExpressionIsNotAConstant.java test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.java test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.out test/langtools/tools/javac/switchexpr/SwitchExpressionSimpleVisitorTest.java test/langtools/tools/javac/switchexpr/TryCatch.java test/langtools/tools/javac/switchextra/MultipleLabelsExpression.java
diffstat 54 files changed, 706 insertions(+), 476 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/source/tree/BreakTree.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/BreakTree.java	Tue Apr 23 16:21:07 2019 +0200
@@ -35,8 +35,6 @@
  *   break;
  *
  *   break <em>label</em> ;
- *
- *   break <em>expression</em> ;
  * </pre>
  *
  * @jls section 14.15
@@ -52,17 +50,4 @@
      */
     Name getLabel();
 
-    /**
-     * Returns the expression for this {@code break} statement.
-     *
-     * @return the expression
-     * @since 12
-     *
-     * @deprecated This method is modeling value breaks, which are part of
-     * a preview feature and may be removed if the preview feature
-     * is removed.
-     *
-     */
-    @Deprecated(forRemoval=true, since="12")
-    ExpressionTree getValue();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/BreakWithTree.java	Tue Apr 23 16:21:07 2019 +0200
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.source.tree;
+
+/**
+ * A tree node for a {@code break-with} statement.
+ *
+ * For example:
+ * <pre>
+ *   break <em>expression</em> ;
+ * </pre>
+ *
+ * @jls section TODO
+ *
+ * @since 13
+ *
+ * @deprecated This method is modeling breaks from switch expressions,
+ * which are part of a preview feature and may be removed if
+ * the preview feature is removed.
+ */
+@Deprecated(forRemoval=true, since="13")
+public interface BreakWithTree extends StatementTree {
+
+    /**
+     * Returns the expression for this {@code break-with} statement.
+     *
+     * @return the expression
+     */
+    ExpressionTree getValue();
+}
--- a/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java	Tue Apr 23 16:21:07 2019 +0200
@@ -94,6 +94,20 @@
         BREAK(BreakTree.class),
 
         /**
+         * Used for instances of {@link BreakTree}.
+         *
+         * @since 13
+         *
+         * @deprecated
+         * This enum constant is modeling break-with,
+         * which are part of a preview feature and may be removed
+         * if the preview feature is removed.
+         */
+        @Deprecated(forRemoval=true, since="13")
+        @SuppressWarnings("removal")
+        BREAK_WITH(BreakWithTree.class),
+
+        /**
          * Used for instances of {@link CaseTree}.
          */
         CASE(CaseTree.class),
--- a/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java	Tue Apr 23 16:21:07 2019 +0200
@@ -130,6 +130,22 @@
     R visitBreak(BreakTree node, P p);
 
     /**
+     * Visits a BreakWithTree node.
+     * @param node the node being visited
+     * @param p a parameter value
+     * @return a result value
+     * @since 13
+     *
+     * @deprecated
+     * This method is modeling break with,
+     * which are part of a preview feature and may be removed
+     * if the preview feature is removed.
+     */
+    @Deprecated(forRemoval=true, since="13")
+    @SuppressWarnings("removal")
+    R visitBreakWith(BreakWithTree node, P p);
+
+    /**
      * Visits a CaseTree node.
      * @param node the node being visited
      * @param p a parameter value
--- a/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java	Tue Apr 23 16:21:07 2019 +0200
@@ -386,6 +386,20 @@
      * @return  the result of {@code defaultAction}
      */
     @Override
+    @Deprecated(forRemoval=true, since="13")
+    @SuppressWarnings("removal")
+    public R visitBreakWith(BreakWithTree node, P p) {
+        return defaultAction(node, p);
+    }
+
+    /**
+     * {@inheritDoc} This implementation calls {@code defaultAction}.
+     *
+     * @param node {@inheritDoc}
+     * @param p {@inheritDoc}
+     * @return  the result of {@code defaultAction}
+     */
+    @Override
     public R visitContinue(ContinueTree node, P p) {
         return defaultAction(node, p);
     }
--- a/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java	Tue Apr 23 16:21:07 2019 +0200
@@ -467,8 +467,26 @@
      * @return the result of scanning
      */
     @Override
+    public R visitBreak(BreakTree node, P p) {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc} This implementation returns {@code null}.
+     *
+     * @param node  {@inheritDoc}
+     * @param p  {@inheritDoc}
+     * @return the result of scanning
+     *
+     * @deprecated
+     * This method is modeling switch expressions,
+     * which are part of a preview feature and may be removed
+     * if the preview feature is removed.
+     */
+    @Override
+    @Deprecated(forRemoval=true, since="13")
     @SuppressWarnings("removal")
-    public R visitBreak(BreakTree node, P p) {
+    public R visitBreakWith(BreakWithTree node, P p) {
         return scan(node.getValue(), p);
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java	Tue Apr 23 16:21:07 2019 +0200
@@ -77,6 +77,7 @@
 import static com.sun.tools.javac.code.TypeTag.FORALL;
 import static com.sun.tools.javac.code.TypeTag.METHOD;
 import static com.sun.tools.javac.code.TypeTag.VOID;
+import com.sun.tools.javac.tree.JCTree.JCBreakWith;
 
 /**
  * This class performs attribution of method/constructor arguments when target-typing is enabled
@@ -468,7 +469,7 @@
      */
     class SwitchExpressionType extends ArgumentType<JCSwitchExpression> {
         /** List of break expressions (lazily populated). */
-        Optional<List<JCBreak>> breakExpressions = Optional.empty();
+        Optional<List<JCBreakWith>> breakExpressions = Optional.empty();
 
         SwitchExpressionType(JCExpression tree, Env<AttrContext> env, JCSwitchExpression speculativeCond) {
             this(tree, env, speculativeCond, new HashMap<>());
@@ -487,7 +488,7 @@
                 return attr.types.createErrorType(resultInfo.pt);
             } else {
                 //poly
-                for (JCBreak brk : breakExpressions()) {
+                for (JCBreakWith brk : breakExpressions()) {
                     checkSpeculative(brk.value, brk.value.type, resultInfo);
                 }
                 return localInfo.pt;
@@ -495,15 +496,16 @@
         }
 
         /** Compute return expressions (if needed). */
-        List<JCBreak> breakExpressions() {
+        List<JCBreakWith> breakExpressions() {
             return breakExpressions.orElseGet(() -> {
-                final List<JCBreak> res;
-                ListBuffer<JCBreak> buf = new ListBuffer<>();
+                final List<JCBreakWith> res;
+                ListBuffer<JCBreakWith> buf = new ListBuffer<>();
                 new SwitchExpressionScanner() {
                     @Override
-                    public void visitBreak(JCBreak tree) {
+                    public void visitBreakWith(JCBreakWith tree) {
                         if (tree.target == speculativeTree)
                             buf.add(tree);
+                        super.visitBreakWith(tree);
                     }
                 }.scan(speculativeTree.cases);
                 res = buf.toList();
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Apr 23 16:21:07 2019 +0200
@@ -1429,12 +1429,12 @@
             attribStats(c.stats, caseEnv);
             new TreeScanner() {
                 @Override
-                public void visitBreak(JCBreak brk) {
+                public void visitBreakWith(JCBreakWith brk) {
                     if (brk.target == tree) {
                         caseTypePositions.append(brk.value != null ? brk.value.pos() : brk.pos());
                         caseTypes.append(brk.value != null ? brk.value.type : syms.errType);
                     }
-                    super.visitBreak(brk);
+                    super.visitBreakWith(brk);
                 }
 
                 @Override public void visitClassDef(JCClassDecl tree) {}
@@ -1864,67 +1864,33 @@
     }
 
     public void visitBreak(JCBreak tree) {
+        tree.target = findJumpTarget(tree.pos(), tree.getTag(), tree.label, env);
+        result = null;
+    }
+
+    public void visitBreakWith(JCBreakWith tree) {
         if (env.info.breakResult != null) {
-            if (tree.value == null) {
-                tree.target = findJumpTarget(tree.pos(), tree.getTag(), null, env);
-                if (tree.target.hasTag(SWITCH_EXPRESSION)) {
-                    log.error(tree.pos(), Errors.BreakMissingValue);
+            if (env.info.breakResult.pt.hasTag(VOID)) {
+                //can happen?
+                env.info.breakResult.checkContext.report(tree.value.pos(),
+                          diags.fragment(Fragments.UnexpectedRetVal));
+            }
+            attribTree(tree.value, env, env.info.breakResult);
+            JCTree immediateTarget = findJumpTarget(tree.pos(), tree.getTag(), null, env);
+            if (immediateTarget.getTag() != SWITCH_EXPRESSION) {
+                log.error(tree.pos(), Errors.BreakExprNotImmediate(immediateTarget.getTag()));
+                Env<AttrContext> env1 = env;
+                while (env1 != null && env1.tree.getTag() != SWITCH_EXPRESSION) {
+                    env1 = env1.next;
                 }
+                Assert.checkNonNull(env1);
+                tree.target = env1.tree;
             } else {
-                if (env.info.breakResult.pt.hasTag(VOID)) {
-                    //can happen?
-                    env.info.breakResult.checkContext.report(tree.value.pos(),
-                              diags.fragment(Fragments.UnexpectedRetVal));
-                }
-                boolean attribute = true;
-                if (tree.value.hasTag(IDENT)) {
-                    //disambiguate break <LABEL> and break <ident-as-an-expression>:
-                    Name label = ((JCIdent) tree.value).name;
-                    Pair<JCTree, Error> jumpTarget = findJumpTargetNoError(tree.getTag(), label, env);
-
-                    if (jumpTarget.fst != null) {
-                        JCTree speculative = deferredAttr.attribSpeculative(tree.value, env, unknownExprInfo);
-                        if (!speculative.type.hasTag(ERROR)) {
-                            log.error(tree.pos(), Errors.BreakAmbiguousTarget(label));
-                            if (jumpTarget.snd == null) {
-                                tree.target = jumpTarget.fst;
-                                attribute = false;
-                            } else {
-                                //nothing
-                            }
-                        } else {
-                            if (jumpTarget.snd != null) {
-                                log.error(tree.pos(), jumpTarget.snd);
-                            }
-                            tree.target = jumpTarget.fst;
-                            attribute = false;
-                        }
-                    }
-                }
-                if (attribute) {
-                    attribTree(tree.value, env, env.info.breakResult);
-                    JCTree immediateTarget = findJumpTarget(tree.pos(), tree.getTag(), null, env);
-                    if (immediateTarget.getTag() != SWITCH_EXPRESSION) {
-                        log.error(tree.pos(), Errors.BreakExprNotImmediate(immediateTarget.getTag()));
-                        Env<AttrContext> env1 = env;
-                        while (env1 != null && env1.tree.getTag() != SWITCH_EXPRESSION) {
-                            env1 = env1.next;
-                        }
-                        Assert.checkNonNull(env1);
-                        tree.target = env1.tree;
-                    } else {
-                        tree.target = immediateTarget;
-                    }
-                }
+                tree.target = immediateTarget;
             }
         } else {
-            if (tree.value == null || tree.value.hasTag(IDENT)) {
-                Name label = tree.value != null ? ((JCIdent) tree.value).name : null;
-                tree.target = findJumpTarget(tree.pos(), tree.getTag(), label, env);
-            } else {
-                log.error(tree.pos(), Errors.BreakComplexValueNoSwitchExpression);
-                attribTree(tree.value, env, unknownExprInfo);
-            }
+            log.error(tree.pos(), Errors.BreakComplexValueNoSwitchExpression);
+            attribTree(tree.value, env, unknownExprInfo);
         }
         result = null;
     }
@@ -2009,7 +1975,7 @@
                         if (label == null && tag == BREAK) return Pair.of(env1.tree, null);
                         break;
                     case SWITCH_EXPRESSION:
-                        if (tag == BREAK) {
+                        if (tag == BREAK || tag == BREAK_WITH) {
                             if (label == null) {
                                 return Pair.of(env1.tree, null);
                             } else {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Tue Apr 23 16:21:07 2019 +0200
@@ -1161,7 +1161,7 @@
 
         SwitchExpressionScanner() {
             super(EnumSet.of(BLOCK, CASE, CATCH, DOLOOP, FOREACHLOOP,
-                    FORLOOP, IF, BREAK, SYNCHRONIZED, SWITCH, TRY, WHILELOOP));
+                    FORLOOP, IF, BREAK_WITH, SYNCHRONIZED, SWITCH, TRY, WHILELOOP));
         }
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java	Tue Apr 23 16:21:07 2019 +0200
@@ -309,6 +309,12 @@
                     return ((JCBreak)tree).target;
                 }
             },
+            BREAK_WITH(JCTree.Tag.BREAK_WITH) {
+                @Override
+                JCTree getTarget(JCTree tree) {
+                    return ((JCBreakWith)tree).target;
+                }
+            },
             CONTINUE(JCTree.Tag.CONTINUE) {
                 @Override
                 JCTree getTarget(JCTree tree) {
@@ -386,6 +392,11 @@
             return resolveJump(tree, oldPendingExits, JumpKind.BREAK);
         }
 
+        /** Resolve all break-withs of this statement. */
+        Liveness resolveBreakWiths(JCTree tree, ListBuffer<PendingExit> oldPendingExits) {
+            return resolveJump(tree, oldPendingExits, JumpKind.BREAK_WITH);
+        }
+
         @Override
         public void scan(JCTree tree) {
             if (tree != null && (
@@ -400,9 +411,15 @@
         }
 
         protected void scanSyntheticBreak(TreeMaker make, JCTree swtch) {
-            JCBreak brk = make.at(Position.NOPOS).Break(null);
-            brk.target = swtch;
-            scan(brk);
+            if (swtch.hasTag(SWITCH_EXPRESSION)) {
+                JCBreakWith brk = make.at(Position.NOPOS).BreakWith(null);
+                brk.target = swtch;
+                scan(brk);
+            } else {
+                JCBreak brk = make.at(Position.NOPOS).Break(null);
+                brk.target = swtch;
+                scan(brk);
+            }
         }
     }
 
@@ -677,7 +694,7 @@
                 log.error(tree, Errors.NotExhaustive);
             }
             alive = prevAlive;
-            alive = alive.or(resolveBreaks(tree, prevPendingExits));
+            alive = alive.or(resolveBreakWiths(tree, prevPendingExits));
         }
 
         public void visitTry(JCTry tree) {
@@ -745,8 +762,12 @@
         }
 
         public void visitBreak(JCBreak tree) {
-            if (tree.isValueBreak())
-                scan(tree.value);
+            recordExit(new PendingExit(tree));
+        }
+
+        @Override
+        public void visitBreakWith(JCBreakWith tree) {
+            scan(tree.value);
             recordExit(new PendingExit(tree));
         }
 
@@ -1126,7 +1147,11 @@
                 scan(c.pats);
                 scan(c.stats);
             }
-            resolveBreaks(tree, prevPendingExits);
+            if (tree.hasTag(SWITCH_EXPRESSION)) {
+                resolveBreakWiths(tree, prevPendingExits);
+            } else {
+                resolveBreaks(tree, prevPendingExits);
+            }
         }
 
         public void visitTry(JCTry tree) {
@@ -1267,8 +1292,11 @@
             }
 
         public void visitBreak(JCBreak tree) {
-            if (tree.isValueBreak())
-                scan(tree.value);
+            recordExit(new PendingExit(tree));
+        }
+
+        public void visitBreakWith(JCBreakWith tree) {
+            scan(tree.value);
             recordExit(new PendingExit(tree));
         }
 
@@ -2232,7 +2260,11 @@
                     inits.andSet(initsSwitch);
                 }
             }
-            resolveBreaks(tree, prevPendingExits);
+            if (tree.hasTag(SWITCH_EXPRESSION)) {
+                resolveBreakWiths(tree, prevPendingExits);
+            } else {
+                resolveBreaks(tree, prevPendingExits);
+            }
             nextadr = nextadrPrev;
         }
         // where
@@ -2397,34 +2429,37 @@
 
         @Override
         public void visitBreak(JCBreak tree) {
-            if (tree.isValueBreak()) {
-                if (tree.target.hasTag(SWITCH_EXPRESSION)) {
-                    JCSwitchExpression expr = (JCSwitchExpression) tree.target;
-                    if (expr.type.hasTag(BOOLEAN)) {
-                        scanCond(tree.value);
-                        Bits initsAfterBreakWhenTrue = new Bits(initsWhenTrue);
-                        Bits initsAfterBreakWhenFalse = new Bits(initsWhenFalse);
-                        Bits uninitsAfterBreakWhenTrue = new Bits(uninitsWhenTrue);
-                        Bits uninitsAfterBreakWhenFalse = new Bits(uninitsWhenFalse);
-                        PendingExit exit = new PendingExit(tree) {
-                            @Override
-                            void resolveJump() {
-                                if (!inits.isReset()) {
-                                    split(true);
-                                }
-                                initsWhenTrue.andSet(initsAfterBreakWhenTrue);
-                                initsWhenFalse.andSet(initsAfterBreakWhenFalse);
-                                uninitsWhenTrue.andSet(uninitsAfterBreakWhenTrue);
-                                uninitsWhenFalse.andSet(uninitsAfterBreakWhenFalse);
+            recordExit(new AssignPendingExit(tree, inits, uninits));
+        }
+        
+        @Override
+        public void visitBreakWith(JCBreakWith tree) {
+            if (tree.target.hasTag(SWITCH_EXPRESSION)) {
+                JCSwitchExpression expr = (JCSwitchExpression) tree.target;
+                if (expr.type.hasTag(BOOLEAN)) {
+                    scanCond(tree.value);
+                    Bits initsAfterBreakWhenTrue = new Bits(initsWhenTrue);
+                    Bits initsAfterBreakWhenFalse = new Bits(initsWhenFalse);
+                    Bits uninitsAfterBreakWhenTrue = new Bits(uninitsWhenTrue);
+                    Bits uninitsAfterBreakWhenFalse = new Bits(uninitsWhenFalse);
+                    PendingExit exit = new PendingExit(tree) {
+                        @Override
+                        void resolveJump() {
+                            if (!inits.isReset()) {
+                                split(true);
                             }
-                        };
-                        merge();
-                        recordExit(exit);
-                        return ;
-                    }
+                            initsWhenTrue.andSet(initsAfterBreakWhenTrue);
+                            initsWhenFalse.andSet(initsAfterBreakWhenFalse);
+                            uninitsWhenTrue.andSet(uninitsAfterBreakWhenTrue);
+                            uninitsWhenFalse.andSet(uninitsAfterBreakWhenFalse);
+                        }
+                    };
+                    merge();
+                    recordExit(exit);
+                    return ;
                 }
-                scan(tree.value);
             }
+            scan(tree.value);
             recordExit(new AssignPendingExit(tree, inits, uninits));
         }
 
@@ -2788,9 +2823,8 @@
         }
 
         @Override
-        public void visitBreak(JCBreak tree) {
-            if (tree.isValueBreak())
-                scan(tree.value);
+        public void visitBreakWith(JCBreakWith tree) {
+            scan(tree.value);
         }
 
         public void visitModuleDef(JCModuleDecl tree) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java	Tue Apr 23 16:21:07 2019 +0200
@@ -59,6 +59,7 @@
 import static com.sun.tools.javac.code.Symbol.OperatorSymbol.AccessCode.DEREF;
 import static com.sun.tools.javac.jvm.ByteCodes.*;
 import com.sun.tools.javac.tree.JCTree.JCBreak;
+import com.sun.tools.javac.tree.JCTree.JCBreakWith;
 import com.sun.tools.javac.tree.JCTree.JCCase;
 import com.sun.tools.javac.tree.JCTree.JCExpression;
 import com.sun.tools.javac.tree.JCTree.JCExpressionStatement;
@@ -272,9 +273,8 @@
         }
 
         @Override
-        public void visitBreak(JCBreak tree) {
-            if (tree.isValueBreak())
-                scan(tree.value);
+        public void visitBreakWith(JCBreakWith tree) {
+            scan(tree.value);
         }
 
     }
@@ -3224,6 +3224,11 @@
                     if (tree.target == src)
                         tree.target = dest;
                 }
+                public void visitBreakWith(JCBreakWith tree) {
+                    if (tree.target == src)
+                        tree.target = dest;
+                    scan(tree.value);
+                }
                 public void visitContinue(JCContinue tree) {
                     if (tree.target == src)
                         tree.target = dest;
@@ -3676,9 +3681,12 @@
 
     @Override
     public void visitBreak(JCBreak tree) {
-        if (tree.isValueBreak()) {
-            tree.value = translate(tree.value, tree.target.type);
-        }
+        result = tree;
+    }
+
+    @Override
+    public void visitBreakWith(JCBreakWith tree) {
+        tree.value = translate(tree.value, tree.target.type);
         result = tree;
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java	Tue Apr 23 16:21:07 2019 +0200
@@ -620,11 +620,14 @@
 
     @Override
     public void visitBreak(JCBreak tree) {
-        if (tree.isValueBreak()) {
-            tree.value = translate(tree.value, erasure(tree.value.type));
-            tree.value.type = erasure(tree.value.type);
-            tree.value = retype(tree.value, tree.value.type, pt);
-        }
+        result = tree;
+    }
+
+    @Override
+    public void visitBreakWith(JCBreakWith tree) {
+        tree.value = translate(tree.value, erasure(tree.value.type));
+        tree.value.type = erasure(tree.value.type);
+        tree.value = retype(tree.value, tree.value.type, pt);
         result = tree;
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java	Tue Apr 23 16:21:07 2019 +0200
@@ -37,6 +37,7 @@
 import com.sun.tools.javac.tree.JCTree.JCBinary;
 import com.sun.tools.javac.tree.JCTree.JCBlock;
 import com.sun.tools.javac.tree.JCTree.JCBreak;
+import com.sun.tools.javac.tree.JCTree.JCBreakWith;
 import com.sun.tools.javac.tree.JCTree.JCCase;
 import com.sun.tools.javac.tree.JCTree.JCCatch;
 import com.sun.tools.javac.tree.JCTree.JCClassDecl;
@@ -259,6 +260,12 @@
     @Override
     public void visitBreak(JCBreak tree) {
         JCBreak that = (JCBreak) parameter;
+        result = tree.label == that.label;
+    }
+
+    @Override
+    public void visitBreakWith(JCBreakWith tree) {
+        JCBreakWith that = (JCBreakWith) parameter;
         result = scan(tree.value, that.value);
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/CRTable.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/CRTable.java	Tue Apr 23 16:21:07 2019 +0200
@@ -377,6 +377,11 @@
             result = sr;
         }
 
+        public void visitBreakWith(JCBreakWith tree) {
+            SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
+            result = sr;
+        }
+
         public void visitContinue(JCContinue tree) {
             SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
             result = sr;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Tue Apr 23 16:21:07 2019 +0200
@@ -338,6 +338,9 @@
      *  Mark beginning of gap in catch all range for finalizer.
      */
     void genFinalizer(Env<GenContext> env) {
+        if (code == null || env == null || env.info == null) {
+            System.err.println("!!!!");
+        }
         if (code.isAlive() && env.info.finalize != null)
             env.info.finalize.gen();
     }
@@ -1706,46 +1709,48 @@
 
     public void visitBreak(JCBreak tree) {
         Assert.check(code.isStatementStart());
+        final Env<GenContext> targetEnv = unwindBreak(tree.target);
+        targetEnv.info.addExit(code.branch(goto_));
+        endFinalizerGaps(env, targetEnv);
+    }
+
+    public void visitBreakWith(JCBreakWith tree) {
+        Assert.check(code.isStatementStart());
         final Env<GenContext> targetEnv;
-        if (tree.isValueBreak()) {
-            //restore stack as it was before the switch expression:
-            for (LocalItem li : stackBeforeSwitchExpression) {
-                li.load();
+        //restore stack as it was before the switch expression:
+        for (LocalItem li : stackBeforeSwitchExpression) {
+            li.load();
+        }
+        if (inCondSwitchExpression) {
+            CondItem value = genCond(tree.value, CRT_FLOW_TARGET);
+            Chain falseJumps = value.jumpFalse();
+            targetEnv = unwindBreak(tree.target);
+            code.resolve(value.trueJumps);
+            Chain trueJumps = code.branch(goto_);
+            if (switchExpressionTrueChain == null) {
+                switchExpressionTrueChain = trueJumps;
+            } else {
+                switchExpressionTrueChain =
+                        Code.mergeChains(switchExpressionTrueChain, trueJumps);
             }
-            if (inCondSwitchExpression) {
-                CondItem value = genCond(tree.value, CRT_FLOW_TARGET);
-                Chain falseJumps = value.jumpFalse();
-                targetEnv = unwindBreak(tree);
-                code.resolve(value.trueJumps);
-                Chain trueJumps = code.branch(goto_);
-                if (switchExpressionTrueChain == null) {
-                    switchExpressionTrueChain = trueJumps;
-                } else {
-                    switchExpressionTrueChain =
-                            Code.mergeChains(switchExpressionTrueChain, trueJumps);
-                }
-                if (switchExpressionFalseChain == null) {
-                    switchExpressionFalseChain = falseJumps;
-                } else {
-                    switchExpressionFalseChain =
-                            Code.mergeChains(switchExpressionFalseChain, falseJumps);
-                }
+            if (switchExpressionFalseChain == null) {
+                switchExpressionFalseChain = falseJumps;
             } else {
-                genExpr(tree.value, pt).load();
-                code.state.forceStackTop(tree.target.type);
-                targetEnv = unwindBreak(tree);
-                targetEnv.info.addExit(code.branch(goto_));
+                switchExpressionFalseChain =
+                        Code.mergeChains(switchExpressionFalseChain, falseJumps);
             }
         } else {
-            targetEnv = unwindBreak(tree);
+            genExpr(tree.value, pt).load();
+            code.state.forceStackTop(tree.target.type);
+            targetEnv = unwindBreak(tree.target);
             targetEnv.info.addExit(code.branch(goto_));
         }
         endFinalizerGaps(env, targetEnv);
     }
     //where:
-        private Env<GenContext> unwindBreak(JCBreak tree) {
+        private Env<GenContext> unwindBreak(JCTree target) {
             int tmpPos = code.pendingStatPos;
-            Env<GenContext> targetEnv = unwind(tree.target, env);
+            Env<GenContext> targetEnv = unwind(target, env);
             code.pendingStatPos = tmpPos;
             return targetEnv;
         }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java	Tue Apr 23 16:21:07 2019 +0200
@@ -418,6 +418,31 @@
                     }
                 }
                 if (!isJavaIdentifierPart) {
+                    if (reader.name().contentEquals("break")) {
+                        if (reader.ch == '-') {
+                            int pos = reader.bp;
+                            int savedPos = reader.sp;
+                            reader.putChar(true);
+                            boolean isJavaIdentifierStart = false;
+                            int codePoint = reader.peekSurrogates();
+                            if (codePoint >= 0) {
+                                if (isJavaIdentifierStart = Character.isJavaIdentifierStart(codePoint)) {
+                                    reader.putChar(true);
+                                }
+                            } else {
+                                isJavaIdentifierStart = Character.isJavaIdentifierStart(reader.ch);
+                            }
+                            if (isJavaIdentifierStart) {
+                                scanIdent();
+                            }
+                            if (tk == TokenKind.BREAK_WITH) {
+                                return ;
+                            } else {
+                                reader.bp = pos;
+                                reader.sp = savedPos;
+                            }
+                        }
+                    }
                     name = reader.name();
                     tk = tokens.lookupKind(name);
                     return;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Tue Apr 23 16:21:07 2019 +0200
@@ -364,6 +364,7 @@
                 case RETURN:
                 case THROW:
                 case BREAK:
+                case BREAK_WITH:
                 case CONTINUE:
                 case ELSE:
                 case FINALLY:
@@ -1436,7 +1437,7 @@
                     kind = JCCase.RULE;
                 } else {
                     JCExpression value = parseExpression();
-                    stats = List.of(to(F.at(value).Break(value)));
+                    stats = List.of(to(F.at(value).BreakWith(value)));
                     body = value;
                     kind = JCCase.RULE;
                     accept(SEMI);
@@ -2513,7 +2514,7 @@
             return List.nil();
         case LBRACE: case IF: case FOR: case WHILE: case DO: case TRY:
         case SWITCH: case SYNCHRONIZED: case RETURN: case THROW: case BREAK:
-        case CONTINUE: case SEMI: case ELSE: case FINALLY: case CATCH:
+         case BREAK_WITH: case CONTINUE: case SEMI: case ELSE: case FINALLY: case CATCH:
         case ASSERT:
             return List.of(parseSimpleStatement());
         case MONKEYS_AT:
@@ -2701,9 +2702,16 @@
         }
         case BREAK: {
             nextToken();
-            JCExpression value = token.kind == SEMI ? null : parseExpression();
+            Name label = LAX_IDENTIFIER.accepts(token.kind) ? ident() : null;
             accept(SEMI);
-            JCBreak t = toP(F.at(pos).Break(value));
+            JCBreak t = toP(F.at(pos).Break(label));
+            return t;
+        }
+        case BREAK_WITH: {
+            nextToken();
+            JCExpression value = parseExpression();
+            accept(SEMI);
+            JCBreakWith t = toP(F.at(pos).BreakWith(value));
             return t;
         }
         case CONTINUE: {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/Tokens.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/Tokens.java	Tue Apr 23 16:21:07 2019 +0200
@@ -120,6 +120,7 @@
         ASSERT("assert", Tag.NAMED),
         BOOLEAN("boolean", Tag.NAMED),
         BREAK("break"),
+        BREAK_WITH("break-with"),
         BYTE("byte", Tag.NAMED),
         CASE("case"),
         CATCH("catch"),
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java	Tue Apr 23 16:21:07 2019 +0200
@@ -187,6 +187,10 @@
          */
         BREAK,
 
+        /** Break-with statements, of type BreakWith.
+         */
+        BREAK_WITH,
+
         /** Continue statements, of type Continue.
          */
         CONTINUE,
@@ -1551,10 +1555,10 @@
      * A break from a loop or switch.
      */
     public static class JCBreak extends JCStatement implements BreakTree {
-        public JCExpression value;
+        public Name label;
         public JCTree target;
-        protected JCBreak(JCExpression value, JCTree target) {
-            this.value = value;
+        protected JCBreak(Name label, JCTree target) {
+            this.label = label;
             this.target = target;
         }
         @Override
@@ -1567,11 +1571,8 @@
         public Kind getKind() { return Kind.BREAK; }
         @DefinedBy(Api.COMPILER_TREE)
         public Name getLabel() {
-            return value != null && value.getKind() == Kind.IDENTIFIER ? ((JCIdent) value).getName() : null;
+            return label;
         }
-        @DefinedBy(Api.COMPILER_TREE)
-        @SuppressWarnings("removal")
-        public JCExpression getValue() { return value; }
         @Override @DefinedBy(Api.COMPILER_TREE)
         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
             return v.visitBreak(this, d);
@@ -1583,6 +1584,33 @@
     }
 
     /**
+     * A break-with from a switch expression.
+     */
+    @SuppressWarnings("removal")
+    public static class JCBreakWith extends JCStatement implements BreakWithTree {
+        public JCExpression value;
+        public JCTree target;
+        protected JCBreakWith(JCExpression value, JCTree target) {
+            this.value = value;
+            this.target = target;
+        }
+        @Override
+        public void accept(Visitor v) { v.visitBreakWith(this); }
+        @DefinedBy(Api.COMPILER_TREE)
+        public Kind getKind() { return Kind.BREAK_WITH; }
+        @DefinedBy(Api.COMPILER_TREE)
+        public JCExpression getValue() { return value; }
+        @Override @DefinedBy(Api.COMPILER_TREE)
+        public <R,D> R accept(TreeVisitor<R,D> v, D d) {
+            return v.visitBreakWith(this, d);
+        }
+        @Override
+        public Tag getTag() {
+            return BREAK_WITH;
+        }
+    }
+
+    /**
      * A continue of a loop.
      */
     public static class JCContinue extends JCStatement implements ContinueTree {
@@ -3091,7 +3119,8 @@
                                 JCExpression elsepart);
         JCIf If(JCExpression cond, JCStatement thenpart, JCStatement elsepart);
         JCExpressionStatement Exec(JCExpression expr);
-        JCBreak Break(JCExpression value);
+        JCBreak Break(Name label);
+        JCBreakWith BreakWith(JCExpression value);
         JCContinue Continue(Name label);
         JCReturn Return(JCExpression expr);
         JCThrow Throw(JCExpression expr);
@@ -3162,6 +3191,7 @@
         public void visitIf(JCIf that)                       { visitTree(that); }
         public void visitExec(JCExpressionStatement that)    { visitTree(that); }
         public void visitBreak(JCBreak that)                 { visitTree(that); }
+        public void visitBreakWith(JCBreakWith that)         { visitTree(that); }
         public void visitContinue(JCContinue that)           { visitTree(that); }
         public void visitReturn(JCReturn that)               { visitTree(that); }
         public void visitThrow(JCThrow that)                 { visitTree(that); }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java	Tue Apr 23 16:21:07 2019 +0200
@@ -982,7 +982,20 @@
     public void visitBreak(JCBreak tree) {
         try {
             print("break");
-            if (tree.value != null) print(" " + tree.value);
+            if (tree.label != null) print(" " + tree.label);
+            print(";");
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+
+    public void visitBreakWith(JCBreakWith tree) {
+        try {
+            print("break-with");
+            {
+                print(" ");
+                printExpr(tree.value);
+            }
             print(";");
         } catch (IOException e) {
             throw new UncheckedIOException(e);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Tue Apr 23 16:21:07 2019 +0200
@@ -140,8 +140,15 @@
     @DefinedBy(Api.COMPILER_TREE)
     public JCTree visitBreak(BreakTree node, P p) {
         JCBreak t = (JCBreak) node;
+        return M.at(t.pos).Break(t.label);
+    }
+
+    @DefinedBy(Api.COMPILER_TREE)
+    @SuppressWarnings("removal")
+    public JCTree visitBreakWith(BreakWithTree node, P p) {
+        JCBreakWith t = (JCBreakWith) node;
         JCExpression value = copy(t.value, p);
-        return M.at(t.pos).Break(value);
+        return M.at(t.pos).BreakWith(value);
     }
 
     @DefinedBy(Api.COMPILER_TREE)
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Tue Apr 23 16:21:07 2019 +0200
@@ -333,12 +333,18 @@
         return tree;
     }
 
-    public JCBreak Break(JCExpression label) {
+    public JCBreak Break(Name label) {
         JCBreak tree = new JCBreak(label, null);
         tree.pos = pos;
         return tree;
     }
 
+    public JCBreakWith BreakWith(JCExpression value) {
+        JCBreakWith tree = new JCBreakWith(value, null);
+        tree.pos = pos;
+        return tree;
+    }
+
     public JCContinue Continue(Name label) {
         JCContinue tree = new JCContinue(label, null);
         tree.pos = pos;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java	Tue Apr 23 16:21:07 2019 +0200
@@ -27,6 +27,7 @@
 
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.tree.JCTree.*;
+import com.sun.tools.javac.tree.JCTree.JCBreakWith;
 
 /** A subclass of Tree.Visitor, this class defines
  *  a general tree scanner pattern. Translation proceeds recursively in
@@ -219,6 +220,9 @@
     }
 
     public void visitBreak(JCBreak tree) {
+    }
+
+    public void visitBreakWith(JCBreakWith tree) {
         scan(tree.value);
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java	Tue Apr 23 16:21:07 2019 +0200
@@ -258,8 +258,11 @@
     }
 
     public void visitBreak(JCBreak tree) {
-        if (tree.isValueBreak())
-            tree.value = translate(tree.value);
+        result = tree;
+    }
+
+    public void visitBreakWith(JCBreakWith tree) {
+        tree.value = translate(tree.value);
         result = tree;
     }
 
--- a/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java	Tue Apr 23 16:21:07 2019 +0200
@@ -241,6 +241,7 @@
         // Statement keywords
         ASSERT(TokenKind.ASSERT, XSTMT1|XSTART),  //  assert
         BREAK(TokenKind.BREAK, XSTMT1|XTERM|XSTART),  //  break
+        BREAK_WITH(TokenKind.BREAK_WITH, XSTMT1|XTERM|XSTART),  //  break-with
         CATCH(TokenKind.CATCH, XSTMT1|XSTART),  //  catch
         CONTINUE(TokenKind.CONTINUE, XSTMT1|XTERM|XSTART),  //  continue
         DO(TokenKind.DO, XSTMT1|XSTART),  //  do
--- a/test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java	Tue Apr 23 16:21:07 2019 +0200
@@ -48,9 +48,9 @@
     private static final String INT_ESWITCH_DEFAULT = "int res = switch (x) { default -> { # } };";
     private static final String IF = "if (cond) { # } else throw new RuntimeException();";
     private static final String BLOCK = "{ # }";
-    private static final String BREAK_Z = "break 0;";
-    private static final String BREAK_S = "break \"hello world\";";
-    private static final String BREAK_INT_FN = "break () -> 0 ;";
+    private static final String BREAK_Z = "break-with 0;";
+    private static final String BREAK_S = "break-with \"hello world\";";
+    private static final String BREAK_INT_FN = "break-with () -> 0 ;";
     private static final String BREAK_N = "break;";
     private static final String BREAK_L = "break label;";
     private static final String RETURN_Z = "return 0;";
--- a/test/langtools/tools/javac/lib/DPrinter.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/lib/DPrinter.java	Tue Apr 23 16:21:07 2019 +0200
@@ -782,6 +782,11 @@
 
         @Override
         public void visitBreak(JCBreak tree) {
+            printName("label", tree.label);
+        }
+
+        @Override
+        public void visitBreakWith(JCBreakWith tree) {
             printTree("value", tree.value);
         }
 
--- a/test/langtools/tools/javac/parser/JavacParserTest.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/parser/JavacParserTest.java	Tue Apr 23 16:21:07 2019 +0200
@@ -1083,12 +1083,12 @@
                       "        }" +
                       "        int j = switch (i) {" +
                       "            case 0 -> i + 1;" +
-                      "            case 1 -> { break i + 1; }" +
+                      "            case 1 -> { break-with i + 1; }" +
                       "            default -> throw new RuntimeException();" +
                       "        };" +
                       "        int k = switch (i) {" +
-                      "            case 0: break i + 1;" +
-                      "            case 1: { break i + 1; }" +
+                      "            case 0: break-with i + 1;" +
+                      "            case 1: { break-with i + 1; }" +
                       "            default: throw new RuntimeException();" +
                       "        };" +
                       "    }" +
@@ -1120,7 +1120,7 @@
         List<String> expectedSpans = List.of(
                 "i++;", "{ i++; }", "throw new RuntimeException();", "if (true) ;", "i++;",
                 "<null>", "<null>", "<null>", "<null>", "<null>",
-                "i + 1"/*TODO semicolon?*/, "{ break i + 1; }", "throw new RuntimeException();",
+                "i + 1"/*TODO semicolon?*/, "{ break-with i + 1; }", "throw new RuntimeException();",
                 "<null>", "<null>", "<null>");
         assertEquals("the error spans are not correct; actual:" + spans, expectedSpans, spans);
         String toString = normalize(cut.toString());
@@ -1162,19 +1162,19 @@
                 "        \n" +
                 "        }\n" +
                 "        int j = switch (i) {\n" +
-                "        case 0 -> break i + 1;\n" +
+                "        case 0 -> break-with i + 1;\n" +
                 "        case 1 -> {\n" +
-                "            break i + 1;\n" +
+                "            break-with i + 1;\n" +
                 "        }\n" +
                 "        default -> throw new RuntimeException();\n" +
                 "        };\n" +
                 "        int k = switch (i) {\n" +
                 "        case 0:\n" +
-                "            break i + 1;\n" +
+                "            break-with i + 1;\n" +
                 "        \n" +
                 "        case 1:\n" +
                 "            {\n" +
-                "                break i + 1;\n" +
+                "                break-with i + 1;\n" +
                 "            }\n" +
                 "        \n" +
                 "        default:\n" +
--- a/test/langtools/tools/javac/switchexpr/BreakTest.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/BreakTest.java	Tue Apr 23 16:21:07 2019 +0200
@@ -54,7 +54,7 @@
             "    int t2(Integer i) {" +
             "        return switch (i) {" +
             "            case null: break LABEL;" +
-            "            default: break 2;" +
+            "            default: break-with 2;" +
             "        }" +
             "    }" +
             "}";
@@ -79,7 +79,7 @@
             }
         }.scan(ct.parse(), null);
 
-        List<String> expected = Arrays.asList("LABEL", null, "LABEL", null);
+        List<String> expected = Arrays.asList("LABEL", null, "LABEL");
 
         if (!expected.equals(labels)) {
             throw new AssertionError("Unexpected labels found: " + labels);
--- a/test/langtools/tools/javac/switchexpr/DefiniteAssignment1.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/DefiniteAssignment1.java	Tue Apr 23 16:21:07 2019 +0200
@@ -37,8 +37,8 @@
         int x;
 
         boolean t1 = (b && switch(a) {
-            case 0: break (x = 1) == 1 || true;
-            default: break false;
+            case 0: break-with (x = 1) == 1 || true;
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t1) {
@@ -50,8 +50,8 @@
         int x;
 
         boolean t1 = (b && switch(a) {
-            case 0: break (x = 1) == 1 || isTrue();
-            default: break false;
+            case 0: break-with (x = 1) == 1 || isTrue();
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t1) {
@@ -63,8 +63,8 @@
         int x;
 
         boolean t1a = (b && switch(a) {
-            case 0: break (x = 1) == 1;
-            default: break false;
+            case 0: break-with (x = 1) == 1;
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t1a) {
@@ -76,8 +76,8 @@
         int x;
 
         boolean t1b = (switch(a) {
-            case 0: break (x = 1) == 1;
-            default: break false;
+            case 0: break-with (x = 1) == 1;
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t1b) {
@@ -89,8 +89,8 @@
         int x;
 
         boolean t2 = !(b && switch(a) {
-            case 0: break (x = 1) == 1 || true;
-            default: break false;
+            case 0: break-with (x = 1) == 1 || true;
+            default: break-with false;
         }) || x == 1;
 
         if (!t2) {
@@ -102,8 +102,8 @@
         int x;
 
         boolean t2 = !(b && switch(a) {
-            case 0: break (x = 1) == 1 || isTrue();
-            default: break false;
+            case 0: break-with (x = 1) == 1 || isTrue();
+            default: break-with false;
         }) || x == 1;
 
         if (!t2) {
@@ -115,8 +115,8 @@
         int x;
 
         boolean t3 = !(switch(a) {
-            case 0: break (x = 1) == 1 || true;
-            default: break false;
+            case 0: break-with (x = 1) == 1 || true;
+            default: break-with false;
         }) || x == 2;
 
         if (t3) {
@@ -128,8 +128,8 @@
         int x;
 
         boolean t3 = !(switch(a) {
-            case 0: break (x = 1) == 1 || isTrue();
-            default: break false;
+            case 0: break-with (x = 1) == 1 || isTrue();
+            default: break-with false;
         }) || x == 2;
 
         if (t3) {
@@ -141,7 +141,7 @@
         int x;
 
         boolean t4 = (b && switch(a) {
-            case 0: break (x = 1) == 1 || true;
+            case 0: break-with (x = 1) == 1 || true;
             default: throw new IllegalStateException();
         }) && x == 1; //x is definitelly assigned here
 
@@ -155,7 +155,7 @@
         int x;
 
         boolean t4 = (b && switch(a) {
-            case 0: break (x = 1) == 1 || isTrue();
+            case 0: break-with (x = 1) == 1 || isTrue();
             default: throw new IllegalStateException();
         }) && x == 1; //x is definitelly assigned here
 
@@ -170,8 +170,8 @@
         String s = "a";
 
         boolean t5 = (switch(s) {
-            case "a": break (x = 1) == 1 || true;
-            default: break false;
+            case "a": break-with (x = 1) == 1 || true;
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t5) {
@@ -185,8 +185,8 @@
         String s = "a";
 
         boolean t5 = (switch(s) {
-            case "a": break (x = 1) == 1 || isTrue();
-            default: break false;
+            case "a": break-with (x = 1) == 1 || isTrue();
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t5) {
@@ -199,8 +199,8 @@
         E e = E.B;
 
         boolean t6 = (switch(e) {
-            case B: break (x = 1) == 1 || true;
-            default: break false;
+            case B: break-with (x = 1) == 1 || true;
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t6) {
@@ -213,8 +213,8 @@
         E e = E.B;
 
         boolean t6 = (switch(e) {
-            case B: break (x = 1) == 1 || isTrue();
-            default: break false;
+            case B: break-with (x = 1) == 1 || isTrue();
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t6) {
@@ -251,9 +251,9 @@
         E e = E.B;
 
         boolean t8 = (switch(e) {
-            case A: x = 1; break true;
-            case B: break (x = 1) == 1 || true;
-            default: break false;
+            case A: x = 1; break-with true;
+            case B: break-with (x = 1) == 1 || true;
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t8) {
@@ -266,9 +266,9 @@
         E e = E.B;
 
         boolean t8 = (switch(e) {
-            case A: x = 1; break isTrue();
-            case B: break (x = 1) == 1 || isTrue();
-            default: break false;
+            case A: x = 1; break-with isTrue();
+            case B: break-with (x = 1) == 1 || isTrue();
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t8) {
@@ -281,9 +281,9 @@
         E e = E.A;
 
         boolean t9 = (switch(e) {
-            case A: x = 1; break true;
-            case B: break (x = 1) == 1 || true;
-            default: break false;
+            case A: x = 1; break-with true;
+            case B: break-with (x = 1) == 1 || true;
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t9) {
@@ -296,9 +296,9 @@
         E e = E.A;
 
         boolean t9 = (switch(e) {
-            case A: x = 1; break isTrue();
-            case B: break (x = 1) == 1 || isTrue();
-            default: break false;
+            case A: x = 1; break-with isTrue();
+            case B: break-with (x = 1) == 1 || isTrue();
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!t9) {
@@ -311,9 +311,9 @@
         E e = E.C;
 
         boolean tA = (switch(e) {
-            case A: x = 1; break true;
-            case B: break (x = 1) == 1 || true;
-            default: break false;
+            case A: x = 1; break-with true;
+            case B: break-with (x = 1) == 1 || true;
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (tA) {
@@ -326,9 +326,9 @@
         E e = E.C;
 
         boolean tA = (switch(e) {
-            case A: x = 1; break isTrue();
-            case B: break (x = 1) == 1 || isTrue();
-            default: break false;
+            case A: x = 1; break-with isTrue();
+            case B: break-with (x = 1) == 1 || isTrue();
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (tA) {
@@ -341,9 +341,9 @@
         E e = E.C;
 
         boolean tA = (switch(e) {
-            case A: x = 1; break true;
-            case B: break (x = 2) == 2 || true;
-            default: break false;
+            case A: x = 1; break-with true;
+            case B: break-with (x = 2) == 2 || true;
+            default: break-with false;
         }) || (x = 3) == 3; //x is definitelly unassigned here
 
         if (x != 3) {
@@ -356,9 +356,9 @@
         E e = E.A;
 
         boolean tA = (switch(e) {
-            case A: break isTrue() && (x = 1) == 1;
-            case B: break (x = 1) == 1 || isTrue();
-            default: break false;
+            case A: break-with isTrue() && (x = 1) == 1;
+            case B: break-with (x = 1) == 1 || isTrue();
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!tA) {
@@ -371,9 +371,9 @@
         E e = E.A;
 
         boolean tA = (switch(e) {
-            case A: break isTrue() && e != E.C ? (x = 1) == 1 && e != E.B : false;
-            case B: break (x = 1) == 1 || true;
-            default: break false;
+            case A: break-with isTrue() && e != E.C ? (x = 1) == 1 && e != E.B : false;
+            case B: break-with (x = 1) == 1 || true;
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!tA) {
@@ -386,9 +386,9 @@
         E e = E.A;
 
         boolean tA = (switch(e) {
-            case A: break isTrue() && e != E.C ? (x = 1) == 1 && e != E.B : false;
-            case B: break (x = 1) == 1 || isTrue();
-            default: break false;
+            case A: break-with isTrue() && e != E.C ? (x = 1) == 1 && e != E.B : false;
+            case B: break-with (x = 1) == 1 || isTrue();
+            default: break-with false;
         }) && x == 1; //x is definitelly assigned here
 
         if (!tA) {
@@ -416,9 +416,9 @@
         E e = E.A;
 
         boolean tA = (switch(e) {
-            case A -> { x = 1; break true; }
-            case B -> { x = 1; break true; }
-            case C -> { x = 1; break true; }
+            case A -> { x = 1; break-with true; }
+            case B -> { x = 1; break-with true; }
+            case C -> { x = 1; break-with true; }
         }) && x == 1; //x is definitelly assigned here
 
         if (!tA) {
--- a/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java	Tue Apr 23 16:21:07 2019 +0200
@@ -15,8 +15,8 @@
             int x;
 
             t = (b && switch(a) {
-                case 0: break (x = 1) == 1 || true;
-                default: break false;
+                case 0: break-with (x = 1) == 1 || true;
+                default: break-with false;
             }) || x == 1;
         }
 
@@ -24,8 +24,8 @@
             int x;
 
             t = (switch(a) {
-                case 0: break (x = 1) == 1;
-                default: break false;
+                case 0: break-with (x = 1) == 1;
+                default: break-with false;
             }) || x == 1;
         }
 
@@ -33,9 +33,9 @@
             int x;
 
             t = (switch(a) {
-                case 0: x = 1; break true;
-                case 1: break (x = 1) == 1;
-                default: break false;
+                case 0: x = 1; break-with true;
+                case 1: break-with (x = 1) == 1;
+                default: break-with false;
             }) || x == 1;
         }
 
@@ -43,9 +43,9 @@
             int x;
 
             t = (switch(a) {
-                case 0: break true;
-                case 1: break (x = 1) == 1;
-                default: break false;
+                case 0: break-with true;
+                case 1: break-with (x = 1) == 1;
+                default: break-with false;
             }) && x == 1;
         }
 
@@ -53,9 +53,9 @@
             int x;
 
             t = (switch(a) {
-                case 0: break false;
-                case 1: break isTrue() || (x = 1) == 1;
-                default: break false;
+                case 0: break-with false;
+                case 1: break-with isTrue() || (x = 1) == 1;
+                default: break-with false;
             }) && x == 1;
         }
 
@@ -63,9 +63,9 @@
             int x;
 
             t = (switch(a) {
-                case 0: break false;
-                case 1: break isTrue() ? true : (x = 1) == 1;
-                default: break false;
+                case 0: break-with false;
+                case 1: break-with isTrue() ? true : (x = 1) == 1;
+                default: break-with false;
             }) && x == 1;
         }
 
@@ -73,9 +73,9 @@
             final int x;
 
             t = (switch(a) {
-                case 0: break false;
-                case 1: break isTrue() ? true : (x = 1) == 1;
-                default: break false;
+                case 0: break-with false;
+                case 1: break-with isTrue() ? true : (x = 1) == 1;
+                default: break-with false;
             }) && (x = 1) == 1;
         }
     }
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java	Tue Apr 23 16:21:07 2019 +0200
@@ -37,15 +37,15 @@
     private String print(T t) {
         return switch (t) {
             case A -> "A";
-            case B -> { break "B"; }
-            default -> { break "other"; }
+            case B -> { break-with "B"; }
+            default -> { break-with "other"; }
         };
     }
 
     private String exhaustive1(T t) {
         return switch (t) {
             case A -> "A";
-            case B -> { break "B"; }
+            case B -> { break-with "B"; }
             case C -> "C";
             case D -> "D";
         };
@@ -62,41 +62,41 @@
 
     private String scopesIsolated(T t) {
         return switch (t) {
-            case A -> { String res = "A"; break res;}
-            case B -> { String res = "B"; break res;}
-            default -> { String res = "default"; break res;}
+            case A -> { String res = "A"; break-with res;}
+            case B -> { String res = "B"; break-with res;}
+            default -> { String res = "default"; break-with res;}
         };
     }
 
     private Supplier<String> lambdas1(T t) {
         return switch (t) {
             case A -> () -> "A";
-            case B -> { break () -> "B"; }
+            case B -> { break-with () -> "B"; }
             default -> () -> "default";
         };
     }
 
     private Supplier<String> lambdas2(T t) {
         return switch (t) {
-            case A: break () -> "A";
-            case B: { break () -> "B"; }
-            default: break () -> "default";
+            case A: break-with () -> "A";
+            case B: { break-with () -> "B"; }
+            default: break-with () -> "default";
         };
     }
 
     private int convert1(String s) {
         return switch (s) {
             case "A", "B" -> 0;
-            case "C" -> { break 1; }
+            case "C" -> { break-with 1; }
             default -> -1;
         };
     }
 
     private int convert2(String s) {
         return switch (s) {
-            case "A", "B": break 0;
-            case "C": break 1;
-            default: break -1;
+            case "A", "B": break-with 0;
+            case "C": break-with 1;
+            default: break-with -1;
         };
     }
 
@@ -108,7 +108,7 @@
                     default: break STOP;
                 }
                 return switch (t) {
-                    default: break good;
+                    default: break-with good;
                 };
             }
         }
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks1.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks1.java	Tue Apr 23 16:21:07 2019 +0200
@@ -58,11 +58,11 @@
             case 0:
                 return switch (j) {
                     case 0:
-                        if (true) break "0-0";
+                        if (true) break-with "0-0";
                     case 1:
-                        break "0-1";
+                        break-with "0-1";
                     default:
-                        break "0-X";
+                        break-with "0-X";
                 };
             default: return "X";
         }
@@ -90,9 +90,9 @@
                         r = "0-X";
                         break;
                 }
-                break r;
+                break-with r;
             case 1:
-                break "1";
+                break-with "1";
             case 2:
                 LOP: while (j-- > 0) {
                     if (k == 5) {
@@ -102,9 +102,9 @@
                     break LOP;
                 }
                 Supplier<String> getter = () -> { return "2-X-5"; };
-                break getter.get();
+                break-with getter.get();
             default:
-                break "X";
+                break-with "X";
         };
     }
 
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.java	Tue Apr 23 16:21:07 2019 +0200
@@ -12,7 +12,7 @@
             case 0:
                 return switch (j) {
                     case 0:
-                        break "0-0";
+                        break-with "0-0";
                     case 1:
                         break ; //error: missing value
                     case 2:
@@ -20,9 +20,9 @@
                     case 3: {
                         int x = -1;
                         x: switch (i + j) {
-                            case 0: break x; //error: cannot disambiguate, wrong type as well
+                            case 0: break x;
                         }
-                        break "X";
+                        break-with "X";
                     }
                     case 4: return "X"; //error: no returns from inside of the switch expression
                     case 5: continue;   //error: no continue out of the switch expression
@@ -31,17 +31,17 @@
                     default: {
                         String x = "X";
                         x: switch (i + j) {
-                            case 0: break ""; //error: cannot break from switch expression that is not immediatelly enclosing
+                            case 0: break-with ""; //error: cannot break-with from switch expression that is not immediatelly enclosing
                         }
-                        break "X";
+                        break-with "X";
                     }
                 };
             case 1:
-                break "1" + undef; //error: complex value and no switch expression
+                break-with "1" + undef; //error: complex value and no switch expression
         }
         }
         j: print(switch (i) {
-            default: break j; //error: "j" is ambiguous (expression/label)
+            default: break j;
         }, 0);
         j2: print(switch (i) {
             default: break j2;
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.out	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.out	Tue Apr 23 16:21:07 2019 +0200
@@ -1,15 +1,12 @@
-ExpressionSwitchBreaks2.java:17:25: compiler.err.break.missing.value
 ExpressionSwitchBreaks2.java:19:25: compiler.err.break.outside.switch.expression
-ExpressionSwitchBreaks2.java:23:37: compiler.err.break.ambiguous.target: x
 ExpressionSwitchBreaks2.java:27:29: compiler.err.return.outside.switch.expression
 ExpressionSwitchBreaks2.java:28:29: compiler.err.continue.outside.switch.expression
 ExpressionSwitchBreaks2.java:29:29: compiler.err.continue.outside.switch.expression
 ExpressionSwitchBreaks2.java:30:29: compiler.err.undef.label: UNKNOWN
-ExpressionSwitchBreaks2.java:34:37: compiler.err.break.expr.not.immediate: compiler.misc.tree.tag.switch
 ExpressionSwitchBreaks2.java:40:17: compiler.err.break.complex.value.no.switch.expression
-ExpressionSwitchBreaks2.java:40:29: compiler.err.cant.resolve.location: kindname.variable, undef, , , (compiler.misc.location: kindname.class, ExpressionSwitchBreaks2, null)
-ExpressionSwitchBreaks2.java:44:22: compiler.err.break.ambiguous.target: j
+ExpressionSwitchBreaks2.java:40:34: compiler.err.cant.resolve.location: kindname.variable, undef, , , (compiler.misc.location: kindname.class, ExpressionSwitchBreaks2, null)
+ExpressionSwitchBreaks2.java:44:22: compiler.err.break.outside.switch.expression
 ExpressionSwitchBreaks2.java:47:22: compiler.err.break.outside.switch.expression
 - compiler.note.preview.filename: ExpressionSwitchBreaks2.java
 - compiler.note.preview.recompile
-12 errors
+9 errors
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugs.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugs.java	Tue Apr 23 16:21:07 2019 +0200
@@ -39,42 +39,42 @@
     private void testNested() {
         int i = 0;
         check(42, id(switch (42) {
-            default: i++; break 42;
+            default: i++; break-with 42;
         }));
         i = 0;
         check(43, id(switch (42) {
             case 42: while (i == 0) {
                 i++;
             }
-            break 42 + i;
-            default: i++; break 42;
+            break-with 42 + i;
+            default: i++; break-with 42;
         }));
         i = 0;
         check(42, id(switch (42) {
             case 42: if (i == 0) {
-                break 42;
+                break-with 42;
             }
-            default: i++; break 43;
+            default: i++; break-with 43;
         }));
         i = 0;
         check(42, id(switch (42) {
             case 42: if (i == 0) {
-                break 41 + switch (0) {
+                break-with 41 + switch (0) {
                     case 0 -> 1;
                     default -> -1;
                 };
             }
-            default: i++; break 43;
+            default: i++; break-with 43;
         }));
     }
 
     private void testAnonymousClasses() {
         for (int i : new int[] {1, 2}) {
             check(3, id((switch (i) {
-                case 1: break new I() {
+                case 1: break-with new I() {
                     public int g() { return 3; }
                 };
-                default: break (I) () -> { return 3; };
+                default: break-with (I) () -> { return 3; };
             }).g()));
             check(3, id((switch (i) {
                 case 1 -> new I() {
@@ -96,7 +96,7 @@
         case 2 -> {
             int temp = 0;
             temp += 3;
-            break temp;
+            break-with temp;
         }
         default -> throw new IllegalStateException();
     });
@@ -107,7 +107,7 @@
         case 2 -> {
             int temp = 0;
             temp += 3;
-            break temp;
+            break-with temp;
         }
         default -> throw new IllegalStateException();
     });
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchDA.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchDA.java	Tue Apr 23 16:21:07 2019 +0200
@@ -70,7 +70,7 @@
         int i;
         int j = 0;
         int k = switch (j) {
-            case 0  -> { i=42; break 42; }
+            case 0  -> { i=42; break-with 42; }
             default -> i=42;
         };
         System.out.println(i);
@@ -80,7 +80,7 @@
         int j = 0;
         int k = switch (j) {
             case 0  -> i=42;
-            default -> { i=42; break 42; }
+            default -> { i=42; break-with 42; }
         };
         System.out.println(i);
     }
@@ -88,8 +88,8 @@
         int i;
         int j = 0;
         int k = switch (j) {
-            case 0  -> { i=42; break 42; }
-            default -> { i=42; break 42; }
+            case 0  -> { i=42; break-with 42; }
+            default -> { i=42; break-with 42; }
         };
         System.out.println(i);
     }
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchEmbedding.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchEmbedding.java	Tue Apr 23 16:21:07 2019 +0200
@@ -39,19 +39,19 @@
             int i = 6;
             int o = 0;
             while (switch (i) {
-                case 1: i = 0; break true;
-                case 2: i = 1; break true;
+                case 1: i = 0; break-with true;
+                case 2: i = 1; break-with true;
                 case 3, 4: i--;
                     if (i == 2 || i == 4) {
-                        break switch (i) {
+                        break-with switch (i) {
                             case 2 -> true;
                             case 4 -> false;
                             default -> throw new IllegalStateException();
                         };
                     } else {
-                        break true;
+                        break-with true;
                     }
-                default: i--; break switch (i) {
+                default: i--; break-with switch (i) {
                     case -1 -> false;
                     case 3 -> true;
                     default -> true;
@@ -67,8 +67,8 @@
             int i = 6;
             int o = 0;
             while (switch (i) {
-                case 1: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 0; break true; }
-                case 2: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 1; break true; }
+                case 1: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 0; break-with true; }
+                case 2: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 1; break-with true; }
                 case 3, 4:
                     try {
                         new ExpressionSwitchEmbedding().throwException();
@@ -76,16 +76,16 @@
                         i--;
                         if (i == 2 || i == 4) {
                             try {
-                                break switch (i) {
+                                break-with switch (i) {
                                     case 2 -> throw new ResultException(true);
                                     case 4 -> false;
                                     default -> throw new IllegalStateException();
                                 };
                             } catch (ResultException ex) {
-                                break ex.result;
+                                break-with ex.result;
                             }
                         } else {
-                            break true;
+                            break-with true;
                         }
                     }
                 default:
@@ -93,7 +93,7 @@
                         new ExpressionSwitchEmbedding().throwException();
                     } catch (Throwable t) {
                         i--;
-                        break switch (i) {
+                        break-with switch (i) {
                             case -1 -> false;
                             case 3 -> true;
                             default -> true;
@@ -111,19 +111,19 @@
             int i = 6;
             int o = 0;
             if (switch (i) {
-                case 1: i = 0; break true;
-                case 2: i = 1; break true;
+                case 1: i = 0; break-with true;
+                case 2: i = 1; break-with true;
                 case 3, 4: i--;
                     if (i == 2 || i == 4) {
-                        break (switch (i) {
+                        break-with (switch (i) {
                             case 2 -> 3;
                             case 4 -> 5;
                             default -> throw new IllegalStateException();
                         }) == i + 1;
                     } else {
-                        break true;
+                        break-with true;
                     }
-                default: i--; break switch (i) {
+                default: i--; break-with switch (i) {
                     case -1 -> false;
                     case 3 -> true;
                     default -> true;
@@ -139,8 +139,8 @@
             int i = 6;
             int o = 0;
             if (switch (i) {
-                case 1: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 0; break true; }
-                case 2: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 1; break true; }
+                case 1: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 0; break-with true; }
+                case 2: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 1; break-with true; }
                 case 3, 4:
                     try {
                         new ExpressionSwitchEmbedding().throwException();
@@ -148,16 +148,16 @@
                         i--;
                         if (i == 2 || i == 4) {
                             try {
-                                break switch (i) {
+                                break-with switch (i) {
                                     case 2 -> throw new ResultException(true);
                                     case 4 -> false;
                                     default -> throw new IllegalStateException();
                                 };
                             } catch (ResultException ex) {
-                                break ex.result;
+                                break-with ex.result;
                             }
                         } else {
-                            break true;
+                            break-with true;
                         }
                     }
                 default:
@@ -165,7 +165,7 @@
                         new ExpressionSwitchEmbedding().throwException();
                     } catch (Throwable t) {
                         i--;
-                        break switch (i) {
+                        break-with switch (i) {
                             case -1 -> false;
                             case 3 -> true;
                             default -> true;
@@ -182,19 +182,19 @@
         {
             int o = 0;
             for (int i = 6; (switch (i) {
-                case 1: i = 0; break true;
-                case 2: i = 1; break true;
+                case 1: i = 0; break-with true;
+                case 2: i = 1; break-with true;
                 case 3, 4: i--;
                     if (i == 2 || i == 4) {
-                        break switch (i) {
+                        break-with switch (i) {
                             case 2 -> true;
                             case 4 -> false;
                             default -> throw new IllegalStateException();
                         };
                     } else {
-                        break true;
+                        break-with true;
                     }
-                default: i--; break switch (i) {
+                default: i--; break-with switch (i) {
                     case -1 -> false;
                     case 3 -> true;
                     default -> true;
@@ -209,8 +209,8 @@
         {
             int o = 0;
             for (int i = 6; (switch (i) {
-                case 1: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 0; break true; }
-                case 2: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 1; break true; }
+                case 1: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 0; break-with true; }
+                case 2: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 1; break-with true; }
                 case 3, 4:
                     try {
                         new ExpressionSwitchEmbedding().throwException();
@@ -218,16 +218,16 @@
                         i--;
                         if (i == 2 || i == 4) {
                             try {
-                                break switch (i) {
+                                break-with switch (i) {
                                     case 2 -> throw new ResultException(true);
                                     case 4 -> false;
                                     default -> throw new IllegalStateException();
                                 };
                             } catch (ResultException ex) {
-                                break ex.result;
+                                break-with ex.result;
                             }
                         } else {
-                            break true;
+                            break-with true;
                         }
                     }
                 default:
@@ -235,7 +235,7 @@
                         new ExpressionSwitchEmbedding().throwException();
                     } catch (Throwable t) {
                         i--;
-                        break switch (i) {
+                        break-with switch (i) {
                             case -1 -> false;
                             case 3 -> true;
                             default -> true;
@@ -255,19 +255,19 @@
             do {
                 o++;
             } while (switch (i) {
-                case 1: i = 0; break true;
-                case 2: i = 1; break true;
+                case 1: i = 0; break-with true;
+                case 2: i = 1; break-with true;
                 case 3, 4: i--;
                     if (i == 2 || i == 4) {
-                        break switch (i) {
+                        break-with switch (i) {
                             case 2 -> true;
                             case 4 -> false;
                             default -> throw new IllegalStateException();
                         };
                     } else {
-                        break true;
+                        break-with true;
                     }
-                default: i--; break switch (i) {
+                default: i--; break-with switch (i) {
                     case -1 -> false;
                     case 3 -> true;
                     default -> true;
@@ -283,8 +283,8 @@
             do {
                 o++;
             } while (switch (i) {
-                case 1: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 0; break true; }
-                case 2: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 1; break true; }
+                case 1: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 0; break-with true; }
+                case 2: try { new ExpressionSwitchEmbedding().throwException(); } catch (Throwable t) { i = 1; break-with true; }
                 case 3, 4:
                     try {
                         new ExpressionSwitchEmbedding().throwException();
@@ -292,16 +292,16 @@
                         i--;
                         if (i == 2 || i == 4) {
                             try {
-                                break switch (i) {
+                                break-with switch (i) {
                                     case 2 -> throw new ResultException(true);
                                     case 4 -> false;
                                     default -> throw new IllegalStateException();
                                 };
                             } catch (ResultException ex) {
-                                break ex.result;
+                                break-with ex.result;
                             }
                         } else {
-                            break true;
+                            break-with true;
                         }
                     }
                 default:
@@ -309,7 +309,7 @@
                         new ExpressionSwitchEmbedding().throwException();
                     } catch (Throwable t) {
                         i--;
-                        break switch (i) {
+                        break-with switch (i) {
                             case -1 -> false;
                             case 3 -> true;
                             default -> true;
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough.java	Tue Apr 23 16:21:07 2019 +0200
@@ -53,7 +53,7 @@
         return switch (t) {
             case A: help = "a";
             case B: help += "b";
-            default: break help;
+            default: break-with help;
         };
     }
 
@@ -62,7 +62,7 @@
         return switch (t) {
             case A: help = "a";
             case B: help += "b";
-            default: break help;
+            default: break-with help;
         };
     }
 
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough1.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough1.java	Tue Apr 23 16:21:07 2019 +0200
@@ -50,8 +50,8 @@
         return switch (p) {
             case 0: result += "0";
             case 1: result += "1";
-                break result;
-            default: break "other";
+                break-with result;
+            default: break-with "other";
         };
     }
 
@@ -60,7 +60,7 @@
         switch (p) {
             case 0: result += "0";
             case 1: result += "1";
-                break ;
+                break;
             default: result = "other";
                 break;
         }
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFlow.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFlow.java	Tue Apr 23 16:21:07 2019 +0200
@@ -2,14 +2,14 @@
  * @test /nodynamiccopyright/
  * @bug 8212982
  * @summary Verify a compile-time error is produced if switch expression does not provide a value
- * @compile/fail/ref=ExpressionSwitchFlow.out --enable-preview -source ${jdk.version} -XDrawDiagnostics ExpressionSwitchFlow.java
+ * @compile/fail/ref=ExpressionSwitchFlow.out -XDdev --enable-preview -source ${jdk.version} -XDrawDiagnostics ExpressionSwitchFlow.java
  */
 
 public class ExpressionSwitchFlow {
     private String test1(int i) {
         return switch (i) {
             case 0 -> {}
-            default -> { break "other"; }
+            default -> { break-with "other"; }
         };
     }
     private String test2(int i) {
@@ -27,7 +27,7 @@
     }
     private String test4(int i) {
         return switch (i) {
-            case 0 -> { break "other"; }
+            case 0 -> { break-with "other"; }
             default -> {}
         };
     }
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java	Tue Apr 23 16:21:07 2019 +0200
@@ -43,11 +43,11 @@
             default -> {
                 int k = switch (j) {
                     default -> {
-                        break 42;
+                        break-with 42;
                     }
                 };
-                System.out.println("didn't break to the top level");
-                break 43;
+                System.out.println("didn't break-with to the top level");
+                break-with 43;
             }
         };
         if (i!=43) {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.java	Tue Apr 23 16:21:07 2019 +0200
@@ -27,7 +27,7 @@
 
         String str = switch (param) {
             case "" -> {
-                break 0;
+                break-with 0;
             } default ->"default";
         };
 
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.out	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.out	Tue Apr 23 16:21:07 2019 +0200
@@ -1,6 +1,6 @@
 ExpressionSwitchInfer.java:17:95: compiler.err.cant.resolve.location.args: kindname.method, substring, , int, (compiler.misc.location: kindname.interface, java.lang.CharSequence, null)
 ExpressionSwitchInfer.java:26:38: compiler.err.cant.resolve.location.args: kindname.method, substring, , int, (compiler.misc.location: kindname.interface, java.lang.CharSequence, null)
-ExpressionSwitchInfer.java:30:23: compiler.err.prob.found.req: (compiler.misc.incompatible.type.in.switch.expression: (compiler.misc.inconvertible.types: int, java.lang.String))
+ExpressionSwitchInfer.java:30:28: compiler.err.prob.found.req: (compiler.misc.incompatible.type.in.switch.expression: (compiler.misc.inconvertible.types: int, java.lang.String))
 - compiler.note.preview.filename: ExpressionSwitchInfer.java
 - compiler.note.preview.recompile
 3 errors
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.java	Tue Apr 23 16:21:07 2019 +0200
@@ -26,9 +26,9 @@
                         s = "42";
                         break;
                 }
-                break s;
+                break-with s;
             default:
-                break "43";
+                break-with "43";
         };
     }
     enum E {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.out	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.out	Tue Apr 23 16:21:07 2019 +0200
@@ -1,6 +1,6 @@
 ExpressionSwitchNotExhaustive.java:10:16: compiler.err.not.exhaustive
 ExpressionSwitchNotExhaustive.java:16:16: compiler.err.not.exhaustive
-ExpressionSwitchNotExhaustive.java:29:23: compiler.err.var.might.not.have.been.initialized: s
+ExpressionSwitchNotExhaustive.java:29:28: compiler.err.var.might.not.have.been.initialized: s
 - compiler.note.preview.filename: ExpressionSwitchNotExhaustive.java
 - compiler.note.preview.recompile
 3 errors
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java	Tue Apr 23 16:21:07 2019 +0200
@@ -11,44 +11,44 @@
         int z = 42;
         int i = switch (z) {
             case 0 -> {
-                break 42;
+                break-with 42;
                 System.out.println("Unreachable");  //Unreachable
             }
             default -> 0;
         };
         i = switch (z) {
             case 0 -> {
-                break 42;
-                break 42; //Unreachable
+                break-with 42;
+                break-with 42; //Unreachable
             }
             default -> 0;
         };
         i = switch (z) {
             case 0:
                 System.out.println("0");
-                break 42;
+                break-with 42;
                 System.out.println("1");    //Unreachable
-            default : break 42;
+            default : break-with 42;
         };
         i = switch (z) {
             case 0 -> 42;
             default -> {
-                break 42;
+                break-with 42;
                 System.out.println("Unreachable"); //Unreachable
             }
         };
         i = switch (z) {
-            case 0: break 42;
+            case 0: break-with 42;
             default:
                 System.out.println("0");
-                break 42;
+                break-with 42;
                 System.out.println("1");    //Unreachable
         };
         i = switch (z) {
             case 0:
             default:
                 System.out.println("0");
-                break 42;
+                break-with 42;
                 System.out.println("1");    //Unreachable
         };
     }
--- a/test/langtools/tools/javac/switchexpr/ParseIncomplete.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/ParseIncomplete.java	Tue Apr 23 16:21:07 2019 +0200
@@ -50,9 +50,9 @@
             "    }" +
             "    int t2(Integer i) {" +
             "        return switch (i) {" +
-            "            case null: break 0;" +
-            "            case 0, 1: break 1;" +
-            "            default: break 2;" +
+            "            case null: break-with 0;" +
+            "            case 0, 1: break-with 1;" +
+            "            default: break-with 2;" +
             "        }" +
             "    }" +
             "}";
--- a/test/langtools/tools/javac/switchexpr/SwitchExpressionIsNotAConstant.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/SwitchExpressionIsNotAConstant.java	Tue Apr 23 16:21:07 2019 +0200
@@ -38,7 +38,7 @@
             int dummy = 1 + switch (i) {
                 default -> {
                     i++;
-                    break 1;
+                    break-with 1;
                 }
             };
             if (i != 1) {
@@ -51,7 +51,7 @@
                 case -1 -> 1;
                 default -> {
                     i++;
-                    break 1;
+                    break-with 1;
                 }
             };
             if (i != 1) {
@@ -63,7 +63,7 @@
             int dummy = 1 + switch (i) {
                  default :
                     i++;
-                    break 1;
+                    break-with 1;
             };
             if (i != 1) {
                 throw new IllegalStateException("Side effects missing.");
@@ -72,10 +72,10 @@
         {
             i = 0;
             int dummy = 1 + switch (i) {
-                case -1: break 1;
+                case -1: break-with 1;
                 default:
                     i++;
-                    break 1;
+                    break-with 1;
             };
             if (i != 1) {
                 throw new IllegalStateException("Side effects missing.");
--- a/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.java	Tue Apr 23 16:21:07 2019 +0200
@@ -9,9 +9,9 @@
 
     private String scopesIsolated(int i) {
         return switch (i) {
-            case 0 -> { String res = ""; break res; }
-            case 1 -> { res = ""; break res; }
-            default -> { res = ""; break res; }
+            case 0 -> { String res = ""; break-with res; }
+            case 1 -> { res = ""; break-with res; }
+            default -> { res = ""; break-with res; }
         };
     }
 
--- a/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.out	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.out	Tue Apr 23 16:21:07 2019 +0200
@@ -1,7 +1,7 @@
 SwitchExpressionScopesIsolated.java:13:25: compiler.err.cant.resolve.location: kindname.variable, res, , , (compiler.misc.location: kindname.class, SwitchExpressionScopesIsolated, null)
-SwitchExpressionScopesIsolated.java:13:41: compiler.err.cant.resolve.location: kindname.variable, res, , , (compiler.misc.location: kindname.class, SwitchExpressionScopesIsolated, null)
+SwitchExpressionScopesIsolated.java:13:46: compiler.err.cant.resolve.location: kindname.variable, res, , , (compiler.misc.location: kindname.class, SwitchExpressionScopesIsolated, null)
 SwitchExpressionScopesIsolated.java:14:26: compiler.err.cant.resolve.location: kindname.variable, res, , , (compiler.misc.location: kindname.class, SwitchExpressionScopesIsolated, null)
-SwitchExpressionScopesIsolated.java:14:42: compiler.err.cant.resolve.location: kindname.variable, res, , , (compiler.misc.location: kindname.class, SwitchExpressionScopesIsolated, null)
+SwitchExpressionScopesIsolated.java:14:47: compiler.err.cant.resolve.location: kindname.variable, res, , , (compiler.misc.location: kindname.class, SwitchExpressionScopesIsolated, null)
 - compiler.note.preview.filename: SwitchExpressionScopesIsolated.java
 - compiler.note.preview.recompile
 4 errors
--- a/test/langtools/tools/javac/switchexpr/SwitchExpressionSimpleVisitorTest.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/SwitchExpressionSimpleVisitorTest.java	Tue Apr 23 16:21:07 2019 +0200
@@ -53,7 +53,7 @@
         String code = "class Test {\n" +
                       "    int t(int i) {\n" +
                       "         return switch(i) {\n" +
-                      "              default: break -1;\n" +
+                      "              default: break-with -1;\n" +
                       "         }\n" +
                       "    }\n" +
                       "}\n";
--- a/test/langtools/tools/javac/switchexpr/TryCatch.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchexpr/TryCatch.java	Tue Apr 23 16:21:07 2019 +0200
@@ -38,34 +38,34 @@
                         case 1:
                             try {
                                 new TryCatch().throwException();
-                                break -1;
+                                break-with -1;
                             } catch(Throwable ex) {
-                                break val;
+                                break-with val;
                             }
-                        default: break -1;
+                        default: break-with -1;
                     };
                     case 1 -> {
                         try {
-                            break new TryCatch().id(switch (p + 1) {
+                            break-with new TryCatch().id(switch (p + 1) {
                                 case 2:
                                     try {
                                         new TryCatch().throwException();
-                                        break -1;
+                                        break-with -1;
                                     } catch(Throwable ex) {
                                         throw ex;
                                     }
-                                default: break -1;
+                                default: break-with -1;
                             });
                         } catch(Throwable ex) {
-                            break val;
+                            break-with val;
                         }
                     }
                     default -> {
                         try {
                             new TryCatch().throwException();
-                            break -1;
+                            break-with -1;
                         } catch(Throwable ex) {
-                            break val;
+                            break-with val;
                         }
                     }
                 } - 1);
@@ -83,34 +83,34 @@
                         case 1:
                             try {
                                 new TryCatch().throwException();
-                                break false;
+                                break-with false;
                             } catch(Throwable ex) {
-                                break true;
+                                break-with true;
                             }
-                        default: break false;
+                        default: break-with false;
                     };
                     case 1 -> {
                         try {
-                            break new TryCatch().id(switch (p + 1) {
+                            break-with new TryCatch().id(switch (p + 1) {
                                 case 2:
                                     try {
                                         new TryCatch().throwException();
-                                        break false;
+                                        break-with false;
                                     } catch(Throwable ex) {
                                         throw ex;
                                     }
-                                default: break false;
+                                default: break-with false;
                             });
                         } catch(Throwable ex) {
-                            break true;
+                            break-with true;
                         }
                     }
                     default -> {
                         try {
                             new TryCatch().throwException();
-                            break false;
+                            break-with false;
                         } catch(Throwable ex) {
-                            break true;
+                            break-with true;
                         }
                     }
                 } && (x = 1) == 1 && x == 1 ? val : -1);
@@ -127,34 +127,34 @@
                         case B:
                             try {
                                 new TryCatch().throwException();
-                                break -1;
+                                break-with -1;
                             } catch(Throwable ex) {
-                                break val;
+                                break-with val;
                             }
-                        default: break -1;
+                        default: break-with -1;
                     };
                     case B -> {
                         try {
-                            break new TryCatch().id(switch (e.next()) {
+                            break-with new TryCatch().id(switch (e.next()) {
                                 case C:
                                     try {
                                         new TryCatch().throwException();
-                                        break -1;
+                                        break-with -1;
                                     } catch(Throwable ex) {
                                         throw ex;
                                     }
-                                default: break -1;
+                                default: break-with -1;
                             });
                         } catch(Throwable ex) {
-                            break val;
+                            break-with val;
                         }
                     }
                     default -> {
                         try {
                             new TryCatch().throwException();
-                            break -1;
+                            break-with -1;
                         } catch(Throwable ex) {
-                            break val;
+                            break-with val;
                         }
                     }
                 } - 1);
@@ -172,34 +172,34 @@
                         case B:
                             try {
                                 new TryCatch().throwException();
-                                break false;
+                                break-with false;
                             } catch(Throwable ex) {
-                                break true;
+                                break-with true;
                             }
-                        default: break false;
+                        default: break-with false;
                     };
                     case B -> {
                         try {
-                            break new TryCatch().id(switch (e.next()) {
+                            break-with new TryCatch().id(switch (e.next()) {
                                 case C:
                                     try {
                                         new TryCatch().throwException();
-                                        break false;
+                                        break-with false;
                                     } catch(Throwable ex) {
                                         throw ex;
                                     }
-                                default: break false;
+                                default: break-with false;
                             });
                         } catch(Throwable ex) {
-                            break true;
+                            break-with true;
                         }
                     }
                     default -> {
                         try {
                             new TryCatch().throwException();
-                            break false;
+                            break-with false;
                         } catch(Throwable ex) {
-                            break true;
+                            break-with true;
                         }
                     }
                 } && (x = 1) == 1 && x == 1 ? val : -1);
@@ -216,34 +216,34 @@
                         case "c":
                             try {
                                 new TryCatch().throwException();
-                                break -1;
+                                break-with -1;
                             } catch(Throwable ex) {
-                                break val;
+                                break-with val;
                             }
-                        default: break -1;
+                        default: break-with -1;
                     };
                     case "a" -> {
                         try {
-                            break new TryCatch().id(switch (s + "c") {
+                            break-with new TryCatch().id(switch (s + "c") {
                                 case "ac":
                                     try {
                                         new TryCatch().throwException();
-                                        break -1;
+                                        break-with -1;
                                     } catch(Throwable ex) {
                                         throw ex;
                                     }
-                                default: break -1;
+                                default: break-with -1;
                             });
                         } catch(Throwable ex) {
-                            break val;
+                            break-with val;
                         }
                     }
                     default -> {
                         try {
                             new TryCatch().throwException();
-                            break -1;
+                            break-with -1;
                         } catch(Throwable ex) {
-                            break val;
+                            break-with val;
                         }
                     }
                 } - 1);
@@ -261,34 +261,34 @@
                         case "c":
                             try {
                                 new TryCatch().throwException();
-                                break false;
+                                break-with false;
                             } catch(Throwable ex) {
-                                break true;
+                                break-with true;
                             }
-                        default: break false;
+                        default: break-with false;
                     };
                     case "a" -> {
                         try {
-                            break new TryCatch().id(switch (s + "c") {
+                            break-with new TryCatch().id(switch (s + "c") {
                                 case "ac":
                                     try {
                                         new TryCatch().throwException();
-                                        break false;
+                                        break-with false;
                                     } catch(Throwable ex) {
                                         throw ex;
                                     }
-                                default: break false;
+                                default: break-with false;
                             });
                         } catch(Throwable ex) {
-                            break true;
+                            break-with true;
                         }
                     }
                     default -> {
                         try {
                             new TryCatch().throwException();
-                            break false;
+                            break-with false;
                         } catch(Throwable ex) {
-                            break true;
+                            break-with true;
                         }
                     }
                 } && (x = 1) == 1 && x == 1 ? val : -1);
@@ -330,75 +330,75 @@
 
     static class FieldHolder {
         private final int intTest = switch (0) {
-            case -1: break -1;
+            case -1: break-with -1;
             default:
                 try {
-                    break new TryCatch().id(switch (2) {
+                    break-with new TryCatch().id(switch (2) {
                         case 2:
                             try {
                                 new TryCatch().throwException();
-                                break -1;
+                                break-with -1;
                             } catch(Throwable ex) {
                                 throw ex;
                             }
-                        default: break -1;
+                        default: break-with -1;
                     });
                 } catch(Throwable ex) {
-                    break 3;
+                    break-with 3;
                 }
         };
         private static final int intStaticTest = switch (0) {
-            case -1: break -1;
+            case -1: break-with -1;
             default:
                 try {
-                    break new TryCatch().id(switch (2) {
+                    break-with new TryCatch().id(switch (2) {
                         case 2:
                             try {
                                 new TryCatch().throwException();
-                                break -1;
+                                break-with -1;
                             } catch(Throwable ex) {
                                 throw ex;
                             }
-                        default: break -1;
+                        default: break-with -1;
                     });
                 } catch(Throwable ex) {
-                    break 3;
+                    break-with 3;
                 }
         };
         private final boolean booleanTest = switch (0) {
-            case -1: break false;
+            case -1: break-with false;
             default:
                 try {
-                    break new TryCatch().id(switch (2) {
+                    break-with new TryCatch().id(switch (2) {
                         case 2:
                             try {
                                 new TryCatch().throwException();
-                                break false;
+                                break-with false;
                             } catch(Throwable ex) {
                                 throw ex;
                             }
-                        default: break false;
+                        default: break-with false;
                     });
                 } catch(Throwable ex) {
-                    break true;
+                    break-with true;
                 }
         };
         private static final boolean booleanStaticTest = switch (0) {
-            case -1: break false;
+            case -1: break-with false;
             default:
                 try {
-                    break new TryCatch().id(switch (2) {
+                    break-with new TryCatch().id(switch (2) {
                         case 2:
                             try {
                                 new TryCatch().throwException();
-                                break false;
+                                break-with false;
                             } catch(Throwable ex) {
                                 throw ex;
                             }
-                        default: break false;
+                        default: break-with false;
                     });
                 } catch(Throwable ex) {
-                    break true;
+                    break-with true;
                 }
         };
     }
--- a/test/langtools/tools/javac/switchextra/MultipleLabelsExpression.java	Tue Apr 23 16:21:04 2019 +0200
+++ b/test/langtools/tools/javac/switchextra/MultipleLabelsExpression.java	Tue Apr 23 16:21:07 2019 +0200
@@ -30,7 +30,7 @@
     private String expression1(T t) {
         return switch (t) {
             case A -> "A";
-            case B, C -> { break "B-C"; }
+            case B, C -> { break-with "B-C"; }
             case D -> "D";
             default -> "other";
         };