8232684: Make switch expressions final
authorjlahoda
Tue, 12 Nov 2019 06:32:13 +0000
changeset 59021 cfc7bb9a5a92
parent 59020 aebd72de84b0
child 59022 ff1887930406
8232684: Make switch expressions final Reviewed-by: alanb, mcimadamore, kvn
src/java.base/share/classes/jdk/internal/PreviewFeature.java
src/jdk.compiler/share/classes/com/sun/source/tree/CaseTree.java
src/jdk.compiler/share/classes/com/sun/source/tree/SwitchExpressionTree.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/tree/YieldTree.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/code/Preview.java
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.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
test/hotspot/jtreg/runtime/execstack/TestMT.java
test/hotspot/jtreg/vmTestbase/gc/gctests/gctest02/gctest02.java
test/hotspot/jtreg/vmTestbase/jit/regression/b4446672/b4446672.java
test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java
test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIEventsDebuggee.java
test/hotspot/jtreg/vmTestbase/nsk/share/jdi/MonitorEventsDebuggee.java
test/hotspot/jtreg/vmTestbase/nsk/share/jpda/StateTestThread.java
test/hotspot/jtreg/vmTestbase/nsk/share/locks/LockingThread.java
test/hotspot/jtreg/vmTestbase/nsk/share/locks/MonitorLockingThread.java
test/hotspot/jtreg/vmTestbase/nsk/share/runner/ThreadsRunner.java
test/hotspot/jtreg/vmTestbase/nsk/stress/jni/GarbageGenerator.java
test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace001.java
test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace002.java
test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace005.java
test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace006.java
test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread005.java
test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread006.java
test/jdk/com/sun/jdi/InvokeHangTest.java
test/jdk/com/sun/jdi/SimulResumerTest.java
test/jdk/com/sun/jdi/TwoThreadsTest.java
test/jdk/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java
test/jdk/jdk/jfr/event/runtime/TestThreadCpuTimeEvent.java
test/langtools/tools/javac/ConditionalWithVoid.java
test/langtools/tools/javac/ConditionalWithVoid.out
test/langtools/tools/javac/diags/examples.not-yet.txt
test/langtools/tools/javac/diags/examples/BreakOutsideSwitchExpression.java
test/langtools/tools/javac/diags/examples/ContinueOutsideSwitchExpression.java
test/langtools/tools/javac/diags/examples/IllegalRefToRestrictedType.java
test/langtools/tools/javac/diags/examples/IncompatibleTypesInSwitchExpression.java
test/langtools/tools/javac/diags/examples/InvalidYield.java
test/langtools/tools/javac/diags/examples/InvalidYieldWarning.java
test/langtools/tools/javac/diags/examples/MultipleCaseLabels.java
test/langtools/tools/javac/diags/examples/NoSwitchExpression.java
test/langtools/tools/javac/diags/examples/NoSwitchExpressionQualify.java
test/langtools/tools/javac/diags/examples/NotExhaustive.java
test/langtools/tools/javac/diags/examples/RestrictedTypeNotAllowedPreview.java
test/langtools/tools/javac/diags/examples/ReturnOutsideSwitchExpression.java
test/langtools/tools/javac/diags/examples/RuleCompletesNormally.java
test/langtools/tools/javac/diags/examples/SwitchCaseUnexpectedStatement.java
test/langtools/tools/javac/diags/examples/SwitchExpressionCompletesNormally.java
test/langtools/tools/javac/diags/examples/SwitchExpressionEmpty.java
test/langtools/tools/javac/diags/examples/SwitchExpressionNoResultExpressions.java
test/langtools/tools/javac/diags/examples/SwitchExpressionTargetCantBeVoid.java
test/langtools/tools/javac/diags/examples/SwitchExpressions.java
test/langtools/tools/javac/diags/examples/SwitchMixingCaseTypes.java
test/langtools/tools/javac/diags/examples/SwitchRules.java
test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java
test/langtools/tools/javac/lambda/BadSwitchExpressionLambda.java
test/langtools/tools/javac/lambda/BadSwitchExpressionLambda.out
test/langtools/tools/javac/parser/JavacParserTest.java
test/langtools/tools/javac/switchexpr/BlockExpression.java
test/langtools/tools/javac/switchexpr/BooleanNumericNonNumeric.java
test/langtools/tools/javac/switchexpr/BooleanNumericNonNumeric.out
test/langtools/tools/javac/switchexpr/BreakTest.java
test/langtools/tools/javac/switchexpr/CRT.java
test/langtools/tools/javac/switchexpr/DefiniteAssignment1.java
test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java
test/langtools/tools/javac/switchexpr/DefiniteAssignment2.out
test/langtools/tools/javac/switchexpr/EmptySwitch.java
test/langtools/tools/javac/switchexpr/EmptySwitch.out
test/langtools/tools/javac/switchexpr/ExhaustiveEnumSwitch.java
test/langtools/tools/javac/switchexpr/ExpressionSwitch-old.out
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/ExpressionSwitchBugsInGen.java
test/langtools/tools/javac/switchexpr/ExpressionSwitchCodeFromJLS.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/ExpressionSwitchFlow.out
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/ExpressionSwitchIntersectionTypes.java
test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.java
test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.out
test/langtools/tools/javac/switchexpr/ExpressionSwitchToString.java
test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java
test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.out
test/langtools/tools/javac/switchexpr/LambdaCapture.java
test/langtools/tools/javac/switchexpr/ParseIncomplete.java
test/langtools/tools/javac/switchexpr/ParserRecovery.java
test/langtools/tools/javac/switchexpr/ParserRecovery.out
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/switchexpr/TryCatchFinally.java
test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.java
test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.out
test/langtools/tools/javac/switchexpr/WrongBreakTest.java
test/langtools/tools/javac/switchexpr/WrongBreakTest.out
test/langtools/tools/javac/switchexpr/WrongYieldTest.java
test/langtools/tools/javac/switchexpr/WrongYieldTest.out
test/langtools/tools/javac/switchextra/CaseTest.java
test/langtools/tools/javac/switchextra/DefiniteAssignment1.java
test/langtools/tools/javac/switchextra/DefiniteAssignment2.java
test/langtools/tools/javac/switchextra/DefiniteAssignment2.out
test/langtools/tools/javac/switchextra/MultipleLabelsExpression-old.out
test/langtools/tools/javac/switchextra/MultipleLabelsExpression.java
test/langtools/tools/javac/switchextra/MultipleLabelsStatement-old.out
test/langtools/tools/javac/switchextra/MultipleLabelsStatement.java
test/langtools/tools/javac/switchextra/RuleParsingTest.java
test/langtools/tools/javac/switchextra/SwitchArrowBrokenConstant.java
test/langtools/tools/javac/switchextra/SwitchArrowBrokenConstant.out
test/langtools/tools/javac/switchextra/SwitchStatementArrow-old.out
test/langtools/tools/javac/switchextra/SwitchStatementArrow.java
test/langtools/tools/javac/switchextra/SwitchStatementBroken.java
test/langtools/tools/javac/switchextra/SwitchStatementBroken.out
test/langtools/tools/javac/switchextra/SwitchStatementBroken2.java
test/langtools/tools/javac/switchextra/SwitchStatementBroken2.out
test/langtools/tools/javac/switchextra/SwitchStatementScopesIsolated.java
test/langtools/tools/javac/switchextra/SwitchStatementScopesIsolated.out
test/langtools/tools/jdeps/listdeps/ListModuleDeps.java
--- a/src/java.base/share/classes/jdk/internal/PreviewFeature.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/java.base/share/classes/jdk/internal/PreviewFeature.java	Tue Nov 12 06:32:13 2019 +0000
@@ -54,7 +54,6 @@
     public boolean essentialAPI() default false;
 
     public enum Feature {
-        SWITCH_EXPRESSIONS,
         TEXT_BLOCKS;
     }
 }
--- a/src/jdk.compiler/share/classes/com/sun/source/tree/CaseTree.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/CaseTree.java	Tue Nov 12 06:32:13 2019 +0000
@@ -51,29 +51,18 @@
      * {@code null} if this is the default case.
      * If this case has multiple labels, returns the first label.
      * @return the expression for the case, or null
+     * @deprecated Please use {@link #getExpressions()}.
      */
+    @Deprecated
     ExpressionTree getExpression();
 
     /**
-     * {@preview Associated with switch expressions, a preview feature of
-     *           the Java language.
-     *
-     *           This method is associated with <i>switch expressions</i>, a preview
-     *           feature of the Java language. Preview features
-     *           may be removed in a future release, or upgraded to permanent
-     *           features of the Java language.}
-     *
      * Returns the labels for this case.
      * For default case, returns an empty list.
      *
      * @return labels for this case
      * @since 12
-     *
-     * @preview This method is modeling a case with multiple labels,
-     * which is part of a preview feature and may be removed
-     * if the preview feature is removed.
      */
-    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
     List<? extends ExpressionTree> getExpressions();
 
     /**
@@ -86,14 +75,6 @@
     List<? extends StatementTree> getStatements();
 
     /**
-     * {@preview Associated with switch expressions, a preview feature of
-     *           the Java language.
-     *
-     *           This method is associated with <i>switch expressions</i>, a preview
-     *           feature of the Java language. Preview features
-     *           may be removed in a future release, or upgraded to permanent
-     *           features of the Java language.}
-     *
      * For case with kind {@linkplain CaseKind#RULE},
      * returns the statement or expression after the arrow.
      * Returns {@code null} for case with kind
@@ -102,40 +83,21 @@
      * @return case value or null
      * @since 12
      */
-    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
     public default Tree getBody() {
         return null;
     }
 
     /**
-     * {@preview Associated with switch expressions, a preview feature of
-     *           the Java language.
-     *
-     *           This method is associated with <i>switch expressions</i>, a preview
-     *           feature of the Java language. Preview features
-     *           may be removed in a future release, or upgraded to permanent
-     *           features of the Java language.}
-     *
      * Returns the kind of this case.
      *
      * @return the kind of this case
      * @since 12
      */
-    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
-    @SuppressWarnings("preview")
     public default CaseKind getCaseKind() {
         return CaseKind.STATEMENT;
     }
 
     /**
-     * {@preview Associated with switch expressions, a preview feature of
-     *           the Java language.
-     *
-     *           This enum is associated with <i>switch expressions</i>, a preview
-     *           feature of the Java language. Preview features
-     *           may be removed in a future release, or upgraded to permanent
-     *           features of the Java language.}
-     *
      * The syntatic form of this case:
      * <ul>
      *     <li>STATEMENT: {@code case <expression>: <statements>}</li>
@@ -144,8 +106,6 @@
      *
      * @since 12
      */
-    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
-    @SuppressWarnings("preview")
     public enum CaseKind {
         /**
          * Case is in the form: {@code case <expression>: <statements>}.
--- a/src/jdk.compiler/share/classes/com/sun/source/tree/SwitchExpressionTree.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/SwitchExpressionTree.java	Tue Nov 12 06:32:13 2019 +0000
@@ -28,14 +28,6 @@
 import java.util.List;
 
 /**
- * {@preview Associated with switch expressions, a preview feature of
- *           the Java language.
- *
- *           This interface is associated with <i>switch expressions</i>, a preview
- *           feature of the Java language. Preview features
- *           may be removed in a future release, or upgraded to permanent
- *           features of the Java language.}
- *
  * A tree node for a {@code switch} expression.
  *
  * For example:
@@ -49,7 +41,6 @@
  *
  * @since 12
  */
-@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
 public interface SwitchExpressionTree extends ExpressionTree {
     /**
      * Returns the expression for the {@code switch} expression.
--- a/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java	Tue Nov 12 06:32:13 2019 +0000
@@ -240,20 +240,10 @@
         SWITCH(SwitchTree.class),
 
         /**
-         * {@preview Associated with switch expressions, a preview feature of
-         *           the Java language.
-         *
-         *           This enum constant is associated with <i>switch expressions</i>, a preview
-         *           feature of the Java language. Preview features
-         *           may be removed in a future release, or upgraded to permanent
-         *           features of the Java language.}
-         *
          * Used for instances of {@link SwitchExpressionTree}.
          *
          * @since 12
          */
-        @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
-        @SuppressWarnings("preview")
         SWITCH_EXPRESSION(SwitchExpressionTree.class),
 
         /**
@@ -662,20 +652,10 @@
         OTHER(null),
 
         /**
-         * {@preview Associated with switch expressions, a preview feature of
-         *           the Java language.
-         *
-         *           This enum constant is associated with <i>switch expressions</i>, a preview
-         *           feature of the Java language. Preview features
-         *           may be removed in a future release, or upgraded to permanent
-         *           features of the Java language.}
-         *
          * Used for instances of {@link YieldTree}.
          *
          * @since 13
          */
-        @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
-        @SuppressWarnings("preview")
         YIELD(YieldTree.class);
 
 
--- a/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java	Tue Nov 12 06:32:13 2019 +0000
@@ -354,14 +354,6 @@
     R visitSwitch(SwitchTree node, P p);
 
     /**
-     * {@preview Associated with switch expressions, a preview feature of
-     *           the Java language.
-     *
-     *           This method is associated with <i>switch expressions</i>, a preview
-     *           feature of the Java language. Preview features
-     *           may be removed in a future release, or upgraded to permanent
-     *           features of the Java language.}
-     *
      * Visits a SwitchExpressionTree node.
      *
      * @param node the node being visited
@@ -369,8 +361,6 @@
      * @return a result value
      * @since 12
      */
-    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
-    @SuppressWarnings("preview")
     R visitSwitchExpression(SwitchExpressionTree node, P p);
 
     /**
@@ -560,21 +550,11 @@
     R visitOther(Tree node, P p);
 
     /**
-     * {@preview Associated with switch expressions, a preview feature of
-     *           the Java language.
-     *
-     *           This method is associated with <i>switch expressions</i>, a preview
-     *           feature of the Java language. Preview features
-     *           may be removed in a future release, or upgraded to permanent
-     *           features of the Java language.}
-     *
      * Visits a YieldTree node.
      * @param node the node being visited
      * @param p a parameter value
      * @return a result value
      * @since 13
      */
-    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
-    @SuppressWarnings("preview")
     R visitYield(YieldTree node, P p);
 }
--- a/src/jdk.compiler/share/classes/com/sun/source/tree/YieldTree.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/source/tree/YieldTree.java	Tue Nov 12 06:32:13 2019 +0000
@@ -26,14 +26,6 @@
 package com.sun.source.tree;
 
 /**
- * {@preview Associated with switch expressions, a preview feature of
- *           the Java language.
- *
- *           This method is associated with <i>switch expressions</i>, a preview
- *           feature of the Java language. Preview features
- *           may be removed in a future release, or upgraded to permanent
- *           features of the Java language.}
- *
  * A tree node for a {@code yield} statement.
  *
  * For example:
@@ -45,7 +37,6 @@
  *
  * @since 13
  */
-@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
 public interface YieldTree extends StatementTree {
 
     /**
--- a/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java	Tue Nov 12 06:32:13 2019 +0000
@@ -264,14 +264,6 @@
     }
 
     /**
-     * {@preview Associated with switch expressions, a preview feature of
-     *           the Java language.
-     *
-     *           This method is associated with <i>switch expressions</i>, a preview
-     *           feature of the Java language. Preview features
-     *           may be removed in a future release, or upgraded to permanent
-     *           features of the Java language.}
-     *
      * {@inheritDoc} This implementation calls {@code defaultAction}.
      *
      * @param node {@inheritDoc}
@@ -279,8 +271,6 @@
      * @return  the result of {@code defaultAction}
      */
     @Override
-    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
-    @SuppressWarnings("preview")
     public R visitSwitchExpression(SwitchExpressionTree node, P p) {
         return defaultAction(node, p);
     }
@@ -794,8 +784,6 @@
      * @return  the result of {@code defaultAction}
      */
     @Override
-    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
-    @SuppressWarnings("preview")
     public R visitYield(YieldTree node, P p) {
         return defaultAction(node, p);
     }
--- a/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java	Tue Nov 12 06:32:13 2019 +0000
@@ -334,14 +334,6 @@
     }
 
     /**
-     * {@preview Associated with switch expressions, a preview feature of
-     *           the Java language.
-     *
-     *           This method is associated with <i>switch expressions</i>, a preview
-     *           feature of the Java language. Preview features
-     *           may be removed in a future release, or upgraded to permanent
-     *           features of the Java language.}
-     *
      * {@inheritDoc} This implementation scans the children in left to right order.
      *
      * @param node  {@inheritDoc}
@@ -349,8 +341,6 @@
      * @return the result of scanning
      */
     @Override
-    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
-    @SuppressWarnings("preview")
     public R visitSwitchExpression(SwitchExpressionTree node, P p) {
         R r = scan(node.getExpression(), p);
         r = scanAndReduce(node.getCases(), p, r);
@@ -365,7 +355,6 @@
      * @return the result of scanning
      */
     @Override
-    @SuppressWarnings("preview")
     public R visitCase(CaseTree node, P p) {
         R r = scan(node.getExpressions(), p);
         if (node.getCaseKind() == CaseTree.CaseKind.RULE)
@@ -938,14 +927,6 @@
     }
 
     /**
-     * {@preview Associated with switch expressions, a preview feature of
-     *           the Java language.
-     *
-     *           This method is associated with <i>switch expressions</i>, a preview
-     *           feature of the Java language. Preview features
-     *           may be removed in a future release, or upgraded to permanent
-     *           features of the Java language.}
-     *
      * {@inheritDoc} This implementation returns {@code null}.
      *
      * @param node  {@inheritDoc}
@@ -953,8 +934,6 @@
      * @return the result of scanning
      */
     @Override
-    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS)
-    @SuppressWarnings("preview")
     public R visitYield(YieldTree node, P p) {
         return scan(node.getValue(), p);
     }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java	Tue Nov 12 06:32:13 2019 +0000
@@ -165,10 +165,7 @@
      * @return true, if given feature is a preview feature.
      */
     public boolean isPreview(Feature feature) {
-        if (feature == Feature.SWITCH_EXPRESSION ||
-            feature == Feature.SWITCH_MULTIPLE_CASE_LABELS ||
-            feature == Feature.SWITCH_RULE ||
-            feature == Feature.TEXT_BLOCKS)
+        if (feature == Feature.TEXT_BLOCKS)
             return true;
         //Note: this is a backdoor which allows to optionally treat all features as 'preview' (for testing).
         //When real preview features will be added, this method can be implemented to return 'true'
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Nov 12 06:32:13 2019 +0000
@@ -1467,7 +1467,6 @@
             // check that there are no duplicate case labels or default clauses.
             Set<Object> labels = new HashSet<>(); // The set of case labels.
             boolean hasDefault = false;      // Is there a default label?
-            @SuppressWarnings("preview")
             CaseTree.CaseKind caseKind = null;
             boolean wasError = false;
             for (List<JCCase> l = cases; l.nonEmpty(); l = l.tail) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Tue Nov 12 06:32:13 2019 +0000
@@ -1432,7 +1432,6 @@
         }
         List<JCStatement> stats = null;
         JCTree body = null;
-        @SuppressWarnings("preview")
         CaseTree.CaseKind kind;
         switch (token.kind) {
             case ARROW:
@@ -2897,7 +2896,6 @@
                 nextToken();
                 checkSourceLevel(Feature.SWITCH_MULTIPLE_CASE_LABELS);
             };
-            @SuppressWarnings("preview")
             CaseTree.CaseKind caseKind;
             JCTree body = null;
             if (token.kind == ARROW) {
@@ -2922,7 +2920,6 @@
         }
         case DEFAULT: {
             nextToken();
-            @SuppressWarnings("preview")
             CaseTree.CaseKind caseKind;
             JCTree body = null;
             if (token.kind == ARROW) {
@@ -3300,7 +3297,7 @@
             if (allowYieldStatement) {
                 return true;
             } else if (shouldWarn) {
-                log.warning(pos, Warnings.RestrictedTypeNotAllowedPreview(name, Source.JDK13));
+                log.warning(pos, Warnings.RestrictedTypeNotAllowed(name, Source.JDK14));
             }
         }
         return false;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java	Tue Nov 12 06:32:13 2019 +0000
@@ -1249,17 +1249,14 @@
     public static class JCCase extends JCStatement implements CaseTree {
         //as CaseKind is deprecated for removal (as it is part of a preview feature),
         //using indirection through these fields to avoid unnecessary @SuppressWarnings:
-        @SuppressWarnings("preview")
         public static final CaseKind STATEMENT = CaseKind.STATEMENT;
-        @SuppressWarnings("preview")
         public static final CaseKind RULE = CaseKind.RULE;
-        @SuppressWarnings("preview")
         public final CaseKind caseKind;
         public List<JCExpression> pats;
         public List<JCStatement> stats;
         public JCTree body;
         public boolean completesNormally;
-        protected JCCase(@SuppressWarnings("preview") CaseKind caseKind, List<JCExpression> pats,
+        protected JCCase(CaseKind caseKind, List<JCExpression> pats,
                          List<JCStatement> stats, JCTree body) {
             Assert.checkNonNull(pats);
             Assert.check(pats.isEmpty() || pats.head != null);
@@ -1273,21 +1270,17 @@
 
         @Override @DefinedBy(Api.COMPILER_TREE)
         public Kind getKind() { return Kind.CASE; }
-        @Override @DefinedBy(Api.COMPILER_TREE)
+        @Override @Deprecated @DefinedBy(Api.COMPILER_TREE)
         public JCExpression getExpression() { return pats.head; }
         @Override @DefinedBy(Api.COMPILER_TREE)
-        @SuppressWarnings("preview")
         public List<JCExpression> getExpressions() { return pats; }
         @Override @DefinedBy(Api.COMPILER_TREE)
-        @SuppressWarnings("preview")
         public List<JCStatement> getStatements() {
             return caseKind == CaseKind.STATEMENT ? stats : null;
         }
         @Override @DefinedBy(Api.COMPILER_TREE)
-        @SuppressWarnings("preview")
         public JCTree getBody() { return body; }
         @Override @DefinedBy(Api.COMPILER_TREE)
-        @SuppressWarnings("preview")
         public CaseKind getCaseKind() {
             return caseKind;
         }
@@ -1304,7 +1297,6 @@
     /**
      * A "switch ( ) { }" construction.
      */
-    @SuppressWarnings("preview")
     public static class JCSwitchExpression extends JCPolyExpression implements SwitchExpressionTree {
         public JCExpression selector;
         public List<JCCase> cases;
@@ -1585,7 +1577,6 @@
     /**
      * A break-with from a switch expression.
      */
-    @SuppressWarnings("preview")
     public static class JCYield extends JCStatement implements YieldTree {
         public JCExpression value;
         public JCTree target;
@@ -3104,7 +3095,7 @@
         JCLabeledStatement Labelled(Name label, JCStatement body);
         JCSwitch Switch(JCExpression selector, List<JCCase> cases);
         JCSwitchExpression SwitchExpression(JCExpression selector, List<JCCase> cases);
-        JCCase Case(@SuppressWarnings("preview") CaseTree.CaseKind caseKind, List<JCExpression> pat,
+        JCCase Case(CaseTree.CaseKind caseKind, List<JCExpression> pat,
                     List<JCStatement> stats, JCTree body);
         JCSynchronized Synchronized(JCExpression lock, JCBlock body);
         JCTry Try(JCBlock body, List<JCCatch> catchers, JCBlock finalizer);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Tue Nov 12 06:32:13 2019 +0000
@@ -144,7 +144,6 @@
     }
 
     @DefinedBy(Api.COMPILER_TREE)
-    @SuppressWarnings("preview")
     public JCTree visitYield(YieldTree node, P p) {
         JCYield t = (JCYield) node;
         JCExpression value = copy(t.value, p);
@@ -380,7 +379,6 @@
     }
 
     @DefinedBy(Api.COMPILER_TREE)
-    @SuppressWarnings("preview")
     public JCTree visitSwitchExpression(SwitchExpressionTree node, P p) {
         JCSwitchExpression t = (JCSwitchExpression) node;
         JCExpression selector = copy(t.selector, p);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Tue Nov 12 06:32:13 2019 +0000
@@ -274,7 +274,7 @@
         return tree;
     }
 
-    public JCCase Case(@SuppressWarnings("preview") CaseTree.CaseKind caseKind, List<JCExpression> pats,
+    public JCCase Case(CaseTree.CaseKind caseKind, List<JCExpression> pats,
                        List<JCStatement> stats, JCTree body) {
         JCCase tree = new JCCase(caseKind, pats, stats, body);
         tree.pos = pos;
--- a/test/hotspot/jtreg/runtime/execstack/TestMT.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/runtime/execstack/TestMT.java	Tue Nov 12 06:32:13 2019 +0000
@@ -78,7 +78,7 @@
         public void run() {
             for (int i = 0; i < 10; ++i) {
                 TestMT.run(getName());
-                yield();
+                Thread.yield();
             }
         }
     }
--- a/test/hotspot/jtreg/vmTestbase/gc/gctests/gctest02/gctest02.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/gc/gctests/gctest02/gctest02.java	Tue Nov 12 06:32:13 2019 +0000
@@ -180,7 +180,7 @@
                 while ( ThreadCount.get() > 0 ) {
                         int buf[] = new int[32];
                         {
-                                                yield();
+                                                Thread.yield();
                         }
                 }
         }
--- a/test/hotspot/jtreg/vmTestbase/jit/regression/b4446672/b4446672.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/jit/regression/b4446672/b4446672.java	Tue Nov 12 06:32:13 2019 +0000
@@ -76,7 +76,7 @@
         System.out.println ("GCThread synchronized.");
               while (!done) {
                 gcing=true;
-                yield();
+                Thread.yield();
                 System.gc();
               }
             }
--- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java	Tue Nov 12 06:32:13 2019 +0000
@@ -362,7 +362,7 @@
 
         currentDepth++;
         if (maxDepth > currentDepth) {
-            yield();
+            Thread.yield();
             if (mixed) {
                 int result = recursionNative(maxDepth, currentDepth, true);
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIEventsDebuggee.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIEventsDebuggee.java	Tue Nov 12 06:32:13 2019 +0000
@@ -232,7 +232,7 @@
 
         public void run() {
             while (!startExecution)
-                yield();
+                Thread.yield();
 
             for (int i = 0; (i < actionsNumber) && !stopExecution; i++)
                 executor.doEventAction();
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/MonitorEventsDebuggee.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/MonitorEventsDebuggee.java	Tue Nov 12 06:32:13 2019 +0000
@@ -53,7 +53,7 @@
         public void run() {
             // wait when interrupted thread switches state to 'TIMED_WAITING'
             while ((threadToInterrupt.getState() != Thread.State.WAITING) && !exitedFromWait) {
-                yield();
+                Thread.yield();
             }
 
             // threadToInterrupt 'spuriously' exited from wait()
@@ -236,7 +236,7 @@
         public void run() {
             // wait when blocked thread switches state to 'BLOCKED'
             while (blockedThread.getState() != Thread.State.BLOCKED)
-                yield();
+                Thread.yield();
 
             lockingThread.releaseLock();
         }
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/StateTestThread.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/StateTestThread.java	Tue Nov 12 06:32:13 2019 +0000
@@ -111,7 +111,7 @@
             start();
 
             while (!isRunning)
-                yield();
+                Thread.yield();
 
             break;
         case 2:
@@ -119,7 +119,7 @@
             isRunning = false;
 
             while (this.getState() != Thread.State.TIMED_WAITING)
-                yield();
+                Thread.yield();
 
             break;
         case 3:
@@ -129,7 +129,7 @@
             interrupt();
 
             while (getState() != Thread.State.WAITING)
-                yield();
+                Thread.yield();
 
             break;
         case 4:
@@ -141,7 +141,7 @@
             }
 
             while (!readyToBeBlocked || (getState() != Thread.State.BLOCKED))
-                yield();
+                Thread.yield();
 
             break;
         case 5:
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/locks/LockingThread.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/locks/LockingThread.java	Tue Nov 12 06:32:13 2019 +0000
@@ -325,7 +325,7 @@
                 throw new TestBug("Locking thread can't reach required state (state: " + requiredState + " wasn't reached) in 1 minute");
             }
 
-            yield();
+            Thread.yield();
         }
 
         requiredState = null;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/locks/MonitorLockingThread.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/locks/MonitorLockingThread.java	Tue Nov 12 06:32:13 2019 +0000
@@ -78,7 +78,7 @@
              * should already occur) and then force MonitorLockingThread to release lock
              */
             while (blockedThread.getState() != Thread.State.BLOCKED)
-                yield();
+                Thread.yield();
 
             lockingThread.releaseLock();
         }
@@ -98,7 +98,7 @@
         synchronized (lockToHold) {
             holdsLock = true;
             while (isRunning)
-                yield();
+                Thread.yield();
         }
         holdsLock = false;
     }
@@ -106,12 +106,12 @@
     public void releaseLock() {
         isRunning = false;
         while (holdsLock)
-            yield();
+            Thread.yield();
     }
 
     public void acquireLock() {
         start();
         while (!holdsLock)
-            yield();
+            Thread.yield();
     }
 }
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/runner/ThreadsRunner.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/runner/ThreadsRunner.java	Tue Nov 12 06:32:13 2019 +0000
@@ -81,7 +81,7 @@
                 stresser.start(runParams.getIterations());
                 while (!this.isInterrupted() && stresser.iteration()) {
                     test.run();
-                    yield();
+                    Thread.yield();
                 }
                 waitForOtherThreads();
             } catch (OutOfMemoryError oom) {
--- a/test/hotspot/jtreg/vmTestbase/nsk/stress/jni/GarbageGenerator.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/jni/GarbageGenerator.java	Tue Nov 12 06:32:13 2019 +0000
@@ -84,7 +84,7 @@
         while (!done) {
             for (g = 0; g < ringSize; g++) {
                 gr.add(allocSize);
-                yield();
+                Thread.yield();
             }
             gr.discard();
             try {
--- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace001.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace001.java	Tue Nov 12 06:32:13 2019 +0000
@@ -295,7 +295,7 @@
         }
 
         if (strace001.DEPTH - currentDepth > 0) {
-            yield();
+            Thread.yield();
             recursiveMethod();
         }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace002.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace002.java	Tue Nov 12 06:32:13 2019 +0000
@@ -304,7 +304,7 @@
         }
 
         if (strace002.DEPTH - currentDepth > 0) {
-            yield();
+            Thread.yield();
             recursiveMethod();
         }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace005.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace005.java	Tue Nov 12 06:32:13 2019 +0000
@@ -387,7 +387,7 @@
 
         if (strace005.DEPTH - currentDepth > 0) {
             try {
-                yield();
+                Thread.yield();
                 recursiveMethod2();
             } catch (StackOverflowError e) {
                 // ignore this exception
--- a/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace006.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace006.java	Tue Nov 12 06:32:13 2019 +0000
@@ -331,7 +331,7 @@
 
         if (strace006.DEPTH - currentDepth > 0) {
             try {
-                yield();
+                Thread.yield();
                 recursiveMethod2();
             } catch (StackOverflowError e) {
                 // ignore this exception
--- a/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread005.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread005.java	Tue Nov 12 06:32:13 2019 +0000
@@ -160,7 +160,7 @@
      */
     public void run() {
         while (!GO && !timeout())
-            yield();
+            Thread.yield();
         while (!STOP && !timeout())
             ;
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread006.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/thread/thread006.java	Tue Nov 12 06:32:13 2019 +0000
@@ -176,7 +176,7 @@
      */
     public void run() {
         while (!GO && !timeout())
-            yield();
+            Thread.yield();
         while (!STOP && !timeout())
             ;
     }
--- a/test/jdk/com/sun/jdi/InvokeHangTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/jdk/com/sun/jdi/InvokeHangTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -64,7 +64,7 @@
     // This is called from the debugger via invokeMethod
     public double invokeee() {
         System.out.println("Debuggee: invokeee in thread "+Thread.currentThread().toString());
-        yield();
+        Thread.yield();
         return longMethod(2);
     }
     public double longMethod(int n) {
--- a/test/jdk/com/sun/jdi/SimulResumerTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/jdk/com/sun/jdi/SimulResumerTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -71,7 +71,7 @@
 
     public void bkpt1(int i) {
         synchronized(name1) {
-            yield();
+            Thread.yield();
         }
     }
 
@@ -85,7 +85,7 @@
 
     public void bkpt2(int i) {
         synchronized(name2) {
-            yield();
+            Thread.yield();
         }
     }
 
--- a/test/jdk/com/sun/jdi/TwoThreadsTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/jdk/com/sun/jdi/TwoThreadsTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -70,7 +70,7 @@
     }
 
     public void bkpt1(int i) {
-        yield();
+        Thread.yield();
     }
 
     public void run1() {
@@ -82,7 +82,7 @@
     }
 
     public void bkpt2(int i) {
-        yield();
+        Thread.yield();
     }
 
     public void run2() {
--- a/test/jdk/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/jdk/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -197,7 +197,7 @@
                 while (!done) {
                     try {
                         testRunnable.run();
-                        yield();
+                        Thread.yield();
                     } catch (Throwable t) {
                         numexceptions++;
                         t.printStackTrace();
--- a/test/jdk/jdk/jfr/event/runtime/TestThreadCpuTimeEvent.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/jdk/jdk/jfr/event/runtime/TestThreadCpuTimeEvent.java	Tue Nov 12 06:32:13 2019 +0000
@@ -107,7 +107,7 @@
             } catch (BrokenBarrierException e) {
                 // Another thread has been interrupted - wait for us to be interrupted as well
                 while (!interrupted()) {
-                    yield();
+                    Thread.yield();
                 }
             } catch (InterruptedException e) {
                 // Normal way of stopping the thread
--- a/test/langtools/tools/javac/ConditionalWithVoid.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/ConditionalWithVoid.java	Tue Nov 12 06:32:13 2019 +0000
@@ -4,7 +4,7 @@
  * @summary The compiler was allowing void types in its parsing of conditional expressions.
  * @author tball
  *
- * @compile/fail/ref=ConditionalWithVoid.out --enable-preview -source ${jdk.version} -XDrawDiagnostics ConditionalWithVoid.java
+ * @compile/fail/ref=ConditionalWithVoid.out -XDrawDiagnostics ConditionalWithVoid.java
  */
 public class ConditionalWithVoid {
     public void test(Object o, String s) {
--- a/test/langtools/tools/javac/ConditionalWithVoid.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/ConditionalWithVoid.out	Tue Nov 12 06:32:13 2019 +0000
@@ -2,6 +2,4 @@
 ConditionalWithVoid.java:14:53: compiler.err.void.not.allowed.here
 ConditionalWithVoid.java:16:82: compiler.err.void.not.allowed.here
 ConditionalWithVoid.java:18:64: compiler.err.void.not.allowed.here
-- compiler.note.preview.filename: ConditionalWithVoid.java
-- compiler.note.preview.recompile
 4 errors
--- a/test/langtools/tools/javac/diags/examples.not-yet.txt	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples.not-yet.txt	Tue Nov 12 06:32:13 2019 +0000
@@ -116,6 +116,7 @@
 compiler.warn.override.bridge
 compiler.warn.position.overflow                         # CRTable: caused by files with long lines >= 1024 chars
 compiler.warn.proc.type.already.exists                  # JavacFiler: just mentioned in TODO
+compiler.warn.restricted.type.not.allowed.preview       # not produced by the compiler right now
 compiler.warn.unchecked.assign                          # DEAD, replaced by compiler.misc.unchecked.assign
 compiler.warn.unchecked.cast.to.type                    # DEAD, replaced by compiler.misc.unchecked.cast.to.type
 compiler.warn.unexpected.archive.file                   # Paths: zip file with unknown extn
--- a/test/langtools/tools/javac/diags/examples/BreakOutsideSwitchExpression.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/BreakOutsideSwitchExpression.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,9 +22,6 @@
  */
 
 // key: compiler.err.break.outside.switch.expression
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 class BreakOutsideSwitchExpression {
     int t(int i) {
--- a/test/langtools/tools/javac/diags/examples/ContinueOutsideSwitchExpression.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/ContinueOutsideSwitchExpression.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,9 +22,6 @@
  */
 
 // key: compiler.err.continue.outside.switch.expression
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 class ContinueOutsideSwitchExpression {
     int t(int i) {
--- a/test/langtools/tools/javac/diags/examples/IllegalRefToRestrictedType.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/IllegalRefToRestrictedType.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,7 +22,8 @@
  */
 
 // key: compiler.warn.illegal.ref.to.restricted.type
-// key: compiler.warn.restricted.type.not.allowed.preview
+// key: compiler.warn.restricted.type.not.allowed
+// options: -Xlint:-options -source 13
 
 class IllegalRefToVarType {
     yield list() { return null; }
--- a/test/langtools/tools/javac/diags/examples/IncompatibleTypesInSwitchExpression.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/IncompatibleTypesInSwitchExpression.java	Tue Nov 12 06:32:13 2019 +0000
@@ -24,9 +24,6 @@
 // key: compiler.err.prob.found.req
 // key: compiler.misc.incompatible.type.in.switch.expression
 // key: compiler.misc.inconvertible.types
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 
 class IncompatibleTypesInSwitchExpression {
--- a/test/langtools/tools/javac/diags/examples/InvalidYield.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/InvalidYield.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,7 +22,6 @@
  */
 
 // key: compiler.err.invalid.yield
-// options: --enable-preview --source ${jdk.version}
 
 class BreakComplexValueNoSwitchExpressions {
     void t() {
--- a/test/langtools/tools/javac/diags/examples/InvalidYieldWarning.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/InvalidYieldWarning.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.warn.invalid.yield
-// options: --source ${jdk.version}
+// options: -Xlint:-options --source 13
 
 class BreakComplexValueNoSwitchExpressions {
     void t() {
--- a/test/langtools/tools/javac/diags/examples/MultipleCaseLabels.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/MultipleCaseLabels.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,8 +22,8 @@
  */
 
 // key: compiler.misc.feature.multiple.case.labels
-// key: compiler.warn.preview.feature.use.plural
-// options: --enable-preview -source ${jdk.version} -Xlint:preview
+// key: compiler.err.feature.not.supported.in.source.plural
+// options: -Xlint:-options -source 13
 
 class MultipleCaseLabels {
     void m(int i) {
--- a/test/langtools/tools/javac/diags/examples/NoSwitchExpression.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/NoSwitchExpression.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,7 +22,6 @@
  */
 
 // key: compiler.err.no.switch.expression
-// options: --enable-preview --source ${jdk.version}
 
 class BreakComplexValueNoSwitchExpressions {
     void t() {
--- a/test/langtools/tools/javac/diags/examples/NoSwitchExpressionQualify.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/NoSwitchExpressionQualify.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,7 +22,6 @@
  */
 
 // key: compiler.err.no.switch.expression.qualify
-// options: --enable-preview --source ${jdk.version}
 
 class BreakComplexValueNoSwitchExpressions {
     void t() {
--- a/test/langtools/tools/javac/diags/examples/NotExhaustive.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/NotExhaustive.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,9 +22,6 @@
  */
 
 // key: compiler.err.not.exhaustive
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 class NotExhaustive {
     int t(int i) {
--- a/test/langtools/tools/javac/diags/examples/RestrictedTypeNotAllowedPreview.java	Mon Nov 11 17:43:10 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2016, 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.
- *
- * 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.
- */
-
-// key: compiler.warn.restricted.type.not.allowed.preview
-
-class yield { }
--- a/test/langtools/tools/javac/diags/examples/ReturnOutsideSwitchExpression.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/ReturnOutsideSwitchExpression.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,9 +22,6 @@
  */
 
 // key: compiler.err.return.outside.switch.expression
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 class ReturnOutsideSwitchExpression {
     int t(int i) {
--- a/test/langtools/tools/javac/diags/examples/RuleCompletesNormally.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/RuleCompletesNormally.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,9 +22,6 @@
  */
 
 // key: compiler.err.rule.completes.normally
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 class RuleCompletesNormally {
     public String convert(int i) {
--- a/test/langtools/tools/javac/diags/examples/SwitchCaseUnexpectedStatement.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/SwitchCaseUnexpectedStatement.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,9 +22,6 @@
  */
 
 // key: compiler.err.switch.case.unexpected.statement
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 class ReturnOutsideSwitchExpression {
     void t(int i) {
--- a/test/langtools/tools/javac/diags/examples/SwitchExpressionCompletesNormally.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/SwitchExpressionCompletesNormally.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,9 +22,6 @@
  */
 
 // key: compiler.err.switch.expression.completes.normally
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 class SwitchExpressionCompletesNormally {
     public String convert(int i) {
--- a/test/langtools/tools/javac/diags/examples/SwitchExpressionEmpty.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/SwitchExpressionEmpty.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,9 +22,6 @@
  */
 
 // key: compiler.err.switch.expression.empty
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 class BreakOutsideSwitchExpression {
     String t(E e) {
--- a/test/langtools/tools/javac/diags/examples/SwitchExpressionNoResultExpressions.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/SwitchExpressionNoResultExpressions.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,9 +22,6 @@
  */
 
 // key: compiler.err.switch.expression.no.result.expressions
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 class SwitchExpressionCompletesNormally {
     public String convert(int i) {
--- a/test/langtools/tools/javac/diags/examples/SwitchExpressionTargetCantBeVoid.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/SwitchExpressionTargetCantBeVoid.java	Tue Nov 12 06:32:13 2019 +0000
@@ -24,9 +24,6 @@
 // key: compiler.err.prob.found.req
 // key: compiler.misc.incompatible.ret.type.in.lambda
 // key: compiler.misc.switch.expression.target.cant.be.void
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 class SwitchExpressionTargetCantBeVoid {
 
--- a/test/langtools/tools/javac/diags/examples/SwitchExpressions.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/SwitchExpressions.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,8 +22,8 @@
  */
 
 // key: compiler.misc.feature.switch.expressions
-// key: compiler.warn.preview.feature.use.plural
-// options: --enable-preview -source ${jdk.version} -Xlint:preview
+// key: compiler.err.feature.not.supported.in.source.plural
+// options: -Xlint:-options -source 13
 
 class SwitchExpressions {
     int m(int i) {
--- a/test/langtools/tools/javac/diags/examples/SwitchMixingCaseTypes.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/SwitchMixingCaseTypes.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,9 +22,6 @@
  */
 
 // key: compiler.err.switch.mixing.case.types
-// key: compiler.note.preview.filename
-// key: compiler.note.preview.recompile
-// options: --enable-preview -source ${jdk.version}
 
 class SwitchMixingCaseTypes {
 
--- a/test/langtools/tools/javac/diags/examples/SwitchRules.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/diags/examples/SwitchRules.java	Tue Nov 12 06:32:13 2019 +0000
@@ -22,8 +22,8 @@
  */
 
 // key: compiler.misc.feature.switch.rules
-// key: compiler.warn.preview.feature.use.plural
-// options: --enable-preview -source ${jdk.version} -Xlint:preview
+// key: compiler.err.feature.not.supported.in.source.plural
+// options: -Xlint:-options -source 13
 
 class SwitchExpressions {
     void m(int i) {
--- a/test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -76,9 +76,6 @@
         }
     }
 
-    private static String[] PREVIEW_OPTIONS = {"--enable-preview", "-source",
-                                               Integer.toString(Runtime.version().feature())};
-
     private void program(String... constructs) {
         String s = "class C { static boolean cond = false; static int x = 0; void m() { # } }";
         for (String c : constructs)
@@ -88,7 +85,7 @@
 
     private void assertOK(String... constructs) {
         reset();
-        addCompileOptions(PREVIEW_OPTIONS);
+        addCompileOptions();
         program(constructs);
         try {
             compile();
@@ -101,7 +98,7 @@
 
     private void assertOKWithWarning(String warning, String... constructs) {
         reset();
-        addCompileOptions(PREVIEW_OPTIONS);
+        addCompileOptions();
         program(constructs);
         try {
             compile();
@@ -114,7 +111,7 @@
 
     private void assertFail(String expectedDiag, String... constructs) {
         reset();
-        addCompileOptions(PREVIEW_OPTIONS);
+        addCompileOptions();
         program(constructs);
         try {
             compile();
--- a/test/langtools/tools/javac/lambda/BadSwitchExpressionLambda.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/lambda/BadSwitchExpressionLambda.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8206986
  * @summary Adding switch expressions
- * @compile/fail/ref=BadSwitchExpressionLambda.out -XDrawDiagnostics --enable-preview -source ${jdk.version} BadSwitchExpressionLambda.java
+ * @compile/fail/ref=BadSwitchExpressionLambda.out -XDrawDiagnostics BadSwitchExpressionLambda.java
  */
 
 class BadSwitchExpressionLambda {
--- a/test/langtools/tools/javac/lambda/BadSwitchExpressionLambda.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/lambda/BadSwitchExpressionLambda.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,6 +1,4 @@
 BadSwitchExpressionLambda.java:19:26: compiler.err.prob.found.req: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.switch.expression.target.cant.be.void))
 BadSwitchExpressionLambda.java:21:9: compiler.err.cant.apply.symbol: kindname.method, r, BadSwitchExpressionLambda.SAM, @11, kindname.class, BadSwitchExpressionLambda, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.switch.expression.target.cant.be.void)))
 BadSwitchExpressionLambda.java:22:16: compiler.err.prob.found.req: (compiler.misc.unexpected.ret.val)
-- compiler.note.preview.filename: BadSwitchExpressionLambda.java
-- compiler.note.preview.recompile
 3 errors
--- a/test/langtools/tools/javac/parser/JavacParserTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/parser/JavacParserTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -1096,7 +1096,7 @@
         String expectedErrors = "Test.java:1:178: compiler.err.switch.case.unexpected.statement\n";
         StringWriter out = new StringWriter();
         JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(out, fm, null,
-                Arrays.asList("-XDrawDiagnostics", "--enable-preview", "-source", SOURCE_VERSION),
+                Arrays.asList("-XDrawDiagnostics"),
                 null, Arrays.asList(new MyFileObject(code)));
 
         CompilationUnitTree cut = ct.parse().iterator().next();
--- a/test/langtools/tools/javac/switchexpr/BlockExpression.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/BlockExpression.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8206986
  * @summary Verify rule cases with expression statements and throw statements work.
- * @compile --enable-preview -source ${jdk.version} BlockExpression.java
- * @run main/othervm --enable-preview BlockExpression
+ * @compile BlockExpression.java
+ * @run main BlockExpression
  */
 
 public class BlockExpression {
--- a/test/langtools/tools/javac/switchexpr/BooleanNumericNonNumeric.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/BooleanNumericNonNumeric.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8206986
  * @summary Verify the type of a conditional expression with nested switch expression is computed properly
- * @compile/fail/ref=BooleanNumericNonNumeric.out -XDrawDiagnostics --enable-preview -source ${jdk.version} BooleanNumericNonNumeric.java
+ * @compile/fail/ref=BooleanNumericNonNumeric.out -XDrawDiagnostics BooleanNumericNonNumeric.java
  */
 
 public class BooleanNumericNonNumeric {
--- a/test/langtools/tools/javac/switchexpr/BooleanNumericNonNumeric.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/BooleanNumericNonNumeric.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,5 +1,3 @@
 BooleanNumericNonNumeric.java:11:20: compiler.err.operator.cant.be.applied.1: +, int, boolean
 BooleanNumericNonNumeric.java:19:15: compiler.err.cant.deref: int
-- compiler.note.preview.filename: BooleanNumericNonNumeric.java
-- compiler.note.preview.recompile
 2 errors
--- a/test/langtools/tools/javac/switchexpr/BreakTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/BreakTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -67,7 +67,7 @@
 
         StringWriter out = new StringWriter();
         JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
-            List.of("-XDdev", "--enable-preview", "-source", sourceVersion), null,
+            List.of("-XDdev"), null,
             Arrays.asList(new MyFileObject(CODE)));
         List<String> labels = new ArrayList<>();
         new TreePathScanner<Void, Void>() {
--- a/test/langtools/tools/javac/switchexpr/CRT.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/CRT.java	Tue Nov 12 06:32:13 2019 +0000
@@ -151,9 +151,7 @@
         tb.createDirectories(classes);
         tb.cleanDirectory(classes);
         new JavacTask(tb)
-                .options("-Xjcov",
-                         "--enable-preview",
-                         "-source", SOURCE_VERSION)
+                .options("-Xjcov")
                 .outdir(classes)
                 .sources("public class Test {\n" +
                          code +
--- a/test/langtools/tools/javac/switchexpr/DefiniteAssignment1.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/DefiniteAssignment1.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8214031 8221413
  * @summary Verify that definite assignment when true works (legal code)
- * @compile --enable-preview --source ${jdk.version} DefiniteAssignment1.java
- * @run main/othervm --enable-preview DefiniteAssignment1
+ * @compile DefiniteAssignment1.java
+ * @run main DefiniteAssignment1
  */
 public class DefiniteAssignment1 {
     public static void main(String[] args) {
--- a/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8214031
  * @summary Verify that definite assignment when true works (illegal code)
- * @compile/fail/ref=DefiniteAssignment2.out --enable-preview --source ${jdk.version} -XDrawDiagnostics DefiniteAssignment2.java
+ * @compile/fail/ref=DefiniteAssignment2.out -XDrawDiagnostics DefiniteAssignment2.java
  */
 public class DefiniteAssignment2 {
 
--- a/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/DefiniteAssignment2.out	Tue Nov 12 06:32:13 2019 +0000
@@ -5,6 +5,4 @@
 DefiniteAssignment2.java:59:19: compiler.err.var.might.not.have.been.initialized: x
 DefiniteAssignment2.java:69:19: compiler.err.var.might.not.have.been.initialized: x
 DefiniteAssignment2.java:79:20: compiler.err.var.might.already.be.assigned: x
-- compiler.note.preview.filename: DefiniteAssignment2.java
-- compiler.note.preview.recompile
 7 errors
--- a/test/langtools/tools/javac/switchexpr/EmptySwitch.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/EmptySwitch.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,7 +25,7 @@
  * @test
  * @bug 8206986 8226510
  * @summary Verify than a switch that does not yield a value is rejected.
- * @compile/fail/ref=EmptySwitch.out --enable-preview -source ${jdk.version} -XDrawDiagnostics -XDshould-stop.at=FLOW EmptySwitch.java
+ * @compile/fail/ref=EmptySwitch.out -XDrawDiagnostics -XDshould-stop.at=FLOW EmptySwitch.java
  */
 
 public class EmptySwitch {
--- a/test/langtools/tools/javac/switchexpr/EmptySwitch.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/EmptySwitch.out	Tue Nov 12 06:32:13 2019 +0000
@@ -3,6 +3,4 @@
 EmptySwitch.java:38:10: compiler.err.switch.expression.no.result.expressions
 EmptySwitch.java:44:9: compiler.err.switch.expression.completes.normally
 EmptySwitch.java:47:26: compiler.err.rule.completes.normally
-- compiler.note.preview.filename: EmptySwitch.java
-- compiler.note.preview.recompile
 5 errors
--- a/test/langtools/tools/javac/switchexpr/ExhaustiveEnumSwitch.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExhaustiveEnumSwitch.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,9 +25,9 @@
  * @test
  * @bug 8206986
  * @summary Verify that an switch expression over enum can be exhaustive without default.
- * @compile --enable-preview -source ${jdk.version} ExhaustiveEnumSwitch.java
+ * @compile ExhaustiveEnumSwitch.java
  * @compile ExhaustiveEnumSwitchExtra.java
- * @run main/othervm --enable-preview ExhaustiveEnumSwitch
+ * @run main ExhaustiveEnumSwitch
  */
 
 public class ExhaustiveEnumSwitch {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitch-old.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitch-old.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,4 +1,4 @@
-ExpressionSwitch.java:40:16: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.switch.expressions)
-ExpressionSwitch.java:41:20: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.switch.rules)
-ExpressionSwitch.java:93:31: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.multiple.case.labels)
+ExpressionSwitch.java:40:16: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.switch.expressions), 9, 14
+ExpressionSwitch.java:41:20: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.switch.rules), 9, 14
+ExpressionSwitch.java:93:31: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.multiple.case.labels), 9, 14
 3 errors
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitch.java	Tue Nov 12 06:32:13 2019 +0000
@@ -3,8 +3,8 @@
  * @bug 8206986 8222169 8224031
  * @summary Check expression switch works.
  * @compile/fail/ref=ExpressionSwitch-old.out -source 9 -Xlint:-options -XDrawDiagnostics ExpressionSwitch.java
- * @compile --enable-preview -source ${jdk.version} ExpressionSwitch.java
- * @run main/othervm --enable-preview ExpressionSwitch
+ * @compile ExpressionSwitch.java
+ * @run main ExpressionSwitch
  */
 
 import java.util.Objects;
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks1.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks1.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8206986
  * @summary Verify behavior of various kinds of breaks.
- * @compile --enable-preview -source ${jdk.version} ExpressionSwitchBreaks1.java
- * @run main/othervm --enable-preview ExpressionSwitchBreaks1
+ * @compile ExpressionSwitchBreaks1.java
+ * @run main ExpressionSwitchBreaks1
  */
 
 import java.util.Objects;
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8206986
  * @summary Check behavior for invalid breaks.
- * @compile/fail/ref=ExpressionSwitchBreaks2.out -XDrawDiagnostics --enable-preview -source ${jdk.version} ExpressionSwitchBreaks2.java
+ * @compile/fail/ref=ExpressionSwitchBreaks2.out -XDrawDiagnostics ExpressionSwitchBreaks2.java
  */
 
 public class ExpressionSwitchBreaks2 {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBreaks2.out	Tue Nov 12 06:32:13 2019 +0000
@@ -7,6 +7,4 @@
 ExpressionSwitchBreaks2.java:40:29: compiler.err.cant.resolve.location: kindname.variable, undef, , , (compiler.misc.location: kindname.class, ExpressionSwitchBreaks2, null)
 ExpressionSwitchBreaks2.java:45:22: compiler.err.break.outside.switch.expression
 ExpressionSwitchBreaks2.java:49:22: compiler.err.break.outside.switch.expression
-- compiler.note.preview.filename: ExpressionSwitchBreaks2.java
-- compiler.note.preview.recompile
 9 errors
\ No newline at end of file
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugs.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugs.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8206986 8214114 8214529
  * @summary Verify various corner cases with nested switch expressions.
- * @compile --enable-preview -source ${jdk.version} ExpressionSwitchBugs.java
- * @run main/othervm --enable-preview ExpressionSwitchBugs
+ * @compile ExpressionSwitchBugs.java
+ * @run main ExpressionSwitchBugs
  */
 
 public class ExpressionSwitchBugs {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugsInGen.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchBugsInGen.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8214031
  * @summary Verify various corner cases with nested switch expressions.
- * @compile --enable-preview -source ${jdk.version} ExpressionSwitchBugsInGen.java
- * @run main/othervm --enable-preview ExpressionSwitchBugsInGen
+ * @compile ExpressionSwitchBugsInGen.java
+ * @run main ExpressionSwitchBugsInGen
  */
 
 public class ExpressionSwitchBugsInGen {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchCodeFromJLS.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchCodeFromJLS.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8206986
  * @summary Check switch expressions
- * @compile --enable-preview -source ${jdk.version} ExpressionSwitchCodeFromJLS.java
- * @run main/othervm --enable-preview ExpressionSwitchCodeFromJLS
+ * @compile ExpressionSwitchCodeFromJLS.java
+ * @run main ExpressionSwitchCodeFromJLS
  */
 
 public class ExpressionSwitchCodeFromJLS {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchDA.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchDA.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8206986
  * @summary Check definite (un)assignment for in switch expressions.
- * @compile --enable-preview -source ${jdk.version} ExpressionSwitchDA.java
- * @run main/othervm --enable-preview ExpressionSwitchDA
+ * @compile ExpressionSwitchDA.java
+ * @run main ExpressionSwitchDA
  */
 
 public class ExpressionSwitchDA {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchEmbedding.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchEmbedding.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8214031 8214114
  * @summary Verify switch expressions embedded in various statements work properly.
- * @compile --enable-preview -source ${jdk.version} ExpressionSwitchEmbedding.java
- * @run main/othervm --enable-preview ExpressionSwitchEmbedding
+ * @compile ExpressionSwitchEmbedding.java
+ * @run main ExpressionSwitchEmbedding
  */
 
 public class ExpressionSwitchEmbedding {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8206986
  * @summary Check fall through in switch expressions.
- * @compile --enable-preview -source ${jdk.version} ExpressionSwitchFallThrough.java
- * @run main/othervm --enable-preview ExpressionSwitchFallThrough
+ * @compile ExpressionSwitchFallThrough.java
+ * @run main ExpressionSwitchFallThrough
  */
 
 import java.util.Objects;
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough1.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFallThrough1.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8206986
  * @summary Check fall through in switch expressions.
- * @compile --enable-preview -source ${jdk.version} ExpressionSwitchFallThrough1.java
- * @run main/othervm --enable-preview ExpressionSwitchFallThrough1
+ * @compile ExpressionSwitchFallThrough1.java
+ * @run main ExpressionSwitchFallThrough1
  */
 
 import java.util.Objects;
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFlow.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFlow.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @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 -XDrawDiagnostics ExpressionSwitchFlow.java
  */
 
 public class ExpressionSwitchFlow {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchFlow.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchFlow.out	Tue Nov 12 06:32:13 2019 +0000
@@ -7,6 +7,4 @@
 ExpressionSwitchFlow.java:53:9: compiler.err.switch.expression.completes.normally
 ExpressionSwitchFlow.java:61:9: compiler.err.switch.expression.completes.normally
 ExpressionSwitchFlow.java:69:9: compiler.err.switch.expression.completes.normally
-- compiler.note.preview.filename: ExpressionSwitchFlow.java
-- compiler.note.preview.recompile
 9 errors
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInExpressionSwitch.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8206986
  * @summary Check switch expressions embedded in switch expressions.
- * @compile --enable-preview -source ${jdk.version} ExpressionSwitchInExpressionSwitch.java
- * @run main/othervm --enable-preview ExpressionSwitchInExpressionSwitch
+ * @compile ExpressionSwitchInExpressionSwitch.java
+ * @run main ExpressionSwitchInExpressionSwitch
  */
 
 public class ExpressionSwitchInExpressionSwitch {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8206986
  * @summary Check types inferred for switch expressions.
- * @compile/fail/ref=ExpressionSwitchInfer.out -XDrawDiagnostics --enable-preview -source ${jdk.version} ExpressionSwitchInfer.java
+ * @compile/fail/ref=ExpressionSwitchInfer.out -XDrawDiagnostics ExpressionSwitchInfer.java
  */
 
 import java.util.ArrayList;
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchInfer.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,6 +1,4 @@
 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))
-- compiler.note.preview.filename: ExpressionSwitchInfer.java
-- compiler.note.preview.recompile
 3 errors
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchIntersectionTypes.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchIntersectionTypes.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8206986
  * @summary Verify behavior when an intersection type is inferred for switch expression.
- * @compile --enable-preview -source ${jdk.version} ExpressionSwitchIntersectionTypes.java
- * @run main/othervm --enable-preview ExpressionSwitchIntersectionTypes
+ * @compile ExpressionSwitchIntersectionTypes.java
+ * @run main ExpressionSwitchIntersectionTypes
  */
 
 public class ExpressionSwitchIntersectionTypes<X  extends java.io.Serializable & Runnable> {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8206986
  * @summary Verify behavior of not exhaustive switch expressions.
- * @compile/fail/ref=ExpressionSwitchNotExhaustive.out -XDrawDiagnostics --enable-preview -source ${jdk.version} ExpressionSwitchNotExhaustive.java
+ * @compile/fail/ref=ExpressionSwitchNotExhaustive.out -XDrawDiagnostics ExpressionSwitchNotExhaustive.java
  */
 
 public class ExpressionSwitchNotExhaustive {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchNotExhaustive.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,6 +1,4 @@
 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
-- compiler.note.preview.filename: ExpressionSwitchNotExhaustive.java
-- compiler.note.preview.recompile
 3 errors
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchToString.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchToString.java	Tue Nov 12 06:32:13 2019 +0000
@@ -99,7 +99,7 @@
         String sourceVersion = Integer.toString(Runtime.version().feature());
 
         JavacTask ct = (JavacTask) tool.getTask(null, null, noErrors,
-            List.of("-XDdev", "--enable-preview", "-source", sourceVersion), null,
+            List.of("-XDdev"), null,
             Arrays.asList(new MyFileObject(CODE)));
         String actualCode = ct.parse().iterator().next().toString();
         actualCode = actualCode.replace(System.getProperty("line.separator"), "\n");
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8206986
  * @summary Verify reachability in switch expressions.
- * @compile/fail/ref=ExpressionSwitchUnreachable.out -XDrawDiagnostics --enable-preview -source ${jdk.version} ExpressionSwitchUnreachable.java
+ * @compile/fail/ref=ExpressionSwitchUnreachable.out -XDrawDiagnostics ExpressionSwitchUnreachable.java
  */
 
 public class ExpressionSwitchUnreachable {
--- a/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ExpressionSwitchUnreachable.out	Tue Nov 12 06:32:13 2019 +0000
@@ -4,6 +4,4 @@
 ExpressionSwitchUnreachable.java:37:17: compiler.err.unreachable.stmt
 ExpressionSwitchUnreachable.java:45:17: compiler.err.unreachable.stmt
 ExpressionSwitchUnreachable.java:52:17: compiler.err.unreachable.stmt
-- compiler.note.preview.filename: ExpressionSwitchUnreachable.java
-- compiler.note.preview.recompile
 6 errors
\ No newline at end of file
--- a/test/langtools/tools/javac/switchexpr/LambdaCapture.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/LambdaCapture.java	Tue Nov 12 06:32:13 2019 +0000
@@ -26,7 +26,7 @@
  * @bug 8220041
  * @summary Verify variable capture works inside switch expressions which are
  *          inside variable declarations
- * @compile --enable-preview -source ${jdk.version} LambdaCapture.java
+ * @compile LambdaCapture.java
  */
 
 import java.util.Objects;
--- a/test/langtools/tools/javac/switchexpr/ParseIncomplete.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ParseIncomplete.java	Tue Nov 12 06:32:13 2019 +0000
@@ -68,7 +68,7 @@
             StringWriter out = new StringWriter();
             try {
                 JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
-                    List.of("-XDdev", "--enable-preview", "-source", sourceVersion), null,
+                    List.of("-XDdev"), null,
                     Arrays.asList(new MyFileObject(code)));
                 ct.parse().iterator().next();
             } catch (Throwable t) {
--- a/test/langtools/tools/javac/switchexpr/ParserRecovery.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ParserRecovery.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8206986
  * @summary Verify the parser handles broken input gracefully.
- * @compile/fail/ref=ParserRecovery.out -XDrawDiagnostics --enable-preview -source ${jdk.version} ParserRecovery.java
+ * @compile/fail/ref=ParserRecovery.out -XDrawDiagnostics ParserRecovery.java
  */
 
 public class ParserRecovery {
--- a/test/langtools/tools/javac/switchexpr/ParserRecovery.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/ParserRecovery.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,5 +1,3 @@
 ParserRecovery.java:10:39: compiler.err.expected2: :, ->
 ParserRecovery.java:13:31: compiler.err.expected2: :, ->
-- compiler.note.preview.filename: ParserRecovery.java
-- compiler.note.preview.recompile
 2 errors
--- a/test/langtools/tools/javac/switchexpr/SwitchExpressionIsNotAConstant.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/SwitchExpressionIsNotAConstant.java	Tue Nov 12 06:32:13 2019 +0000
@@ -26,8 +26,8 @@
  * @bug 8214113
  * @summary Verify the switch expression's type does not have a constant attached,
  *          and so the switch expression is not elided.
- * @compile --enable-preview --source ${jdk.version} SwitchExpressionIsNotAConstant.java
- * @run main/othervm --enable-preview SwitchExpressionIsNotAConstant
+ * @compile SwitchExpressionIsNotAConstant.java
+ * @run main SwitchExpressionIsNotAConstant
  */
 public class SwitchExpressionIsNotAConstant {
 
--- a/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8206986
  * @summary Verify that scopes in rule cases are isolated.
- * @compile/fail/ref=SwitchExpressionScopesIsolated.out -XDrawDiagnostics --enable-preview -source ${jdk.version} SwitchExpressionScopesIsolated.java
+ * @compile/fail/ref=SwitchExpressionScopesIsolated.out -XDrawDiagnostics SwitchExpressionScopesIsolated.java
  */
 
 public class SwitchExpressionScopesIsolated {
--- a/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/SwitchExpressionScopesIsolated.out	Tue Nov 12 06:32:13 2019 +0000
@@ -2,6 +2,4 @@
 SwitchExpressionScopesIsolated.java:13:41: 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)
-- compiler.note.preview.filename: SwitchExpressionScopesIsolated.java
-- compiler.note.preview.recompile
 4 errors
--- a/test/langtools/tools/javac/switchexpr/SwitchExpressionSimpleVisitorTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/SwitchExpressionSimpleVisitorTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -107,7 +107,7 @@
 
         StringWriter out = new StringWriter();
         JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
-            List.of("--enable-preview", "-source", Integer.toString(Runtime.version().feature())), null,
+            List.of(), null,
             Arrays.asList(new MyFileObject(code)));
         return ct.parse().iterator().next();
     }
--- a/test/langtools/tools/javac/switchexpr/TryCatch.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/TryCatch.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8214114
  * @summary Verify try-catch inside a switch expression works properly.
- * @compile --enable-preview -source ${jdk.version} TryCatch.java
- * @run main/othervm --enable-preview TryCatch
+ * @compile TryCatch.java
+ * @run main TryCatch
  */
 public class TryCatch {
     public static void main(String[] args) {
--- a/test/langtools/tools/javac/switchexpr/TryCatchFinally.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/TryCatchFinally.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,8 +25,8 @@
  * @test
  * @bug 8220018
  * @summary Verify that try-catch-finally inside a switch expression works properly.
- * @compile --enable-preview -source ${jdk.version} TryCatchFinally.java
- * @run main/othervm --enable-preview TryCatchFinally
+ * @compile TryCatchFinally.java
+ * @run main TryCatchFinally
  */
 public class TryCatchFinally {//TODO: yield <double>
     public static void main(String[] args) {
--- a/test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,7 +25,7 @@
  * @test
  * @bug 8223305 8226522
  * @summary Verify correct warnings w.r.t. yield
- * @compile/ref=WarnWrongYieldTest.out -source ${jdk.version} -XDrawDiagnostics -XDshould-stop.at=ATTR WarnWrongYieldTest.java
+ * @compile/ref=WarnWrongYieldTest.out -Xlint:-options -source 13 -XDrawDiagnostics -XDshould-stop.at=ATTR WarnWrongYieldTest.java
  */
 
 package t;
--- a/test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/WarnWrongYieldTest.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,8 +1,8 @@
-WarnWrongYieldTest.java:39:11: compiler.warn.restricted.type.not.allowed.preview: yield, 13
-WarnWrongYieldTest.java:45:5: compiler.warn.restricted.type.not.allowed.preview: yield, 13
-WarnWrongYieldTest.java:72:15: compiler.warn.restricted.type.not.allowed.preview: yield, 13
-WarnWrongYieldTest.java:75:15: compiler.warn.restricted.type.not.allowed.preview: yield, 13
-WarnWrongYieldTest.java:81:21: compiler.warn.restricted.type.not.allowed.preview: yield, 13
+WarnWrongYieldTest.java:39:11: compiler.warn.restricted.type.not.allowed: yield, 14
+WarnWrongYieldTest.java:45:5: compiler.warn.restricted.type.not.allowed: yield, 14
+WarnWrongYieldTest.java:72:15: compiler.warn.restricted.type.not.allowed: yield, 14
+WarnWrongYieldTest.java:75:15: compiler.warn.restricted.type.not.allowed: yield, 14
+WarnWrongYieldTest.java:81:21: compiler.warn.restricted.type.not.allowed: yield, 14
 WarnWrongYieldTest.java:93:9: compiler.warn.invalid.yield
 WarnWrongYieldTest.java:98:9: compiler.warn.invalid.yield
 WarnWrongYieldTest.java:103:9: compiler.warn.invalid.yield
@@ -11,8 +11,8 @@
 WarnWrongYieldTest.java:118:9: compiler.warn.invalid.yield
 WarnWrongYieldTest.java:123:22: compiler.warn.invalid.yield
 WarnWrongYieldTest.java:152:24: compiler.warn.invalid.yield
-WarnWrongYieldTest.java:164:18: compiler.warn.restricted.type.not.allowed.preview: yield, 13
-WarnWrongYieldTest.java:168:23: compiler.warn.restricted.type.not.allowed.preview: yield, 13
+WarnWrongYieldTest.java:164:18: compiler.warn.restricted.type.not.allowed: yield, 14
+WarnWrongYieldTest.java:168:23: compiler.warn.restricted.type.not.allowed: yield, 14
 WarnWrongYieldTest.java:34:28: compiler.warn.illegal.ref.to.restricted.type: yield
 WarnWrongYieldTest.java:45:5: compiler.warn.illegal.ref.to.restricted.type: yield
 WarnWrongYieldTest.java:168:23: compiler.warn.illegal.ref.to.restricted.type: yield
--- a/test/langtools/tools/javac/switchexpr/WrongBreakTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/WrongBreakTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,7 +25,7 @@
  * @test
  * @bug 8223305
  * @summary Ensure javac is not crashing for wrong breaks.
- * @compile/fail/ref=WrongBreakTest.out --enable-preview -source ${jdk.version} -XDrawDiagnostics -XDshould-stop.at=FLOW WrongBreakTest.java
+ * @compile/fail/ref=WrongBreakTest.out -XDrawDiagnostics -XDshould-stop.at=FLOW WrongBreakTest.java
  */
 
 public class WrongBreakTest {
--- a/test/langtools/tools/javac/switchexpr/WrongBreakTest.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/WrongBreakTest.out	Tue Nov 12 06:32:13 2019 +0000
@@ -4,6 +4,4 @@
 WrongBreakTest.java:36:9: compiler.err.ref.ambiguous: test, kindname.method, test(int), WrongBreakTest, kindname.method, test(java.lang.Object), WrongBreakTest
 WrongBreakTest.java:38:13: compiler.err.no.switch.expression
 WrongBreakTest.java:41:13: compiler.err.no.switch.expression
-- compiler.note.preview.filename: WrongBreakTest.java
-- compiler.note.preview.recompile
 6 errors
--- a/test/langtools/tools/javac/switchexpr/WrongYieldTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/WrongYieldTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -25,7 +25,7 @@
  * @test
  * @bug 8223305 8226522
  * @summary Ensure proper errors are returned for yields.
- * @compile/fail/ref=WrongYieldTest.out --enable-preview -source ${jdk.version} -XDrawDiagnostics -XDshould-stop.at=ATTR WrongYieldTest.java
+ * @compile/fail/ref=WrongYieldTest.out -XDrawDiagnostics -XDshould-stop.at=ATTR WrongYieldTest.java
  */
 
 package t;
--- a/test/langtools/tools/javac/switchexpr/WrongYieldTest.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchexpr/WrongYieldTest.out	Tue Nov 12 06:32:13 2019 +0000
@@ -26,6 +26,4 @@
 WrongYieldTest.java:201:9: compiler.err.no.switch.expression
 WrongYieldTest.java:202:9: compiler.err.no.switch.expression
 WrongYieldTest.java:216:24: compiler.err.illegal.ref.to.restricted.type: yield
-- compiler.note.preview.filename: WrongYieldTest.java
-- compiler.note.preview.recompile
 28 errors
--- a/test/langtools/tools/javac/switchextra/CaseTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/CaseTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -137,7 +137,7 @@
 
         StringWriter out = new StringWriter();
         JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
-            List.of("-XDdev", "--enable-preview", "-source", sourceVersion), null,
+            List.of("-XDdev"), null,
             Arrays.asList(new MyFileObject(code)));
         return ct.parse().iterator().next();
     }
--- a/test/langtools/tools/javac/switchextra/DefiniteAssignment1.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/DefiniteAssignment1.java	Tue Nov 12 06:32:13 2019 +0000
@@ -24,8 +24,8 @@
 /**
  * @test
  * @summary Verify that definite assignment works (legal code)
- * @compile --enable-preview -source ${jdk.version} DefiniteAssignment1.java
- * @run main/othervm --enable-preview DefiniteAssignment1
+ * @compile DefiniteAssignment1.java
+ * @run main DefiniteAssignment1
  */
 public class DefiniteAssignment1 {
     public static void main(String[] args) {
--- a/test/langtools/tools/javac/switchextra/DefiniteAssignment2.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/DefiniteAssignment2.java	Tue Nov 12 06:32:13 2019 +0000
@@ -1,7 +1,7 @@
 /**
  * @test /nodynamiccopyright/
  * @summary Verify that definite assignment works (illegal code)
- * @compile/fail/ref=DefiniteAssignment2.out -XDrawDiagnostics --enable-preview -source ${jdk.version} DefiniteAssignment2.java
+ * @compile/fail/ref=DefiniteAssignment2.out -XDrawDiagnostics DefiniteAssignment2.java
  */
 public class DefiniteAssignment2 {
 
--- a/test/langtools/tools/javac/switchextra/DefiniteAssignment2.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/DefiniteAssignment2.out	Tue Nov 12 06:32:13 2019 +0000
@@ -4,6 +4,4 @@
 DefiniteAssignment2.java:52:28: compiler.err.var.might.not.have.been.initialized: x
 DefiniteAssignment2.java:62:28: compiler.err.var.might.not.have.been.initialized: x
 DefiniteAssignment2.java:73:28: compiler.err.var.might.not.have.been.initialized: x
-- compiler.note.preview.filename: DefiniteAssignment2.java
-- compiler.note.preview.recompile
 6 errors
--- a/test/langtools/tools/javac/switchextra/MultipleLabelsExpression-old.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/MultipleLabelsExpression-old.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,4 +1,4 @@
-MultipleLabelsExpression.java:31:16: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.switch.expressions)
-MultipleLabelsExpression.java:32:20: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.switch.rules)
-MultipleLabelsExpression.java:33:19: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.multiple.case.labels)
+MultipleLabelsExpression.java:31:16: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.switch.expressions), 9, 14
+MultipleLabelsExpression.java:32:20: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.switch.rules), 9, 14
+MultipleLabelsExpression.java:33:19: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.multiple.case.labels), 9, 14
 3 errors
--- a/test/langtools/tools/javac/switchextra/MultipleLabelsExpression.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/MultipleLabelsExpression.java	Tue Nov 12 06:32:13 2019 +0000
@@ -3,8 +3,8 @@
  * @bug 8206986
  * @summary Verify cases with multiple labels work properly.
  * @compile/fail/ref=MultipleLabelsExpression-old.out -source 9 -Xlint:-options -XDrawDiagnostics MultipleLabelsExpression.java
- * @compile --enable-preview -source ${jdk.version} MultipleLabelsExpression.java
- * @run main/othervm --enable-preview MultipleLabelsExpression
+ * @compile MultipleLabelsExpression.java
+ * @run main MultipleLabelsExpression
  */
 
 import java.util.Objects;
--- a/test/langtools/tools/javac/switchextra/MultipleLabelsStatement-old.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/MultipleLabelsStatement-old.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,2 +1,2 @@
-MultipleLabelsStatement.java:35:21: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.multiple.case.labels)
+MultipleLabelsStatement.java:35:21: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.multiple.case.labels), 9, 14
 1 error
--- a/test/langtools/tools/javac/switchextra/MultipleLabelsStatement.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/MultipleLabelsStatement.java	Tue Nov 12 06:32:13 2019 +0000
@@ -3,8 +3,8 @@
  * @bug 8206986
  * @summary Verify cases with multiple labels work properly.
  * @compile/fail/ref=MultipleLabelsStatement-old.out -source 9 -Xlint:-options -XDrawDiagnostics MultipleLabelsStatement.java
- * @compile --enable-preview -source ${jdk.version} MultipleLabelsStatement.java
- * @run main/othervm --enable-preview MultipleLabelsStatement
+ * @compile MultipleLabelsStatement.java
+ * @run main MultipleLabelsStatement
  */
 
 import java.util.Objects;
--- a/test/langtools/tools/javac/switchextra/RuleParsingTest.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/RuleParsingTest.java	Tue Nov 12 06:32:13 2019 +0000
@@ -95,7 +95,7 @@
 
         StringWriter out = new StringWriter();
         JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
-            List.of("--enable-preview", "-source", sourceVersion), null,
+            List.of(), null,
             Arrays.asList(new MyFileObject(code.toString())));
         CompilationUnitTree cut = ct.parse().iterator().next();
         Trees trees = Trees.instance(ct);
--- a/test/langtools/tools/javac/switchextra/SwitchArrowBrokenConstant.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/SwitchArrowBrokenConstant.java	Tue Nov 12 06:32:13 2019 +0000
@@ -3,7 +3,7 @@
  * @bug 8206986
  * @summary Verify reasonable errors are produced when neither ':' nor '->'
  *          is found are the expression of a case
- * @compile/fail/ref=SwitchArrowBrokenConstant.out -source ${jdk.version} --enable-preview -Xlint:-preview -XDrawDiagnostics SwitchArrowBrokenConstant.java
+ * @compile/fail/ref=SwitchArrowBrokenConstant.out -Xlint:-preview -XDrawDiagnostics SwitchArrowBrokenConstant.java
  */
 
 public class SwitchArrowBrokenConstant {
--- a/test/langtools/tools/javac/switchextra/SwitchArrowBrokenConstant.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/SwitchArrowBrokenConstant.out	Tue Nov 12 06:32:13 2019 +0000
@@ -6,6 +6,4 @@
 SwitchArrowBrokenConstant.java:22:19: compiler.err.expected2: :, ->
 SwitchArrowBrokenConstant.java:25:20: compiler.err.expected2: :, ->
 SwitchArrowBrokenConstant.java:28:20: compiler.err.expected2: :, ->
-- compiler.note.preview.filename: SwitchArrowBrokenConstant.java
-- compiler.note.preview.recompile
 8 errors
--- a/test/langtools/tools/javac/switchextra/SwitchStatementArrow-old.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementArrow-old.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,3 +1,3 @@
-SwitchStatementArrow.java:41:20: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.switch.rules)
-SwitchStatementArrow.java:42:21: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.multiple.case.labels)
+SwitchStatementArrow.java:41:20: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.switch.rules), 9, 14
+SwitchStatementArrow.java:42:21: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.multiple.case.labels), 9, 14
 2 errors
--- a/test/langtools/tools/javac/switchextra/SwitchStatementArrow.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementArrow.java	Tue Nov 12 06:32:13 2019 +0000
@@ -3,8 +3,8 @@
  * @bug 8206986
  * @summary Verify rule cases work properly.
  * @compile/fail/ref=SwitchStatementArrow-old.out -source 9 -Xlint:-options -XDrawDiagnostics SwitchStatementArrow.java
- * @compile --enable-preview -source ${jdk.version} SwitchStatementArrow.java
- * @run main/othervm --enable-preview SwitchStatementArrow
+ * @compile SwitchStatementArrow.java
+ * @run main SwitchStatementArrow
  */
 
 import java.util.Objects;
--- a/test/langtools/tools/javac/switchextra/SwitchStatementBroken.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementBroken.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8206986
  * @summary Verify that rule and ordinary cases cannot be mixed.
- * @compile/fail/ref=SwitchStatementBroken.out -XDrawDiagnostics --enable-preview -source ${jdk.version} SwitchStatementBroken.java
+ * @compile/fail/ref=SwitchStatementBroken.out -XDrawDiagnostics SwitchStatementBroken.java
  */
 
 public class SwitchStatementBroken {
--- a/test/langtools/tools/javac/switchextra/SwitchStatementBroken.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementBroken.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,4 +1,2 @@
 SwitchStatementBroken.java:15:13: compiler.err.switch.mixing.case.types
-- compiler.note.preview.filename: SwitchStatementBroken.java
-- compiler.note.preview.recompile
 1 error
--- a/test/langtools/tools/javac/switchextra/SwitchStatementBroken2.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementBroken2.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8206986
  * @summary Verify that not allowed types of statements cannot be used in rule case.
- * @compile/fail/ref=SwitchStatementBroken2.out -XDrawDiagnostics --enable-preview -source ${jdk.version} SwitchStatementBroken2.java
+ * @compile/fail/ref=SwitchStatementBroken2.out -XDrawDiagnostics SwitchStatementBroken2.java
  */
 
 public class SwitchStatementBroken2 {
--- a/test/langtools/tools/javac/switchextra/SwitchStatementBroken2.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementBroken2.out	Tue Nov 12 06:32:13 2019 +0000
@@ -3,6 +3,4 @@
 SwitchStatementBroken2.java:19:23: compiler.err.switch.case.unexpected.statement
 SwitchStatementBroken2.java:22:27: compiler.err.variable.not.allowed
 SwitchStatementBroken2.java:23:24: compiler.err.switch.case.unexpected.statement
-- compiler.note.preview.filename: SwitchStatementBroken2.java
-- compiler.note.preview.recompile
 5 errors
--- a/test/langtools/tools/javac/switchextra/SwitchStatementScopesIsolated.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementScopesIsolated.java	Tue Nov 12 06:32:13 2019 +0000
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8206986
  * @summary Verify that scopes in rule cases are isolated.
- * @compile/fail/ref=SwitchStatementScopesIsolated.out -XDrawDiagnostics --enable-preview -source ${jdk.version} SwitchStatementScopesIsolated.java
+ * @compile/fail/ref=SwitchStatementScopesIsolated.out -XDrawDiagnostics SwitchStatementScopesIsolated.java
  */
 
 public class SwitchStatementScopesIsolated {
--- a/test/langtools/tools/javac/switchextra/SwitchStatementScopesIsolated.out	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/javac/switchextra/SwitchStatementScopesIsolated.out	Tue Nov 12 06:32:13 2019 +0000
@@ -1,5 +1,3 @@
 SwitchStatementScopesIsolated.java:13:25: compiler.err.cant.resolve.location: kindname.variable, res, , , (compiler.misc.location: kindname.class, SwitchStatementScopesIsolated, null)
 SwitchStatementScopesIsolated.java:14:26: compiler.err.cant.resolve.location: kindname.variable, res, , , (compiler.misc.location: kindname.class, SwitchStatementScopesIsolated, null)
-- compiler.note.preview.filename: SwitchStatementScopesIsolated.java
-- compiler.note.preview.recompile
 2 errors
--- a/test/langtools/tools/jdeps/listdeps/ListModuleDeps.java	Mon Nov 11 17:43:10 2019 -0800
+++ b/test/langtools/tools/jdeps/listdeps/ListModuleDeps.java	Tue Nov 12 06:32:13 2019 +0000
@@ -92,7 +92,6 @@
     public Object[][] jdkModules() {
         return new Object[][]{
             {"jdk.compiler", new String[]{
-                                "java.base/jdk.internal",
                                 "java.base/jdk.internal.jmod",
                                 "java.base/jdk.internal.misc",
                                 "java.base/sun.reflect.annotation",