update jdt.core to I20190321-0435 (first build with Java 12 support)

- initial rough merge
diff --git a/org.eclipse.jdt.core.tests.compiler/pom.xml b/org.eclipse.jdt.core.tests.compiler/pom.xml
index dd39971..f762fdd 100644
--- a/org.eclipse.jdt.core.tests.compiler/pom.xml
+++ b/org.eclipse.jdt.core.tests.compiler/pom.xml
@@ -15,7 +15,7 @@
   <parent>
     <artifactId>tests-pom</artifactId>
     <groupId>eclipse.jdt.core</groupId>
-    <version>4.11.0-SNAPSHOT</version>
+    <version>4.12.0-SNAPSHOT</version>
     <relativePath>../tests-pom/</relativePath>
   </parent>
   <groupId>org.eclipse.jdt</groupId>
@@ -37,6 +37,7 @@
 	  			<includes>
 	  				<include>org/eclipse/jdt/core/tests/compiler/parser/TestAll.class</include>
 	  				<include>org/eclipse/jdt/core/tests/compiler/regression/TestAll.class</include>
+	  				<include>org/eclipse/jdt/core/tests/eval/TestAll.class</include>
 	  			</includes>
 	  			<argLine>${tycho.surefire.argLine}</argLine>
 	  		</configuration>
@@ -137,6 +138,37 @@
 			<tycho.surefire.argLine>--add-modules ALL-SYSTEM -Dcompliance=1.4,1.7,1.8,11</tycho.surefire.argLine>
 		</properties>
 	</profile>
+	<profile>
+		<id>test-on-javase-12</id>
+		<build>
+			<plugins>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-toolchains-plugin</artifactId>
+					<version>1.1</version>
+					<executions>
+						<execution>
+							<phase>validate</phase>
+							<goals>
+								<goal>toolchain</goal>
+							</goals>
+						</execution>
+					</executions>
+					<configuration>
+						<toolchains>
+							<jdk>
+								<id>JavaSE-12</id>
+							</jdk>
+						</toolchains>
+					</configuration>
+				</plugin>
+			</plugins>
+		</build>
+		<properties>
+			<!-- Overridden in https://ci.eclipse.org/jdt/job/eclipse.jdt.core-run.javac-12/configure  -->
+			<tycho.surefire.argLine>--add-modules ALL-SYSTEM -Dcompliance=1.4,1.7,1.8,12</tycho.surefire.argLine>
+		</properties>
+	</profile>
   </profiles>
 
 </project>
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java
index b7dd847..db5c6b6 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -28,7 +28,7 @@
 // Static initializer to specify tests subset using TESTS_* static variables
 // All specified tests which does not belong to the class are skipped...
 static {
-//	TESTS_NAMES = new String[] { "test0061" };
+//	TESTS_NAMES = new String[] { "testBug531714" };
 //	TESTS_NUMBERS = new int[] { 50 };
 //	TESTS_RANGE = new int[] { 21, 50 };
 }
@@ -1256,12 +1256,22 @@
 	};
 
 	String expected13ProblemLog =
-		"----------\n" +
-		"1. ERROR in X.java (at line 3)\n" +
-		"	for(Object o : switch){\n" +
-		"	           ^\n" +
-		"Syntax error, insert \"; ; ) Statement\" to complete BlockStatements\n" +
-		"----------\n";
+			"----------\n" + 
+			"1. ERROR in X.java (at line 3)\n" + 
+			"	for(Object o : switch){\n" + 
+			"	             ^\n" + 
+			"Syntax error on token \":\", delete this token\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 3)\n" + 
+			"	for(Object o : switch){\n" + 
+			"	             ^\n" + 
+			"Syntax error, insert \": Expression )\" to complete EnhancedForStatementHeader\n" +  // FIXME: bogus suggestion, this rule is compliance 1.5
+			"----------\n" + 
+			"3. ERROR in X.java (at line 3)\n" + 
+			"	for(Object o : switch){\n" + 
+			"	             ^\n" + 
+			"Syntax error, insert \"Statement\" to complete BlockStatements\n" + 
+			"----------\n";
 	String expected14ProblemLog =
 		expected13ProblemLog;
 
@@ -3537,4 +3547,107 @@
 		"Type arguments are not allowed here\n" + 
 		"----------\n");
 }
+public void testBug531714_001() {
+	if (this.complianceLevel >= ClassFileConstants.JDK12)
+		return;
+	String[] testFiles = 			new String[] {
+			"X.java",
+			"public class X {\n" +
+			"	static int twice(int i) {\n" +
+			"		int tw = switch (i) {\n" +
+			"			case 0 -> i * 0;\n" +
+			"			case 1 -> 2;\n" +
+			"			default -> 3;\n" +
+			"		};\n" +
+			"		return tw;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.print(twice(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 3)\n" + 
+			"	int tw = switch (i) {\n" + 
+			"			case 0 -> i * 0;\n" + 
+			"			case 1 -> 2;\n" + 
+			"			default -> 3;\n" + 
+			"		};\n" + 
+			"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+			"The preview feature Switch Expressions is only available with source level 12 and above\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 4)\n" + 
+			"	case 0 -> i * 0;\n" + 
+			"	^^^^^^\n" + 
+			"The preview feature Case Labels with \'->\' is only available with source level 12 and above\n" + 
+			"----------\n" + 
+			"3. ERROR in X.java (at line 5)\n" + 
+			"	case 1 -> 2;\n" + 
+			"	^^^^^^\n" + 
+			"The preview feature Case Labels with \'->\' is only available with source level 12 and above\n" + 
+			"----------\n" + 
+			"4. ERROR in X.java (at line 6)\n" + 
+			"	default -> 3;\n" + 
+			"	^^^^^^^\n" + 
+			"The preview feature Case Labels with \'->\' is only available with source level 12 and above\n" + 
+			"----------\n";
+
+	runComplianceParserTest(
+		testFiles,
+		expectedProblemLog,
+		expectedProblemLog,
+		expectedProblemLog,
+		expectedProblemLog,
+		expectedProblemLog
+	);
+}
+public void testBug531714_002() {
+	if (this.complianceLevel >= ClassFileConstants.JDK12)
+		return;
+	String[] testFiles = new String[] {
+			"X.java",
+			"public class X {\n" +
+			"	static int twice(int i) {\n" +
+			"		switch (i) {\n" +
+			"			case 0 -> i * 0;\n" +
+			"			case 1 -> 2;\n" +
+			"			default -> 3;\n" +
+			"		}\n" +
+			"		return 0;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.print(twice(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 4)\n" + 
+			"	case 0 -> i * 0;\n" + 
+			"	^^^^^^\n" + 
+			"The preview feature Case Labels with \'->\' is only available with source level 12 and above\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 5)\n" + 
+			"	case 1 -> 2;\n" + 
+			"	^^^^^^\n" + 
+			"The preview feature Case Labels with \'->\' is only available with source level 12 and above\n" + 
+			"----------\n" + 
+			"3. ERROR in X.java (at line 6)\n" + 
+			"	default -> 3;\n" + 
+			"	^^^^^^^\n" + 
+			"The preview feature Case Labels with \'->\' is only available with source level 12 and above\n" + 
+			"----------\n";
+
+	runComplianceParserTest(
+		testFiles,
+		expectedProblemLog,
+		expectedProblemLog,
+		expectedProblemLog,
+		expectedProblemLog,
+		expectedProblemLog
+	);
+}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
index 251c257..ea1ecc2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
@@ -191,7 +191,7 @@
 		additionalTags = new char[][] {
 			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE
 		};
-	} else if(this.complianceLevel > ClassFileConstants.JDK1_4) {
+	} else if(this.complianceLevel > ClassFileConstants.JDK1_4 && this.complianceLevel < ClassFileConstants.JDK12) {
 //{ObjectTeams: override with new role tag:
 		allTags = new char[][] {
 				// Block tags
@@ -208,6 +208,11 @@
 			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
 			TAG_CODE, TAG_LITERAL
 		};
+	} else if(this.complianceLevel >= ClassFileConstants.JDK12) {
+		additionalTags = new char[][] {
+			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+			TAG_CODE, TAG_LITERAL, TAG_SYSTEM_PROPERTY
+		};
 	}
 	allTagsFinal = this.complianceLevel > ClassFileConstants.JDK1_8 ? allTagsJava9Plus  : allTags;
 	if (additionalTags != null) {
@@ -299,11 +304,16 @@
 		additionalTags = new char[][] {
 			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE
 		};
-	} else if (this.complianceLevel > ClassFileConstants.JDK1_4) {
+	} else if(this.complianceLevel > ClassFileConstants.JDK1_4 && this.complianceLevel < ClassFileConstants.JDK12) {
 		additionalTags = new char[][] {
 			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
 			TAG_CODE, TAG_LITERAL
 		};
+	} else if(this.complianceLevel >= ClassFileConstants.JDK12) {
+		additionalTags = new char[][] {
+			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+			TAG_CODE, TAG_LITERAL, TAG_SYSTEM_PROPERTY
+		};
 	}
 	if (additionalTags != null) {
 		int length = allTags.length;
@@ -442,7 +452,9 @@
 		" */\n" +
 		"public class Test {}\n";
 	verifyCompletionInJavadoc(source, "@s");
-	verifyCompletionOnJavadocTag("s".toCharArray(), new char[][] { TAG_SEE, TAG_SINCE, TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD }, false);
+	char[][] expectedTags = {TAG_SEE, TAG_SINCE, TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD};
+	char[][] expectedTags12Plus = {TAG_SEE, TAG_SINCE, TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD,TAG_SYSTEM_PROPERTY};		
+	verifyCompletionOnJavadocTag("s".toCharArray(),this.complianceLevel >= ClassFileConstants.JDK12 ? expectedTags12Plus : expectedTags, false);
 	CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
 	assertEquals("Invalid tag start position", 24, completionTag.tagSourceStart);
 	assertEquals("Invalid tag end position", 28, completionTag.tagSourceEnd+1);
@@ -520,12 +532,16 @@
 		additionalTags = new char[][] {
 			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE
 		};
-	}
-	else if (this.complianceLevel > ClassFileConstants.JDK1_4) {
+	}else if (this.complianceLevel > ClassFileConstants.JDK1_4 && this.complianceLevel < ClassFileConstants.JDK12) {
 		additionalTags = new char[][] {
 			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
 			TAG_CODE, TAG_LITERAL
 		};
+	}else if (this.complianceLevel >= ClassFileConstants.JDK12) {
+		additionalTags = new char[][] {
+			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+			TAG_CODE, TAG_LITERAL, TAG_SYSTEM_PROPERTY
+		};
 	}
 	if (additionalTags != null) {
 		int length = allTags.length;
@@ -595,12 +611,18 @@
 			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE
 		};
 	}
-	else if (this.complianceLevel > ClassFileConstants.JDK1_4) {
+	else if(this.complianceLevel > ClassFileConstants.JDK1_4 && this.complianceLevel < ClassFileConstants.JDK12) {
 		additionalTags = new char[][] {
 			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
 			TAG_CODE, TAG_LITERAL
 		};
+	} else if(this.complianceLevel >= ClassFileConstants.JDK12) {
+		additionalTags = new char[][] {
+			TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+			TAG_CODE, TAG_LITERAL, TAG_SYSTEM_PROPERTY
+		};
 	}
+
 	if (additionalTags != null) {
 		int length = allTags.length;
 		int add = additionalTags.length;
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest12.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest12.java
new file mode 100644
index 0000000..d8de116
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest12.java
@@ -0,0 +1,1070 @@
+/*******************************************************************************
+ * Copyright (c) 2019 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.compiler.parser;
+
+import org.eclipse.jdt.core.JavaModelException;
+
+import junit.framework.Test;
+
+public class SelectionParserTest12 extends AbstractSelectionTest {
+static {
+//		TESTS_NUMBERS = new int[] { 1 };
+//		TESTS_NAMES = new String[] { "test005" };
+}
+public static Test suite() {
+	return buildMinimalComplianceTestSuite(SelectionParserTest12.class, F_12);
+}
+
+public SelectionParserTest12(String testName) {
+	super(testName);
+}
+/*
+ * Multi constant case statement with ':', selection node is the string constant
+ */
+public void test001() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"static final String ONE=\"One\", TWO = \"Two\", THREE=\"Three\";\n" +
+	"  public static void foo(String num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE:\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"}";
+
+	String selection = "ONE";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "ONE";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+					"  static final String ONE;\n" + 
+					"  static final String TWO;\n" + 
+					"  static final String THREE;\n" + 
+					"  <clinit>() {\n" + 
+					"  }\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  public static void foo(String num) {\n" + 
+					"    {\n" + 
+					"      switch (num) {\n" + 
+					"      case <SelectOnName:ONE> :\n" + 
+					"      }\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"}\n";
+	String expectedReplacedSource = "ONE";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = string.lastIndexOf(selection) + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with ':', selection node is the first enum constant
+ */
+public void test002() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"  public static void foo(Num num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE:\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}";
+
+	String selection = "ONE";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "ONE";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+					"  enum Num {\n" + 
+					"    ONE(),\n" + 
+					"    TWO(),\n" + 
+					"    THREE(),\n" + 
+					"    <clinit>() {\n" + 
+					"    }\n" + 
+					"    Num() {\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  public static void foo(Num num) {\n" + 
+					"    {\n" + 
+					"      switch (num) {\n" + 
+					"      case <SelectOnName:ONE> :\n" + 
+					"      }\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"}\n";
+	String expectedReplacedSource = "ONE";
+	String testName = "X.java";
+
+	int selectionStart = string.indexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with ':', selection node is the second string constant
+ */
+public void test003() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"static final String ONE=\"One\", TWO = \"Two\", THREE=\"Three\";\n" +
+	"  public static void foo(String num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE:\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"}";
+
+	String selection = "TWO";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "TWO";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+					"  static final String ONE;\n" + 
+					"  static final String TWO;\n" + 
+					"  static final String THREE;\n" + 
+					"  <clinit>() {\n" + 
+					"  }\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  public static void foo(String num) {\n" + 
+					"    {\n" + 
+					"      switch (num) {\n" + 
+					"      case <SelectOnName:TWO> :\n" + 
+					"      }\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"}\n";
+	String expectedReplacedSource = "TWO";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = string.lastIndexOf(selection) + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with ':', selection node is the second enum constant
+ */
+public void test004() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"  public static void foo(Num num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE:\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}";
+
+	String selection = "TWO";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "TWO";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+					"  enum Num {\n" + 
+					"    ONE(),\n" + 
+					"    TWO(),\n" + 
+					"    THREE(),\n" + 
+					"    <clinit>() {\n" + 
+					"    }\n" + 
+					"    Num() {\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  public static void foo(Num num) {\n" + 
+					"    {\n" + 
+					"      switch (num) {\n" + 
+					"      case <SelectOnName:TWO> :\n" + 
+					"      }\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"}\n";
+	String expectedReplacedSource = "TWO";
+	String testName = "X.java";
+
+	int selectionStart = string.indexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection node is the string constant
+ */
+public void test005() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"static final String ONE=\"One\", TWO = \"Two\", THREE=\"Three\";\n" +
+	"  public static void foo(String num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE ->\n" +
+	"		 System.out.println(num);\n" +
+	"    }" +
+	"  }\n" +
+	"}";
+	/*
+	 * Note: The completion parser ignores the -> that follows and we end up creating
+	 * the CaseStatement without maring it as an Expression, hence the ':' instead of the '->'
+	 */
+	String selection = "ONE";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+	String selectionIdentifier = "ONE";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+					"  static final String ONE;\n" + 
+					"  static final String TWO;\n" + 
+					"  static final String THREE;\n" + 
+					"  <clinit>() {\n" + 
+					"  }\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  public static void foo(String num) {\n" + 
+					"    {\n" + 
+					"      switch (num) {\n" + 
+					"      case <SelectOnName:ONE> :\n" + 
+					"      }\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"}\n";
+	String expectedReplacedSource = "ONE";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = string.lastIndexOf(selection) + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection node is the first enum constant
+ */
+public void test006() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"  public static void foo(Num num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE ->\n" +
+	"		 System.out.println(num);\n" +
+	"		 break; // illegal, but should be ignored and shouldn't matter\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}";
+
+	String selection = "ONE";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "ONE";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+					"  enum Num {\n" + 
+					"    ONE(),\n" + 
+					"    TWO(),\n" + 
+					"    THREE(),\n" + 
+					"    <clinit>() {\n" + 
+					"    }\n" + 
+					"    Num() {\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  public static void foo(Num num) {\n" + 
+					"    {\n" + 
+					"      switch (num) {\n" + 
+					"      case <SelectOnName:ONE> :\n" + 
+					"      }\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"}\n";
+	String expectedReplacedSource = "ONE";
+	String testName = "X.java";
+
+	int selectionStart = string.indexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection node is the second string constant
+ */
+public void test007() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"static final String ONE=\"One\", TWO = \"Two\", THREE=\"Three\";\n" +
+	"  public static void foo(String num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE ->\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"}";
+
+	String selection = "TWO";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "TWO";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+					"  static final String ONE;\n" + 
+					"  static final String TWO;\n" + 
+					"  static final String THREE;\n" + 
+					"  <clinit>() {\n" + 
+					"  }\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  public static void foo(String num) {\n" + 
+					"    {\n" + 
+					"      switch (num) {\n" + 
+					"      case <SelectOnName:TWO> :\n" + 
+					"      }\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"}\n";
+	String expectedReplacedSource = "TWO";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = string.lastIndexOf(selection) + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection node is the second enum constant
+ */
+public void test008() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"  public static void foo(Num num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE ->\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}";
+
+	String selection = "TWO";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "TWO";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+					"  enum Num {\n" + 
+					"    ONE(),\n" + 
+					"    TWO(),\n" + 
+					"    THREE(),\n" + 
+					"    <clinit>() {\n" + 
+					"    }\n" + 
+					"    Num() {\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  public static void foo(Num num) {\n" + 
+					"    {\n" + 
+					"      switch (num) {\n" + 
+					"      case <SelectOnName:TWO> :\n" + 
+					"      }\n" + 
+					"    }\n" + 
+					"  }\n" + 
+					"}\n";
+	String expectedReplacedSource = "TWO";
+	String testName = "X.java";
+
+	int selectionStart = string.indexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection is a reference in the case block
+ * which same as the switch's expression
+ */
+public void test009() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"  public static void foo(Num num_) {\n" +
+	" 	 switch (num_) {\n" +
+	"	   case ONE, TWO, THREE ->\n" +
+	"		 System.out.println(num_);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}";
+
+	String selection = "num_";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "num_";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+			"  enum Num {\n" + 
+			"    ONE(),\n" + 
+			"    TWO(),\n" + 
+			"    THREE(),\n" + 
+			"    <clinit>() {\n" + 
+			"    }\n" + 
+			"    Num() {\n" + 
+			"    }\n" + 
+			"  }\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  public static void foo(Num num_) {\n" + 
+			"    {\n" + 
+			"      <SelectOnName:num_>;\n" + 
+			"    }\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "num_";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection is a reference in the case block
+ * which is referencing a local variable defined in the case block
+ */
+public void test010() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"  public static void foo(Num num_) {\n" +
+	" 	 switch (num_) {\n" +
+	"	   case ONE, TWO, THREE -> {\n" +
+	"		 int i_j = 0;" +
+	"		 System.out.println(i_j);\n" +
+	"		 break;" +
+	"		 }\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}";
+
+	String selection = "i_j";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "i_j";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+			"  enum Num {\n" + 
+			"    ONE(),\n" + 
+			"    TWO(),\n" + 
+			"    THREE(),\n" + 
+			"    <clinit>() {\n" + 
+			"    }\n" + 
+			"    Num() {\n" + 
+			"    }\n" + 
+			"  }\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  public static void foo(Num num_) {\n" + 
+			"    {\n" + 
+			"      {\n" + 
+			"        int i_j;\n" + 
+			"        <SelectOnName:i_j>;\n" + 
+			"      }\n" + 
+			"    }\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "i_j";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type enum in switch expression
+ */
+public void test011() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"  public static void foo(Num num_) {\n" +
+	" 	 switch (num_) {\n" +
+	"	   case ONE, TWO, THREE -> {\n" +
+	"		 break;" +
+	"		 }\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}";
+
+	String selection = "num_";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "num_";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+			"  enum Num {\n" + 
+			"    ONE(),\n" + 
+			"    TWO(),\n" + 
+			"    THREE(),\n" + 
+			"    <clinit>() {\n" + 
+			"    }\n" + 
+			"    Num() {\n" + 
+			"    }\n" + 
+			"  }\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  public static void foo(Num num_) {\n" + 
+			"    <SelectOnName:num_>;\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "num_";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type int in switch expression
+ */
+public void test012() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"  public static void foo(int num_) {\n" +
+	" 	 switch (num_ + 1) {\n" +
+	"	   case 1, 2, 3 -> {\n" +
+	"		 break;" +
+	"		 }\n" +
+	"    }" +
+	"  }\n" +
+	"}";
+
+	String selection = "num_";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "num_";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  public static void foo(int num_) {\n" + 
+			"    <SelectOnName:num_>;\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "num_";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type int in switch expression
+ */
+public void test013() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"  public static void foo(int num_) {\n" +
+	" 	 int i = switch (num_) {\n" +
+	"	   case 1, 2, 3 -> (num_ + 1);\n" +
+	"      default -> 0;\n" + 
+	"    }" +
+	"  }\n" +
+	"}";
+
+	String selection = "num_";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "num_";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  public static void foo(int num_) {\n" + 
+			"    int i;\n" + 
+			"    {\n" + 
+			"      <SelectOnName:num_>;\n" + 
+			"    }\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "num_";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type int in switch expression
+ */
+public void test014() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"  public static void foo(int num_) {\n" +
+	" 	 int i = switch (num_) {\n" +
+	"	   case 1, 2, 3 -> 0;\n" +
+	"      default -> (num_ + 1);\n" + 
+	"    }" +
+	"  }\n" +
+	"}";
+
+	String selection = "num_";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "num_";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  public static void foo(int num_) {\n" + 
+			"    int i;\n" + 
+			"    {\n" + 
+			"      <SelectOnName:num_>;\n" + 
+			"    }\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "num_";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type int in switch expression
+ */
+public void test015() throws JavaModelException {
+	String string =  "public class X {\n" +
+	"  public static void foo(int num_) {\n" +
+	" 	 int i = switch (num_) {\n" +
+	"	   case 1, 2, 3 -> 0;\n" +
+	"      default -> (num_ + 1);\n" + 
+	"    }" +
+	"  }\n" +
+	"}";
+
+	String selection = "num_";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "num_";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  public static void foo(int num_) {\n" + 
+			"    int i;\n" + 
+			"    {\n" + 
+			"      <SelectOnName:num_>;\n" + 
+			"    }\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "num_";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type int in switch expression
+ */
+public void test016() throws JavaModelException {
+	String string =  "public class X {\n" + 
+			"	public void bar(int s) {\n" + 
+			"		int i_j = switch (s) {\n" + 
+			"			case 1, 2, 3 -> (s+1);\n" +
+			"			default -> i_j;\n" + 
+			"		};\n" + 
+			"	}\n" + 
+			"}\n";
+
+	String selection = "i_j";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "i_j";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  public void bar(int s) {\n" + 
+			"    int i_j;\n" + 
+			"    {\n" + 
+			"      <SelectOnName:i_j>;\n" + 
+			"    }\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "i_j";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+public void test017() throws JavaModelException {
+	String string =  "public class X {\n" + 
+			"	public void bar(int s) {\n" + 
+			"		int i_j = switch (s) {\n" + 
+			"			case 1, 2, 3 -> (s+1);\n" +
+			"			default -> (1+i_j);\n" + 
+			"		};\n" + 
+			"	}\n" + 
+			"}\n";
+
+	String selection = "i_j";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "i_j";
+	String expectedUnitDisplayString =
+			"public class X {\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  public void bar(int s) {\n" + 
+			"    int i_j;\n" + 
+			"    {\n" + 
+			"      <SelectOnName:i_j>;\n" + 
+			"    }\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "i_j";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+public void test018() throws JavaModelException {
+	String string =  "import org.eclipse.jdt.annotation.*;\n" + 
+			"import java.util.function.*;\n" + 
+			"interface IN0 {} \n" + 
+			"interface IN1 extends IN0 {} \n" + 
+			"interface IN2 extends IN0 {}\n" + 
+			"public class X {\n" + 
+			"	 IN1 n_1() { return new IN1() {}; } \n" + 
+			"	IN2 n_2() { return null; } \n" + 
+			"	<M> void m( Supplier< M> m2) { } \n" + 
+			"	void testSw(int i) { \n" + 
+			"		m(switch(i) { \n" + 
+			"			case 1 -> this::n_1; \n" + 
+			"			default -> this::n_2; }); \n" + 
+			"	}\n" + 
+			"}";
+
+	String selection = "n_1";
+	String selectKey = "<SelectionOnReferenceExpressionName:this::";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "n_1";
+	String expectedUnitDisplayString =
+			"import org.eclipse.jdt.annotation.*;\n" + 
+			"import java.util.function.*;\n" + 
+			"interface IN0 {\n" + 
+			"}\n" + 
+			"interface IN1 extends IN0 {\n" + 
+			"}\n" + 
+			"interface IN2 extends IN0 {\n" + 
+			"}\n" + 
+			"public class X {\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  IN1 n_1() {\n" + 
+			"  }\n" + 
+			"  IN2 n_2() {\n" + 
+			"  }\n" + 
+			"  <M>void m(Supplier<M> m2) {\n" + 
+			"  }\n" + 
+			"  void testSw(int i) {\n" + 
+			"    m(switch (i) {\n" + 
+			"case 1 ->\n" + 
+			" <SelectionOnReferenceExpressionName:this::n_1>;\n" + 
+			"default ->\n" + 
+			" this::n_2;\n" + 
+			"});\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "this::n_1";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+public void test019() throws JavaModelException {
+	String string =  "import org.eclipse.jdt.annotation.*;\n" + 
+			"import java.util.function.*;\n" + 
+			"interface IN0 {} \n" + 
+			"interface IN1 extends IN0 {} \n" + 
+			"interface IN2 extends IN0 {}\n" + 
+			"public class X {\n" + 
+			"	 IN1 n_1() { return new IN1() {}; } \n" + 
+			"	IN2 n_2() { return null; } \n" + 
+			"	<M> void m( Supplier< M> m2) { } \n" + 
+			"	void testSw(int i) { \n" + 
+			"		m(switch(i) { \n" + 
+			"			case 2 -> () -> n_1(); \n" + 
+			"			default -> this::n_2; }); \n" + 
+			"	}\n" + 
+			"}";
+
+	String selection = "n_1";
+	String selectKey = "<SelectOnMessageSend:";
+	String expectedSelection = selectKey + selection + "()>";
+
+	String selectionIdentifier = "n_1";
+	String expectedUnitDisplayString =
+			"import org.eclipse.jdt.annotation.*;\n" + 
+			"import java.util.function.*;\n" + 
+			"interface IN0 {\n" + 
+			"}\n" + 
+			"interface IN1 extends IN0 {\n" + 
+			"}\n" + 
+			"interface IN2 extends IN0 {\n" + 
+			"}\n" + 
+			"public class X {\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  IN1 n_1() {\n" + 
+			"  }\n" + 
+			"  IN2 n_2() {\n" + 
+			"  }\n" + 
+			"  <M>void m(Supplier<M> m2) {\n" + 
+			"  }\n" + 
+			"  void testSw(int i) {\n" + 
+			"    m(switch (i) {\n" + 
+			"case 2 ->\n" + 
+			" () -> <SelectOnMessageSend:n_1()>;\n" + 
+			"default ->\n" + 
+			" this::n_2;\n" + 
+			"});\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "n_1()";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+public void test020() throws JavaModelException {
+	String string =  "import org.eclipse.jdt.annotation.*;\n" + 
+			"import java.util.function.*;\n" + 
+			"interface IN0 {} \n" + 
+			"interface IN1 extends IN0 {} \n" + 
+			"interface IN2 extends IN0 {}\n" + 
+			"public class X {\n" + 
+			"	 IN1 n_1() { return new IN1() {}; } \n" + 
+			"	IN2 n_2() { return null; } \n" + 
+			"	<M> void m( Supplier< M> m2) { } \n" + 
+			"	void testSw(int i) { \n" + 
+			"		m(switch(i) { \n" + 
+			"			default -> this::n_2; }); \n" + 
+			"	}\n" + 
+			"}";
+
+	String selection = "n_2";
+	String selectKey = "<SelectionOnReferenceExpressionName:this::";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "n_2";
+	String expectedUnitDisplayString =
+			"import org.eclipse.jdt.annotation.*;\n" + 
+			"import java.util.function.*;\n" + 
+			"interface IN0 {\n" + 
+			"}\n" + 
+			"interface IN1 extends IN0 {\n" + 
+			"}\n" + 
+			"interface IN2 extends IN0 {\n" + 
+			"}\n" + 
+			"public class X {\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  IN1 n_1() {\n" + 
+			"  }\n" + 
+			"  IN2 n_2() {\n" + 
+			"  }\n" + 
+			"  <M>void m(Supplier<M> m2) {\n" + 
+			"  }\n" + 
+			"  void testSw(int i) {\n" + 
+			"    m(switch (i) {\n" + 
+			"default ->\n" + 
+			" <SelectionOnReferenceExpressionName:this::n_2>;\n" + 
+			"});\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "this::n_2";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+public void test021() throws JavaModelException {
+	String string =  "import org.eclipse.jdt.annotation.*;\n" + 
+			"import java.util.function.*;\n" + 
+			"interface IN0 {} \n" + 
+			"interface IN1 extends IN0 {} \n" + 
+			"interface IN2 extends IN0 {}\n" + 
+			"public class X {\n" + 
+			"	 IN1 n_1(int ijk) { return new IN1() {}; } \n" + 
+			"	IN2 n_2() { return null; } \n" + 
+			"	<M> void m( Supplier< M> m2) { } \n" + 
+			"	void testSw(int ijk) { \n" + 
+			"		m(switch(ijk) { \n" + 
+			"			default -> () -> n_1(ijk); }); \n" + 
+			"	}\n" + 
+			"}";
+
+	String selection = "n_1";
+	String selectKey = "<SelectOnMessageSend:";
+	String expectedSelection = selectKey + selection + "(ijk)>";
+
+	String selectionIdentifier = "n_1";
+	String expectedUnitDisplayString =
+			"import org.eclipse.jdt.annotation.*;\n" + 
+			"import java.util.function.*;\n" + 
+			"interface IN0 {\n" + 
+			"}\n" + 
+			"interface IN1 extends IN0 {\n" + 
+			"}\n" + 
+			"interface IN2 extends IN0 {\n" + 
+			"}\n" + 
+			"public class X {\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  IN1 n_1(int ijk) {\n" + 
+			"  }\n" + 
+			"  IN2 n_2() {\n" + 
+			"  }\n" + 
+			"  <M>void m(Supplier<M> m2) {\n" + 
+			"  }\n" + 
+			"  void testSw(int ijk) {\n" + 
+			"    m(switch (ijk) {\n" + 
+			"default ->\n" + 
+			" () -> <SelectOnMessageSend:n_1(ijk)>;\n" + 
+			"});\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "n_1(ijk)";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+public void test022() throws JavaModelException {
+	String string =  "import org.eclipse.jdt.annotation.*;\n" + 
+			"import java.util.function.*;\n" + 
+			"interface IN0 {} \n" + 
+			"interface IN1 extends IN0 {} \n" + 
+			"interface IN2 extends IN0 {}\n" + 
+			"public class X {\n" + 
+			"	 IN1 n_1(int ijk) { return new IN1() {}; } \n" + 
+			"	IN2 n_2() { return null; } \n" + 
+			"	<M> void m( Supplier< M> m2) { } \n" + 
+			"	void testSw(int ijk) { \n" + 
+			"		m(switch(ijk) { \n" + 
+			"			default -> () -> n_1(ijk); }); \n" + 
+			"	}\n" + 
+			"}";
+
+	String selection = "ijk";
+	String selectKey = "<SelectOnName:";
+	String expectedSelection = selectKey + selection + ">";
+
+	String selectionIdentifier = "ijk";
+	String expectedUnitDisplayString =
+			"import org.eclipse.jdt.annotation.*;\n" + 
+			"import java.util.function.*;\n" + 
+			"interface IN0 {\n" + 
+			"}\n" + 
+			"interface IN1 extends IN0 {\n" + 
+			"}\n" + 
+			"interface IN2 extends IN0 {\n" + 
+			"}\n" + 
+			"public class X {\n" + 
+			"  public X() {\n" + 
+			"  }\n" + 
+			"  IN1 n_1(int ijk) {\n" + 
+			"  }\n" + 
+			"  IN2 n_2() {\n" + 
+			"  }\n" + 
+			"  <M>void m(Supplier<M> m2) {\n" + 
+			"  }\n" + 
+			"  void testSw(int ijk) {\n" + 
+			"    m(switch (ijk) {\n" + 
+			"default ->\n" + 
+			" () -> n_1(<SelectOnName:ijk>);\n" + 
+			"});\n" + 
+			"  }\n" + 
+			"}\n";
+	String expectedReplacedSource = "ijk";
+	String testName = "X.java";
+
+	int selectionStart = string.lastIndexOf(selection);
+	int selectionEnd = selectionStart + selection.length() - 1;
+
+	checkMethodParse(string.toCharArray(), selectionStart, selectionEnd, expectedSelection, expectedUnitDisplayString,
+			selectionIdentifier, expectedReplacedSource, testName);
+}
+}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java
index 65287ab..8699a67 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -153,6 +153,7 @@
 		tests_10.add(CompletionParserTest18.class);
 		tests_10.add(SelectionParserTest18.class);
 		tests_10.add(SelectionParserTest9.class);
+		tests_10.add(SelectionParserTest10.class);
 		tests_10.add(ModuleDeclarationSyntaxTest.class);
 		tests_10.add(JEP286ReservedWordTest.class);
 		// Reset forgotten subsets tests
@@ -173,6 +174,7 @@
 		tests_11.add(CompletionParserTest18.class);
 		tests_11.add(SelectionParserTest18.class);
 		tests_11.add(SelectionParserTest9.class);
+		tests_11.add(SelectionParserTest10.class);
 		tests_11.add(ModuleDeclarationSyntaxTest.class);
 		tests_11.add(JEP286ReservedWordTest.class);
 		// Reset forgotten subsets tests
@@ -183,6 +185,28 @@
 		TestCase.RUN_ONLY_ID = null;
 		all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11), tests_11));
 	}
+	if ((possibleComplianceLevels & AbstractCompilerTest.F_12) != 0) {
+		ArrayList tests_12 = (ArrayList)testClasses.clone();
+		tests_12.addAll(TEST_CLASSES_1_5);
+		tests_12.add(ParserTest1_7.class);
+		tests_12.add(LambdaExpressionSyntaxTest.class);
+		tests_12.add(ReferenceExpressionSyntaxTest.class);
+		tests_12.add(TypeAnnotationSyntaxTest.class);
+		tests_12.add(CompletionParserTest18.class);
+		tests_12.add(SelectionParserTest18.class);
+		tests_12.add(SelectionParserTest9.class);
+		tests_12.add(SelectionParserTest10.class);
+		tests_12.add(SelectionParserTest12.class);
+		tests_12.add(ModuleDeclarationSyntaxTest.class);
+		tests_12.add(JEP286ReservedWordTest.class);
+		// Reset forgotten subsets tests
+		TestCase.TESTS_PREFIX = null;
+		TestCase.TESTS_NAMES = null;
+		TestCase.TESTS_NUMBERS= null;
+		TestCase.TESTS_RANGE = null;
+		TestCase.RUN_ONLY_ID = null;
+		all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_12), tests_12));
+	}
 	return all;
 }
 public static Test suite() {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java
index c0e95a3..83d844a 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -110,6 +110,29 @@
 	}
 	
 	protected String intersection(String... types) {
+		// From JDK 12, Comparable gets two new super interfaces, namely Constable and ConstantDesc.
+		// The idea is to append Comparable with &Constable&ConstantDesc automatically.
+		if (isJRE12Plus) {
+			int index = -1;
+			for(int i = 0; i < types.length; i++) {
+				if (types[i].startsWith("Comparable") && !types[i].endsWith("ConstantDesc")) {
+					if ((types.length <= i+1) || !types[i+1].startsWith("CharSequence")) {
+						index = i;
+						break;
+					}
+				}
+			}
+			if (index >= 0) {
+				index++;
+				String[] temp = new String[types.length + 2];
+				System.arraycopy(types, 0, temp, 0, index);
+				temp[index] = "Constable";
+				temp[index+1] = "ConstantDesc";
+				if (index < types.length)
+ 					System.arraycopy(types, index, temp, index+2, types.length - index);
+				types = temp;
+			}
+		}
 		if (this.complianceLevel >= ClassFileConstants.JDK1_8)
 			return String.join(" & ", types);
 		return String.join("&", types);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
index 314acc0..403270f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
@@ -300,6 +300,8 @@
 			return JavaCore.VERSION_10;
 		} else if(rawVersion.startsWith("11")) {
 			return JavaCore.VERSION_11;
+		} else if(rawVersion.startsWith("12")) {
+			return JavaCore.VERSION_12;
 		} else {
 			throw new RuntimeException("unknown javac version: " + rawVersion);
 		}
@@ -410,6 +412,17 @@
 				return 0200;
 			}
 		}
+		if (version == JavaCore.VERSION_12) {
+			if ("12".equals(rawVersion)) {
+				return 0000;
+			}
+			if ("12.0.1".equals(rawVersion)) {
+				return 0100;
+			}
+			if ("12.0.2".equals(rawVersion)) {
+				return 0200;
+			}
+		}
 		throw new RuntimeException("unknown raw javac version: " + rawVersion);
 	}
 	// returns 0L if everything went fine; else the lower word contains the
@@ -1724,6 +1737,9 @@
 			JavacTestOptions.DEFAULT /* default javac test options */);
 	}
 	protected void runConformTest(String[] testFiles, String expectedOutput, Map customOptions) {
+		runConformTest(testFiles, expectedOutput, customOptions, null);
+	}
+	protected void runConformTest(String[] testFiles, String expectedOutput, Map customOptions, String[] vmArguments) {
 		runTest(
 			// test directory preparation
 			true /* flush output directory */,
@@ -1738,7 +1754,7 @@
 			null /* do not check compiler log */,
 			// runtime options
 			false /* do not force execution */,
-			null /* no vm arguments */,
+			vmArguments /* no vm arguments */,
 			// runtime results
 			expectedOutput /* expected output string */,
 			null /* do not check error string */,
@@ -2558,10 +2574,19 @@
 						JavacTestOptions.DEFAULT /* javac test options */);
 		}
 	protected void runNegativeTest(
+			String[] testFiles,
+			String expectedCompilerLog,
+			String[] classLibraries,
+			boolean shouldFlushOutputDirectory,
+			Map customOptions) {
+		runNegativeTest(testFiles, expectedCompilerLog, classLibraries, shouldFlushOutputDirectory, null, customOptions);
+	}
+	protected void runNegativeTest(
 		String[] testFiles,
 		String expectedCompilerLog,
 		String[] classLibraries,
 		boolean shouldFlushOutputDirectory,
+		String[] vmArguments,
 		Map customOptions) {
 		runTest(
 	 		// test directory preparation
@@ -2582,7 +2607,7 @@
 			expectedCompilerLog /* expected compiler log */,
 			// runtime options
 			false /* do not force execution */,
-			null /* no vm arguments */,
+			vmArguments /* no vm arguments */,
 			// runtime results
 			null /* do not check output string */,
 			null /* do not check error string */,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
index 67ef467..f2bea4d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
@@ -1067,7 +1067,6 @@
 			"		<option key=\"org.eclipse.jdt.core.compiler.generateClassFiles\" value=\"enabled\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.maxProblemPerUnit\" value=\"100\"/>\n" +
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.APILeak\" value=\"warning\"/>\n" + 
-			"		<option key=\"org.eclipse.jdt.core.compiler.problem.EnablePreviews\" value=\"disabled\"/>\n" +
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.annotationSuperInterface\" value=\"warning\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.assertIdentifier\" value=\"warning\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.autoboxing\" value=\"ignore\"/>\n" + 
@@ -1079,6 +1078,7 @@
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod\" value=\"disabled\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.discouragedReference\" value=\"warning\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.emptyStatement\" value=\"ignore\"/>\n" + 
+			"		<option key=\"org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures\" value=\"disabled\"/>\n" +
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.enumIdentifier\" value=\"warning\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable\" value=\"ignore\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.fallthroughCase\" value=\"ignore\"/>\n" + 
@@ -1138,6 +1138,7 @@
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.redundantSuperinterface\" value=\"ignore\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic\" value=\"ignore\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic\" value=\"ignore\"/>\n" + 
+			"		<option key=\"org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures\" value=\"warning\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors\" value=\"disabled\"/>\n" + 
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
index 899054a..f21ce41 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2018 IBM Corporation and others.
+ * Copyright (c) 2006, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -78,270 +78,240 @@
 @SuppressWarnings({ "unchecked", "rawtypes" })
 public class CompilerInvocationTests extends AbstractRegressionTest {
 
-public CompilerInvocationTests(String name) {
-    super(name);
-}
+	public CompilerInvocationTests(String name) {
+		super(name);
+	}
 
 	// Static initializer to specify tests subset using TESTS_* static variables
-  	// All specified tests which does not belong to the class are skipped...
-  	// Only the highest compliance level is run; add the VM argument
-  	// -Dcompliance=1.4 (for example) to lower it if needed
-  	static {
-//    	TESTS_NAMES = new String[] { "test003_task_tags_options" };
+	// All specified tests which does not belong to the class are skipped...
+	// Only the highest compliance level is run; add the VM argument
+	// -Dcompliance=1.4 (for example) to lower it if needed
+	static {
+//    	TESTS_NAMES = new String[] { "test011_problem_categories" };
 //    	TESTS_NUMBERS = new int[] { 1 };
 //    	TESTS_RANGE = new int[] { 1, -1 };
 //  	TESTS_RANGE = new int[] { 1, 2049 };
 //  	TESTS_RANGE = new int[] { 449, 451 };
 //    	TESTS_RANGE = new int[] { 900, 999 };
-  	}
+	}
 
-public static Test suite() {
-    return buildAllCompliancesTestSuite(testClass());
-}
+	public static Test suite() {
+		return buildAllCompliancesTestSuite(testClass());
+	}
 
-public static Class testClass() {
-    return CompilerInvocationTests.class;
-}
+	public static Class testClass() {
+		return CompilerInvocationTests.class;
+	}
 
 // irritant vs warning token - check To/From symmetry
-public void test001_irritant_warning_token() {
-	Map matcher = new HashMap();
-	for (int group = 0; group < IrritantSet.GROUP_MAX; group++) {
-		for (int i = 0; i < 29; i++) {
-			int irritant = (group << IrritantSet.GROUP_SHIFT) + (1 << i);
-			String token = CompilerOptions.warningTokenFromIrritant(irritant);
-			if (token != null) {
-				matcher.put(token, token);
-				assertTrue(CompilerOptions.warningTokenToIrritants(token) != null);
-			}
-		}
-	}
-	// Add one for "preview", which doesn't have any irritant at the moment
-	matcher.put("preview", "preview");
-	String [] allTokens = CompilerOptions.warningTokens;
-	int length = allTokens.length;
-	matcher.put("all", "all"); // all gets undetected in the From/To loop
-	assertEquals(allTokens.length, matcher.size());
-	for (int i = 0; i < length; i++) {
-		Object object = matcher.get(allTokens[i]);
-		assertNotNull(object);
-	}
-}
-
-// problem categories - check that none is left unspecified
-// see also discussion in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208383
-public void test002_problem_categories() {
-	try {
-		Class iProblemClass;
-		Field[] fields = (iProblemClass = IProblem.class).getFields();
-		for (int i = 0, length = fields.length; i < length; i++) {
-			Field field = fields[i];
-			if (field.getType() == Integer.TYPE) {
-				int problemId = field.getInt(iProblemClass), maskedProblemId = problemId & IProblem.IgnoreCategoriesMask;
-				if (maskedProblemId != 0 && maskedProblemId != IProblem.IgnoreCategoriesMask
-						&& ProblemReporter.getProblemCategory(ProblemSeverities.Error, problemId)
-							== CategorizedProblem.CAT_UNSPECIFIED) {
-					 fail("unspecified category for problem " + field.getName());
+	public void test001_irritant_warning_token() {
+		Map matcher = new HashMap();
+		for (int group = 0; group < IrritantSet.GROUP_MAX; group++) {
+			for (int i = 0; i < 29; i++) {
+				int irritant = (group << IrritantSet.GROUP_SHIFT) + (1 << i);
+				String token = CompilerOptions.warningTokenFromIrritant(irritant);
+				if (token != null) {
+					matcher.put(token, token);
+					assertTrue(CompilerOptions.warningTokenToIrritants(token) != null);
 				}
 			}
 		}
+		// Add one for "preview", which doesn't have any irritant at the moment
+		matcher.put("preview", "preview");
+		String[] allTokens = CompilerOptions.warningTokens;
+		int length = allTokens.length;
+		matcher.put("all", "all"); // all gets undetected in the From/To loop
+		assertEquals(allTokens.length, matcher.size());
+		for (int i = 0; i < length; i++) {
+			Object object = matcher.get(allTokens[i]);
+			assertNotNull(object);
+		}
 	}
-	catch (IllegalAccessException e) {
-		fail("could not access members");
+
+// problem categories - check that none is left unspecified
+// see also discussion in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208383
+	public void test002_problem_categories() {
+		try {
+			Class iProblemClass;
+			Field[] fields = (iProblemClass = IProblem.class).getFields();
+			for (int i = 0, length = fields.length; i < length; i++) {
+				Field field = fields[i];
+				if (field.getType() == Integer.TYPE) {
+					int problemId = field.getInt(iProblemClass),
+							maskedProblemId = problemId & IProblem.IgnoreCategoriesMask;
+					if (maskedProblemId != 0 && maskedProblemId != IProblem.IgnoreCategoriesMask
+							&& ProblemReporter.getProblemCategory(ProblemSeverities.Error,
+									problemId) == CategorizedProblem.CAT_UNSPECIFIED) {
+						fail("unspecified category for problem " + field.getName());
+					}
+				}
+			}
+		} catch (IllegalAccessException e) {
+			fail("could not access members");
+		}
 	}
-}
-class TasksReader implements ICompilerRequestor {
-	CompilationResult result;
-	public void acceptResult(CompilationResult compilationResult) {
-		this.result = compilationResult;
+
+	class TasksReader implements ICompilerRequestor {
+		CompilationResult result;
+
+		public void acceptResult(CompilationResult compilationResult) {
+			this.result = compilationResult;
+		}
 	}
-}
-static String taskTagsAsCutAndPaste(CategorizedProblem tasks[]) {
-	StringBuffer result = new StringBuffer();
-	String arguments[];
-	for (int i = 0; i < tasks.length - 1; i++) {
-		arguments = tasks[i].getArguments();
+
+	static String taskTagsAsCutAndPaste(CategorizedProblem tasks[]) {
+		StringBuffer result = new StringBuffer();
+		String arguments[];
+		for (int i = 0; i < tasks.length - 1; i++) {
+			arguments = tasks[i].getArguments();
+			System.out.print("\t\t\"[");
+			System.out.print(arguments[0]);
+			System.out.print(',');
+			System.out.print(arguments[1]);
+			System.out.print(',');
+			System.out.print(arguments[2]);
+			System.out.println("]\\n\" +");
+		}
+		arguments = tasks[tasks.length - 1].getArguments();
 		System.out.print("\t\t\"[");
 		System.out.print(arguments[0]);
 		System.out.print(',');
 		System.out.print(arguments[1]);
 		System.out.print(',');
 		System.out.print(arguments[2]);
-		System.out.println("]\\n\" +");
+		System.out.println("]\\n\"");
+		return result.toString();
 	}
-	arguments = tasks[tasks.length - 1].getArguments();
-	System.out.print("\t\t\"[");
-	System.out.print(arguments[0]);
-	System.out.print(',');
-	System.out.print(arguments[1]);
-	System.out.print(',');
-	System.out.print(arguments[2]);
-	System.out.println("]\\n\"");
-	return result.toString();
-}
-static String taskTagsAsStrings(CategorizedProblem tasks[]) {
-	StringBuffer result = new StringBuffer();
-	String arguments[];
-	for (int i = 0; i < tasks.length; i++) {
-		arguments = tasks[i].getArguments();
-		result.append('[');
-		result.append(arguments[0]);
-		result.append(',');
-		result.append(arguments[1]);
-		result.append(',');
-		result.append(arguments[2]);
-		result.append(']');
-		result.append("\n");
+
+	static String taskTagsAsStrings(CategorizedProblem tasks[]) {
+		StringBuffer result = new StringBuffer();
+		String arguments[];
+		for (int i = 0; i < tasks.length; i++) {
+			arguments = tasks[i].getArguments();
+			result.append('[');
+			result.append(arguments[0]);
+			result.append(',');
+			result.append(arguments[1]);
+			result.append(',');
+			result.append(arguments[2]);
+			result.append(']');
+			result.append("\n");
+		}
+		return result.toString();
 	}
-	return result.toString();
-}
-public void runTaskTagsOptionsTest(
-		String[] testFiles,
-		Map customOptions,
-		String expectedTags) {
-	TasksReader reader = new TasksReader();
-	Map options = JavaCore.getDefaultOptions();
-	if (customOptions != null) {
-		options.putAll(customOptions);
+
+	public void runTaskTagsOptionsTest(String[] testFiles, Map customOptions, String expectedTags) {
+		TasksReader reader = new TasksReader();
+		Map options = JavaCore.getDefaultOptions();
+		if (customOptions != null) {
+			options.putAll(customOptions);
+		}
+		this.runConformTest(testFiles, "", null /* no extra class libraries */, true /* flush output directory */,
+				null, /* no VM args */
+				options, reader, true /* skip javac */);
+		String tags = taskTagsAsStrings(reader.result.tasks);
+		if (!tags.equals(expectedTags)) {
+			System.out.println(getClass().getName() + '#' + getName());
+			System.out.println("Effective results:");
+			System.out.println(tags);
+			System.out.println("Cut and paste:");
+			taskTagsAsCutAndPaste(reader.result.tasks);
+			assertEquals(expectedTags, tags);
+		}
 	}
-	this.runConformTest(
-		testFiles,
-		"",
-		null /* no extra class libraries */,
-		true /* flush output directory */,
-		null, /* no VM args */
-		options,
-		reader,
-		true /* skip javac */);
-	String tags = taskTagsAsStrings(reader.result.tasks);
-	if (! tags.equals(expectedTags)) {
-		System.out.println(getClass().getName() + '#' + getName());
-		System.out.println("Effective results:");
-		System.out.println(tags);
-		System.out.println("Cut and paste:");
-		taskTagsAsCutAndPaste(reader.result.tasks);
-		assertEquals(expectedTags, tags);
-	}
-}
+
 // Basic test on task tags: watch default behavior
-public void test003_task_tags_options() {
-	runTaskTagsOptionsTest(
-		new String[] {
-			"X.java",
-			"public class X {\n" +
-			"  void foo(X x) {\n" +
-			"    // FIXME TODO XXX message contents\n" +
-			"  }\n" +
-			"}\n"},
-		null,
-		"[FIXME, message contents,HIGH]\n" +
-		"[TODO, message contents,NORMAL]\n" +
-		"[XXX, message contents,NORMAL]\n");
-}
+	public void test003_task_tags_options() {
+		runTaskTagsOptionsTest(
+				new String[] { "X.java",
+						"public class X {\n" + "  void foo(X x) {\n" + "    // FIXME TODO XXX message contents\n"
+								+ "  }\n" + "}\n" },
+				null, "[FIXME, message contents,HIGH]\n" + "[TODO, message contents,NORMAL]\n"
+						+ "[XXX, message contents,NORMAL]\n");
+	}
+
 // effect of cancelling priorities
 // reactivate when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=143402 is fixed
-public void _test004_task_tags_options() {
-	Map customOptions = new HashMap();
-	customOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, "");
-	runTaskTagsOptionsTest(
-		new String[] {
-			"X.java",
-			"public class X {\n" +
-			"  void foo(X x) {\n" +
-			"    // FIXME TODO XXX message contents\n" +
-			"  }\n" +
-			"}\n"},
-		customOptions,
-		"[FIXME, message contents,NORMAL]\n" +
-		"[TODO, message contents,NORMAL]\n" +
-		"[XXX, message contents,NORMAL]\n");
-}
+	public void _test004_task_tags_options() {
+		Map customOptions = new HashMap();
+		customOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, "");
+		runTaskTagsOptionsTest(
+				new String[] { "X.java",
+						"public class X {\n" + "  void foo(X x) {\n" + "    // FIXME TODO XXX message contents\n"
+								+ "  }\n" + "}\n" },
+				customOptions, "[FIXME, message contents,NORMAL]\n" + "[TODO, message contents,NORMAL]\n"
+						+ "[XXX, message contents,NORMAL]\n");
+	}
+
 // effect of cancelling priorities
 // reactivate when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=143402 is fixed
-public void _test005_task_tags_options() {
-	Map customOptions = new HashMap();
-	customOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, ",,");
-	runTaskTagsOptionsTest(
-		new String[] {
-			"X.java",
-			"public class X {\n" +
-			"  void foo(X x) {\n" +
-			"    // FIXME TODO XXX message contents\n" +
-			"  }\n" +
-			"}\n"},
-		customOptions,
-		"[FIXME,message contents,NORMAL]\n" +
-		"[TODO,message contents,NORMAL]\n" +
-		"[XXX,message contents,NORMAL]\n");
-	// would expect an exception of some sort
-}
+	public void _test005_task_tags_options() {
+		Map customOptions = new HashMap();
+		customOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, ",,");
+		runTaskTagsOptionsTest(
+				new String[] { "X.java",
+						"public class X {\n" + "  void foo(X x) {\n" + "    // FIXME TODO XXX message contents\n"
+								+ "  }\n" + "}\n" },
+				customOptions, "[FIXME,message contents,NORMAL]\n" + "[TODO,message contents,NORMAL]\n"
+						+ "[XXX,message contents,NORMAL]\n");
+		// would expect an exception of some sort
+	}
+
 // effect of changing priorities
 // reactivate when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=143402 is fixed
-public void _test006_task_tags_options() {
-	Map customOptions = new HashMap();
-	customOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, "A,B,C,D,E");
-	runTaskTagsOptionsTest(
-		new String[] {
-			"X.java",
-			"public class X {\n" +
-			"  void foo(X x) {\n" +
-			"    // FIXME TODO XXX message contents\n" +
-			"  }\n" +
-			"}\n"},
-		customOptions,
-		"[FIXME,message contents,NORMAL]\n" +
-		"[TODO,message contents,NORMAL]\n" +
-		"[XXX,message contents,NORMAL]\n");
-	// would expect an exception of some sort
-}
+	public void _test006_task_tags_options() {
+		Map customOptions = new HashMap();
+		customOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, "A,B,C,D,E");
+		runTaskTagsOptionsTest(
+				new String[] { "X.java",
+						"public class X {\n" + "  void foo(X x) {\n" + "    // FIXME TODO XXX message contents\n"
+								+ "  }\n" + "}\n" },
+				customOptions, "[FIXME,message contents,NORMAL]\n" + "[TODO,message contents,NORMAL]\n"
+						+ "[XXX,message contents,NORMAL]\n");
+		// would expect an exception of some sort
+	}
+
 // effect of changing priorities
-public void test007_task_tags_options() {
-	Map customOptions = new HashMap();
-	customOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, "NORMAL,NORMAL,NORMAL");
-	runTaskTagsOptionsTest(
-		new String[] {
-			"X.java",
-			"public class X {\n" +
-			"  void foo(X x) {\n" +
-			"    // FIXME TODO XXX message contents\n" +
-			"  }\n" +
-			"}\n"},
-		customOptions,
-		"[FIXME, message contents,NORMAL]\n" +
-		"[TODO, message contents,NORMAL]\n" +
-		"[XXX, message contents,NORMAL]\n");
-}
+	public void test007_task_tags_options() {
+		Map customOptions = new HashMap();
+		customOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, "NORMAL,NORMAL,NORMAL");
+		runTaskTagsOptionsTest(
+				new String[] { "X.java",
+						"public class X {\n" + "  void foo(X x) {\n" + "    // FIXME TODO XXX message contents\n"
+								+ "  }\n" + "}\n" },
+				customOptions, "[FIXME, message contents,NORMAL]\n" + "[TODO, message contents,NORMAL]\n"
+						+ "[XXX, message contents,NORMAL]\n");
+	}
+
 // effect of changing priorities
 // reactivate when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=143402 is fixed
-public void _test008_task_tags_options() {
-	Map customOptions = new HashMap();
-	customOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, "NORMAL,NORMAL"); // one less than the number of tags
-	runTaskTagsOptionsTest(
-		new String[] {
-			"X.java",
-			"public class X {\n" +
-			"  void foo(X x) {\n" +
-			"    // FIXME TODO XXX message contents\n" +
-			"  }\n" +
-			"}\n"},
-		customOptions,
-		"[FIXME,message contents,NORMAL]\n" +
-		"[TODO,message contents,NORMAL]\n" +
-		"[XXX,message contents,NORMAL]\n");
-}
+	public void _test008_task_tags_options() {
+		Map customOptions = new HashMap();
+		customOptions.put(JavaCore.COMPILER_TASK_PRIORITIES, "NORMAL,NORMAL"); // one less than the number of tags
+		runTaskTagsOptionsTest(
+				new String[] { "X.java",
+						"public class X {\n" + "  void foo(X x) {\n" + "    // FIXME TODO XXX message contents\n"
+								+ "  }\n" + "}\n" },
+				customOptions, "[FIXME,message contents,NORMAL]\n" + "[TODO,message contents,NORMAL]\n"
+						+ "[XXX,message contents,NORMAL]\n");
+	}
+
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=206423
 // that bug showed that we had no coverage in the area of missing message
 // templates, which can occur downstream in the localization process (assuming
 // that we always release the English version right)
-public void test009_missing_message_templates() {
-	assertEquals("Unable to retrieve the error message for problem id: 8388607. Check compiler resources.",
-			new DefaultProblemFactory().getLocalizedMessage(Integer.MAX_VALUE, new String[]{}));
-}
+	public void test009_missing_message_templates() {
+		assertEquals("Unable to retrieve the error message for problem id: 4194303. Check compiler resources.",
+				new DefaultProblemFactory().getLocalizedMessage(Integer.MAX_VALUE, new String[] {}));
+	}
+
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=206423
-public void test010_missing_elaboration_templates() {
-	assertEquals("Unable to retrieve the error message elaboration for elaboration id: 1073741823. Check compiler resources.",
-			new DefaultProblemFactory().getLocalizedMessage(0, Integer.MAX_VALUE / 2, new String[]{"Zork"}));
-}
+	public void test010_missing_elaboration_templates() {
+		assertEquals(
+				"Unable to retrieve the error message elaboration for elaboration id: 1073741823. Check compiler resources.",
+				new DefaultProblemFactory().getLocalizedMessage(0, Integer.MAX_VALUE / 2, new String[] { "Zork" }));
+	}
+
 // problem categories - check that categories match expected ones
 // see also discussion in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208383
 //{ObjectTeams: disabled (see https://svn.objectteams.org/trac/ot/ticket/124).
@@ -1192,6 +1162,23 @@
 		expectedProblemAttributes.put("IllegalArrayOfUnionType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
 		expectedProblemAttributes.put("IllegalArrayTypeInIntersectionCast", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
 		expectedProblemAttributes.put("ProblemNotAnalysed", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE));
+		expectedProblemAttributes.put("SwitchExpressionsIncompatibleResultExpressionTypes",	new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+		expectedProblemAttributes.put("SwitchExpressionsEmptySwitchBlock", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+		expectedProblemAttributes.put("SwitchExpressionsNoResultExpression", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+		expectedProblemAttributes.put("SwitchExpressionSwitchLabeledBlockCompletesNormally", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+		expectedProblemAttributes.put("SwitchExpressionLastStatementCompletesNormally", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+		expectedProblemAttributes.put("SwitchExpressionTrailingSwitchLabels", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+		expectedProblemAttributes.put("switchMixedCase", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
+		expectedProblemAttributes.put("SwitchExpressionMissingDefaultCase", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+	    expectedProblemAttributes.put("SwitchExpressionNotBelow12", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
+	    expectedProblemAttributes.put("SwitchCaseLabelWithArrowNotBelow12", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
+	    expectedProblemAttributes.put("SwitchExpressionPreviewDisabled", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
+	    expectedProblemAttributes.put("SwitchCaseLabelWithArrowPreviewDisabled", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
+	    expectedProblemAttributes.put("SwitchExpressionBreakMissingValue", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+	    expectedProblemAttributes.put("SwitchExpressionMissingEnumConstantCase", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+	    expectedProblemAttributes.put("PreviewFeatureDisabled", new ProblemAttributes(CategorizedProblem.CAT_COMPLIANCE));
+	    expectedProblemAttributes.put("PreviewFeatureUsed", new ProblemAttributes(CategorizedProblem.CAT_COMPLIANCE));
+	    expectedProblemAttributes.put("PreviewFeatureNotSupported", new ProblemAttributes(CategorizedProblem.CAT_COMPLIANCE));
 //{ObjectTeams: new problems (incomplete list):
         //expectedProblemAttributes.put("", new ProblemAttributes(CategorizedProblem.CAT_UNSPECIFIED));
         expectedProblemAttributes.put("OTJ_RELATED", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
@@ -1285,71 +1272,79 @@
 				Field field1 = (Field) o1;
 				Field field2 = (Field) o2;
 				return field1.getName().compareTo(field2.getName());
-			}
-		});
-		boolean watchInternalCategory = false, printHeader = true;
-		for (int i = 0, length = fields.length; i < length; i++) {
-			Field field = fields[i];
-			if (field.getType() == Integer.TYPE) {
-				int problemId = field.getInt(iProblemClass);
-				int maskedProblemId = problemId & IProblem.IgnoreCategoriesMask;
-				if (maskedProblemId != 0 && maskedProblemId != IProblem.IgnoreCategoriesMask) {
-					String name = field.getName();
-					ProblemAttributes expectedAttributes = (ProblemAttributes) expectedProblemAttributes.get(name);
-					if (expectedAttributes == null) {
-						failures.append("missing expected problem attributes for problem " + name + "\n");
-						int actualCategory = ProblemReporter.getProblemCategory(ProblemSeverities.Error, problemId);
-						correctResult.append("\t\texpectedProblemAttributes.put(\"" + name + "\", new ProblemAttributes(CategorizedProblem." + categoryName(actualCategory) + "));\n");
-					} else if (!expectedAttributes.deprecated) {
-						int actualCategory = ProblemReporter.getProblemCategory(ProblemSeverities.Error, problemId);
-						correctResult.append("\t\texpectedProblemAttributes.put(\"" + name + "\", new ProblemAttributes(CategorizedProblem." + categoryName(actualCategory) + "));\n");
-						if (expectedAttributes.category != actualCategory) {
-							failures.append("category mismatch for problem " + name + " (expected " + categoryName(expectedAttributes.category) + ", got " + categoryName(actualCategory) + ")\n");
-						}
-						if (watchInternalCategory && actualCategory == CategorizedProblem.CAT_INTERNAL) {
-							if (printHeader) {
-								printHeader = false;
-								System.err.println("CAT_INTERNAL for problems:");
+				}
+			});
+			boolean watchInternalCategory = false, printHeader = true;
+			for (int i = 0, length = fields.length; i < length; i++) {
+				Field field = fields[i];
+				if (field.getType() == Integer.TYPE) {
+					int problemId = field.getInt(iProblemClass);
+					int maskedProblemId = problemId & IProblem.IgnoreCategoriesMask;
+					if (maskedProblemId != 0 && maskedProblemId != IProblem.IgnoreCategoriesMask) {
+						String name = field.getName();
+						ProblemAttributes expectedAttributes = (ProblemAttributes) expectedProblemAttributes.get(name);
+						if (expectedAttributes == null) {
+							failures.append("missing expected problem attributes for problem " + name + "\n");
+							int actualCategory = ProblemReporter.getProblemCategory(ProblemSeverities.Error, problemId);
+							correctResult.append("\t\texpectedProblemAttributes.put(\"" + name
+									+ "\", new ProblemAttributes(CategorizedProblem." + categoryName(actualCategory)
+									+ "));\n");
+						} else if (!expectedAttributes.deprecated) {
+							int actualCategory = ProblemReporter.getProblemCategory(ProblemSeverities.Error, problemId);
+							correctResult.append("\t\texpectedProblemAttributes.put(\"" + name
+									+ "\", new ProblemAttributes(CategorizedProblem." + categoryName(actualCategory)
+									+ "));\n");
+							if (expectedAttributes.category != actualCategory) {
+								failures.append("category mismatch for problem " + name + " (expected "
+										+ categoryName(expectedAttributes.category) + ", got "
+										+ categoryName(actualCategory) + ")\n");
 							}
-							System.err.println("\t" + name);
+							if (watchInternalCategory && actualCategory == CategorizedProblem.CAT_INTERNAL) {
+								if (printHeader) {
+									printHeader = false;
+									System.err.println("CAT_INTERNAL for problems:");
+								}
+								System.err.println("\t" + name);
+							}
+						} else {
+							correctResult.append("\t\texpectedProblemAttributes.put(\"" + name + "\", DEPRECATED);\n");
 						}
-					} else {
-						correctResult.append("\t\texpectedProblemAttributes.put(\"" + name + "\", DEPRECATED);\n");
+					}
+				}
+			}
+			if (failures.length() > 0) {
+				System.out.println(correctResult);
+				System.out.println();
+			}
+			assertEquals(failures.toString(), 0, failures.length());
+		} catch (IllegalAccessException e) {
+			fail("could not access members");
+		}
+	}
+
+	private static Map categoryNames;
+
+	private String categoryName(int category) {
+		if (categoryNames == null) {
+			categoryNames = new HashMap();
+			Field[] fields = CategorizedProblem.class.getFields();
+			for (int i = 0, length = fields.length; i < length; i++) {
+				Field field = fields[i];
+				if (field.getType() == Integer.TYPE) {
+					String name = field.getName();
+					if (name.startsWith("CAT_")) {
+						try {
+							categoryNames.put(Integer.valueOf(field.getInt(CategorizedProblem.class)), name);
+						} catch (IllegalArgumentException e) {
+						} catch (IllegalAccessException e) {
+						}
 					}
 				}
 			}
 		}
-		if (failures.length() > 0) {
-			System.out.println(correctResult);
-			System.out.println();
-		}
-		assertEquals(failures.toString(), 0, failures.length());
+		return (String) categoryNames.get(Integer.valueOf(category));
 	}
-	catch (IllegalAccessException e) {
-		fail("could not access members");
-	}
-}
-private static Map categoryNames;
-private String categoryName(int category) {
-	if (categoryNames == null) {
-		categoryNames = new HashMap();
-		Field[] fields = CategorizedProblem.class.getFields();
-		for (int i = 0, length = fields.length; i < length; i++) {
-			Field field = fields[i];
-			if (field.getType() == Integer.TYPE) {
-				String name = field.getName();
-				if (name.startsWith("CAT_")) {
-					try {
-						categoryNames.put(Integer.valueOf(field.getInt(CategorizedProblem.class)), name);
-					} catch (IllegalArgumentException e) {
-					} catch (IllegalAccessException e) {
-					}
-				}
-			}
-		}
-	}
-	return (String) categoryNames.get(Integer.valueOf(category));
-}
+
 // compiler problems tuning
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=218603
 public void test012_compiler_problems_tuning() {
@@ -2817,6 +2812,23 @@
 		expectedProblemAttributes.put("VarLocalReferencesItself", SKIP);
 		expectedProblemAttributes.put("VarLocalTooManyBrackets", SKIP);
 		expectedProblemAttributes.put("VarLocalWithoutInitizalier", SKIP);
+		expectedProblemAttributes.put("SwitchExpressionsIncompatibleResultExpressionTypes",SKIP);
+		expectedProblemAttributes.put("SwitchExpressionsEmptySwitchBlock",SKIP);
+		expectedProblemAttributes.put("SwitchExpressionsNoResultExpression",SKIP);
+		expectedProblemAttributes.put("SwitchExpressionSwitchLabeledBlockCompletesNormally",SKIP);
+		expectedProblemAttributes.put("SwitchExpressionLastStatementCompletesNormally",SKIP);
+		expectedProblemAttributes.put("SwitchExpressionTrailingSwitchLabels",SKIP);
+		expectedProblemAttributes.put("switchMixedCase", SKIP);
+		expectedProblemAttributes.put("SwitchExpressionMissingDefaultCase",SKIP);
+	    expectedProblemAttributes.put("SwitchExpressionNotBelow12", SKIP);
+	    expectedProblemAttributes.put("SwitchCaseLabelWithArrowNotBelow12", SKIP);
+	    expectedProblemAttributes.put("SwitchExpressionPreviewDisabled", SKIP);
+	    expectedProblemAttributes.put("SwitchCaseLabelWithArrowPreviewDisabled", SKIP);
+	    expectedProblemAttributes.put("SwitchExpressionBreakMissingValue", SKIP);
+	    expectedProblemAttributes.put("SwitchExpressionMissingEnumConstantCase", SKIP);
+	    expectedProblemAttributes.put("PreviewFeatureDisabled", SKIP);
+	    expectedProblemAttributes.put("PreviewFeatureUsed", SKIP);
+	    expectedProblemAttributes.put("PreviewFeatureNotSupported", SKIP);
 		Map constantNamesIndex = new HashMap();
 		Field[] fields = JavaCore.class.getFields();
 		for (int i = 0, length = fields.length; i < length; i++) {
@@ -2824,46 +2836,47 @@
 			String fieldName;
 			if (field.getType() == String.class && (fieldName = field.getName()).startsWith("COMPILER_PB_")) {
 				constantNamesIndex.put(field.get(null), fieldName);
-			}
-		}
-		fields = IProblem.class.getFields();
-		StringBuffer failures = new StringBuffer();
-		StringBuffer correctResult = new StringBuffer(70000);
-		Arrays.sort(fields, new Comparator() {
-			public int compare(Object o1, Object o2) {
-				Field field1 = (Field) o1;
-				Field field2 = (Field) o2;
-				return field1.getName().compareTo(field2.getName());
-			}
-		});
-		for (int i = 0, length = fields.length; i < length; i++) {
-			Field field = fields[i];
-			if (field.getType() == Integer.TYPE) {
-				int problemId = field.getInt(null), maskedProblemId = problemId & IProblem.IgnoreCategoriesMask;
-				if (maskedProblemId != 0 && maskedProblemId != IProblem.IgnoreCategoriesMask) {
-					String name = field.getName();
-					ProblemAttributes expectedAttributes = (ProblemAttributes) expectedProblemAttributes.get(name);
-					String actualTuningOption = JavaCore.getOptionForConfigurableSeverity(problemId);
-					if (expectedAttributes == null) {
-						failures.append("missing expected problem attributes for problem " + name + "\n");
-					} else if (!expectedAttributes.skip && !expectedAttributes.option.equals(actualTuningOption)) {
-						failures.append("tuning option mismatch for problem " + name + " (expected " + expectedAttributes.option + ", got " + actualTuningOption + ")\n");
-					}
-					String optionFieldName = (String) constantNamesIndex.get(actualTuningOption);
-					correctResult.append("\t\texpectedProblemAttributes.put(\"" + name + "\", " +
-						(optionFieldName != null ? "new ProblemAttributes(JavaCore." + optionFieldName + ")" :
-							"SKIP") + ");\n");
 				}
 			}
+			fields = IProblem.class.getFields();
+			StringBuffer failures = new StringBuffer();
+			StringBuffer correctResult = new StringBuffer(70000);
+			Arrays.sort(fields, new Comparator() {
+				public int compare(Object o1, Object o2) {
+					Field field1 = (Field) o1;
+					Field field2 = (Field) o2;
+					return field1.getName().compareTo(field2.getName());
+				}
+			});
+			for (int i = 0, length = fields.length; i < length; i++) {
+				Field field = fields[i];
+				if (field.getType() == Integer.TYPE) {
+					int problemId = field.getInt(null), maskedProblemId = problemId & IProblem.IgnoreCategoriesMask;
+					if (maskedProblemId != 0 && maskedProblemId != IProblem.IgnoreCategoriesMask) {
+						String name = field.getName();
+						ProblemAttributes expectedAttributes = (ProblemAttributes) expectedProblemAttributes.get(name);
+						String actualTuningOption = JavaCore.getOptionForConfigurableSeverity(problemId);
+						if (expectedAttributes == null) {
+							failures.append("missing expected problem attributes for problem " + name + "\n");
+						} else if (!expectedAttributes.skip && !expectedAttributes.option.equals(actualTuningOption)) {
+							failures.append("tuning option mismatch for problem " + name + " (expected "
+									+ expectedAttributes.option + ", got " + actualTuningOption + ")\n");
+						}
+						String optionFieldName = (String) constantNamesIndex.get(actualTuningOption);
+						correctResult.append("\t\texpectedProblemAttributes.put(\"" + name + "\", "
+								+ (optionFieldName != null ? "new ProblemAttributes(JavaCore." + optionFieldName + ")"
+										: "SKIP")
+								+ ");\n");
+					}
+				}
+			}
+			if (failures.length() > 0) {
+				System.out.println(correctResult);
+				System.out.println();
+			}
+			assertEquals(failures.toString(), 0, failures.length());
+		} catch (IllegalAccessException e) {
+			fail("could not access members");
 		}
-		if (failures.length() > 0) {
-			System.out.println(correctResult);
-			System.out.println();
-		}
-		assertEquals(failures.toString(), 0, failures.length());
 	}
-	catch (IllegalAccessException e) {
-		fail("could not access members");
-	}
-}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java
index 5602566..b0514b8 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2018 IBM Corporation and others.
+ * Copyright (c) 2005, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -2904,6 +2904,1944 @@
 		"The local variable action may not have been initialized\n" + 
 		"----------\n");
 }
+public void testBug542707_001() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12); 
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 11)\n" + 
+			"	break k;\n" + 
+			"	      ^\n" + 
+			"The local variable k may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 14)\n" + 
+			"	return k + it;\n" + 
+			"	       ^\n" + 
+			"The local variable k may not have been initialized\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		final int k;\n" +
+			"\n" +
+			"		int it = switch (i) { \n" +
+			"		case 1  ->   {\n" +
+			"			k = 1;\n" +
+			"			break k ;\n" +
+			"		}\n" +
+			"		default -> {\n" +
+			"			break k;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return k + it;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+		};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+
+}
+public void testBug542707_002() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12); 
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 5)\n" + 
+			"	k = switch (i) { \n" + 
+			"	^\n" + 
+			"The final local variable k may already have been assigned\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 11)\n" + 
+			"	break k;\n" + 
+			"	      ^\n" + 
+			"The local variable k may not have been initialized\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		final int k;\n" +
+			"\n" +
+			"		k = switch (i) { \n" +
+			"		case 1  ->   {\n" +
+			"			k = 1;\n" +
+			"			break k ;\n" +
+			"		}\n" +
+			"		default -> {\n" +
+			"			break k;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return k;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+		};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/*
+ * k is definitely assigned - no errors on that front.
+ */
+public void testBug542707_003() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12); 
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 23)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		final int k;\n" +
+			"\n" +
+			"		int it = switch (i) { \n" +
+			"		case 1  ->   {\n" +
+			"			k = 1;\n" +
+			"			break k ;\n" +
+			"		}\n" +
+			"		case 2  ->   {\n" +
+			"			k = 2;\n" +
+			"			break k ;\n" +
+			"		}\n" +
+			"		default -> {\n" +
+			"			k = 3;\n" +
+			"			break k;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return k;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+public void testBug542707_004() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12); 
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 7)\n" + 
+			"	k = 1;\n" + 
+			"	^\n" + 
+			"The final local variable k cannot be assigned. It must be blank and not using a compound assignment\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 11)\n" + 
+			"	k = 2;\n" + 
+			"	^\n" + 
+			"The final local variable k cannot be assigned. It must be blank and not using a compound assignment\n" + 
+			"----------\n" + 
+			"3. ERROR in X.java (at line 15)\n" + 
+			"	k = 3;\n" + 
+			"	^\n" + 
+			"The final local variable k cannot be assigned. It must be blank and not using a compound assignment\n" + 
+			"----------\n" + 
+			"4. ERROR in X.java (at line 23)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		final int k = 1;\n" +
+			"\n" +
+			"		int it = switch (i) { \n" +
+			"		case 1  ->   {\n" +
+			"			k = 1;\n" +
+			"			break k ;\n" +
+			"		}\n" +
+			"		case 2  ->   {\n" +
+			"			k = 2;\n" +
+			"			break k ;\n" +
+			"		}\n" +
+			"		default -> {\n" +
+			"			k = 3;\n" +
+			"			break k;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return k;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+public void testBug542707_005() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12); 
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 11)\n" + 
+			"	break k ;\n" + 
+			"	      ^\n" + 
+			"The local variable k may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 18)\n" + 
+			"	return k;\n" + 
+			"	       ^\n" + 
+			"The local variable k may not have been initialized\n" + 
+			"----------\n" + 
+			"3. ERROR in X.java (at line 22)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		final int k;\n" +
+			"\n" +
+			"		int it = switch (i) { \n" +
+			"		case 1  ->   {\n" +
+			"			k = 1;\n" +
+			"			break k ;\n" +
+			"		}\n" +
+			"		case 2  ->   {\n" +
+			"			break k ;\n" +
+			"		}\n" +
+			"		default -> {\n" +
+			"			k = 3;\n" +
+			"			break k;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return k;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued. 
+ * V is definitely assigned after a switch expression when true iff for every value break statement with
+ * expression e in the switch block that may exit the switch expression, V is definitely assigned after e when true.
+ * V is definitely assigned after a switch expression when false iff for every value break statement with
+ * expression e in the switch block that may exit the switch expression, V is definitely assigned after e when false.
+ */
+public void testBug542707_006() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 22)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v;\n" +
+			"		boolean b = switch (i) {\n" +
+			"		case 1 :\n" +
+			"			v = 1;\n" +
+			"			break true;\n" +
+			"		case 2 : {\n" +
+			"			v = 2;\n" +
+			"			break true;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			v = 3;\n" +
+			"			break false;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued.
+ * V is definitely unassigned after a switch expression when true iff for every value break statement with expression
+ * e in the switch block that may exit the switch expression, V is definitely unassigned before the value break
+ * statement and V is definitely unassigned after e when true.
+ * V is definitely unassigned after a switch expression when false iff for every value break statement with expression
+ * e in the switch block that may exit the switch expression, V is definitely unassigned before the value break
+ * statement and V is definitely unassigned after e when false.
+ */
+public void testBug542707_007() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 18)\n" + 
+			"	return v + d;\n" + 
+			"	       ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 22)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v;\n" +
+			"		boolean b = switch (i) {\n" +
+			"		case 1 :\n" +
+			"			//v = 1;\n" +
+			"			break true;\n" +
+			"		case 2 : {\n" +
+			"			//v = 2;\n" +
+			"			break true;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			//v = 3;\n" +
+			"			break false;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued. 
+ * V is [un]assigned before the selector expression iff V is [un]assigned before the switch statement.
+ */
+public void testBug542707_008() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 22)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v = 1;\n" +
+			"		boolean b = switch (i) {\n" +
+			"		case 1 :\n" +
+			"			//v = 1;\n" +
+			"			break true;\n" +
+			"		case 2 : {\n" +
+			"			//v = 2;\n" +
+			"			break true;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			//v = 3;\n" +
+			"			break false;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued. 
+ * V is [un]assigned before the selector expression iff V is [un]assigned before the switch statement.
+ */
+public void testBug542707_009() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 4)\n" + 
+			"	boolean b = switch (v) {\n" + 
+			"	                    ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 22)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v;\n" +
+			"		boolean b = switch (v) {\n" +
+			"		case 1 :\n" +
+			"			v = 1;\n" +
+			"			break true;\n" +
+			"		case 2 : {\n" +
+			"			v = 2;\n" +
+			"			break true;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			v = 3;\n" +
+			"			break false;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued. 
+ * V is [un]assigned before the first statement of the first switch labeled statement group in the switch block
+ * iff V is [un]assigned after the selector expression.
+ */
+public void testBug542707_010() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 22)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v;\n" +
+			"		boolean b = switch (i + (v =1)) {\n" +
+			"		case 1 :\n" +
+			"			v += 1;\n" +
+			"			break true;\n" +
+			"		case 2 : {\n" +
+			"			v = 2;\n" +
+			"			break true;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			v = 3;\n" +
+			"			break false;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued. 
+ * V is [un]assigned before the first statement of the first switch labeled statement group in the switch block
+ * iff V is [un]assigned after the selector expression.
+ */
+public void testBug542707_011() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 6)\n" + 
+			"	v += 1;\n" + 
+			"	^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 22)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v;\n" +
+			"		boolean b = switch (i) {\n" +
+			"		case 1 :\n" +
+			"			v += 1;\n" +
+			"			break true;\n" +
+			"		case 2 : {\n" +
+			"			v = 2;\n" +
+			"			break true;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			v = 3;\n" +
+			"			break false;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued.
+ * V is [un]assigned before the first statement of any switch labeled statement group other than the first iff
+ * V is [un]assigned after the selector expression and V is [un]assigned after the preceding statement.
+ * TODO: the second part - "and V is [un]assigned after the preceding statement" needs to be checked, now it looks identical to the 
+ * preceding rule
+ */
+public void testBug542707_012() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 22)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v;\n" +
+			"		boolean b = switch (i + (v =1)) {\n" +
+			"		case 1 :\n" +
+			"			v = 1;\n" +
+			"			break true;\n" +
+			"		case 2 : {\n" +
+			"			v += 2;\n" +
+			"			break true;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			v = 3;\n" +
+			"			break false;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued. 
+ * V is [un]assigned before the first statement of any switch labeled statement group other than the first iff
+ * V is [un]assigned after the selector expression and V is [un]assigned after the preceding statement.
+ * TODO: the second part - "and V is [un]assigned after the preceding statement" needs to be checked, now it looks identical to the 
+ * preceding rule
+ */
+public void testBug542707_013() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 9)\n" + 
+			"	v += 2;\n" + 
+			"	^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 22)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v;\n" +
+			"		boolean b = switch (i) {\n" +
+			"		case 1 :\n" +
+			"			v = 1;\n" +
+			"			break true;\n" +
+			"		case 2 : {\n" +
+			"			v += 2;\n" +
+			"			break true;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			v = 3;\n" +
+			"			break false;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued. 
+ * The following rules apply only if the switch block of a switch expression consists of switch labeled rules:
+ * V is definitely assigned after a switch expression when true iff for every switch labeled rule one of the following is true:
+ * 		It is a switch labeled expression e and V is definitely assigned after e when true.
+ * 		It is a switch labeled block b and for every value break statement expression e contained in b that may exit the switch expression, 
+ * 			V is definitely assigned after e when true.
+ * 		It is a switch labeled throw statement.
+ * 
+ * V is definitely assigned after a switch expression when false iff for every switch labeled rule one of the following is true:
+ * 		It is a switch labeled expression e and V is definitely assigned after e when false.
+ * 		It is a switch labeled block b and for every value break statement expression e contained in b that may exit the switch expression,
+ * 		V is definitely assigned after e when false.
+ * 		It is a switch labeled throw statement.
+ */
+public void testBug542707_014() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 23)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"import java.io.IOException;\n" +
+			"public class X {\n" +
+			"	public static int foo(int i) throws IOException {\n" +
+			"		int v;\n" +
+			"		boolean b = switch (i ) {\n" +
+			"		case 0 -> (v = 1) != 0;\n" +
+			"		case 1 -> (v = 1) == 0;\n" +
+			"		case 2 -> {\n" +
+			"			v = 2;\n" +
+			"			break true;\n" +
+			"		}\n" +
+			"		case 3 -> {\n" +
+			"			v = 3;\n" +
+			"			break false;\n" +
+			"		}\n" +
+			"		default -> throw new IOException();\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		try {\n" +
+			"			System.out.println(foo(3));\n" +
+			"		} catch (IOException e) {\n" +
+			"			e.printStackTrace();\n" +
+			"		}\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued. 
+ * The following rules apply only if the switch block of a switch expression consists of switch labeled rules:
+ * V is definitely unassigned after a switch expression when true iff for every switch labeled rule one of the following is true:
+ * 		It is a switch labeled expression e and V is definitely unassigned after e when true .
+ * 		It is a switch labeled block b and for every value break statement expression e contained in b that
+ * 		 may exit the switch expression, V is definitely unassigned before the value break statement and 
+ * 		     V is definitely unassigned after e when true.
+ * 		It is a switch labeled throw statement.
+ * 
+ * V is definitely unassigned after a switch expression when false iff for every switch labeled rule one of the following is true:
+ * 		It is a switch labeled expression e and V is definitely unassigned after e when false.
+ * 		It is a switch labeled block b and for every value break statement expression e contained in b that may
+ * 		exit the switch expression,	V is definitely unassigned before the value break statement and V is definitely unassigned 
+ * 			after e when false.
+ * 		It is a switch labeled throw statement.
+ */
+public void testBug542707_015() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 17)\n" + 
+			"	return v + d;\n" + 
+			"	       ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 21)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"import java.io.IOException;\n" +
+			"public class X {\n" +
+			"	public static int foo(int i) throws IOException {\n" +
+			"		int v;\n" +
+			"		boolean b = switch (i ) {\n" +
+			"		case 0 ->  true;\n" +
+			"		case 1 -> false;\n" +
+			"		case 2 -> {\n" +
+			"			break true;\n" +
+			"		}\n" +
+			"		case 3 -> {\n" +
+			"			break false;\n" +
+			"		}\n" +
+			"		default -> throw new IOException();\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		try {\n" +
+			"			System.out.println(foo(3));\n" +
+			"		} catch (IOException e) {\n" +
+			"			e.printStackTrace();\n" +
+			"		}\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued. 
+ * V is [un]assigned before any switch labeled expression or statement in the switch
+ * block iff V is [un]assigned after the selector expression.
+ */
+public void testBug542707_016() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 14)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"import java.io.IOException;\n" +
+			"public class X {\n" +
+			"	public static int foo(int i) throws IOException {\n" +
+			"		int v;\n" +
+			"		boolean b = switch ((v = 1)) {\n" +
+			"		case 0 ->  v != 0;\n" +
+			"		default -> throw new IOException();\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		try {\n" +
+			"			System.out.println(foo(3));\n" +
+			"		} catch (IOException e) {\n" +
+			"			e.printStackTrace();\n" +
+			"		}\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.7 , Suppose that the switch expression has result expressions e1, …, en, all of
+ * which are boolean-valued. 
+ * The following rules apply only if the switch block of a switch expression consists of switch labeled rules:
+ * V is [un]assigned before any switch labeled expression or statement in the switch
+ * block iff V is [un]assigned after the selector expression.
+ */
+public void testBug542707_017() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 6)\n" + 
+			"	case 0 ->  v != 0;\n" + 
+			"	           ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 10)\n" + 
+			"	return v + d;\n" + 
+			"	       ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"3. ERROR in X.java (at line 14)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"import java.io.IOException;\n" +
+			"public class X {\n" +
+			"	public static int foo(int i) throws IOException {\n" +
+			"		int v;\n" +
+			"		boolean b = switch (i) {\n" +
+			"		case 0 ->  v != 0;\n" +
+			"		default -> throw new IOException();\n" +
+			"		};\n" +
+			"		int d = b == true ? 0 : 1; \n" +
+			"		return v + d;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		try {\n" +
+			"			System.out.println(foo(3));\n" +
+			"		} catch (IOException e) {\n" +
+			"			e.printStackTrace();\n" +
+			"		}\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
+ * which are boolean-valued.
+ * The following rules apply only if the switch block of a switch expression (15.28) consists of switch
+ * labeled statement groups:
+ * V is definitely assigned after a switch expression iff for every value break statement with expression e
+ *  in the switch block that may exit the switch expression, either V is definitely assigned before the value
+ *   break statement or V is definitely assigned after e.
+ */
+public void testBug542707_018() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 20)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v;\n" +
+			"		int t = switch (i) {\n" +
+			"		case 0 : {\n" +
+			"			v = 1; // definitely assigned before break\n" +
+			"			break v;\n" +
+			"		}\n" +
+			"		case 2 : {\n" +
+			"			break v =1; // definitely assigned after e\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			break v = 2;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return v + t;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
+ * which are boolean-valued.
+ * The following rules apply only if the switch block of a switch expression (15.28) consists of switch
+ * labeled statement groups:
+ * V is definitely unassigned after a switch expression iff for every value break statement with expression e
+ * in the switch block that may exit the switch expression, V is definitely unassigned before the value break
+ * statement and V is definitely unassigned after e.
+ */
+public void testBug542707_019() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 15)\n" + 
+			"	return v + t;\n" + 
+			"	       ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 19)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v;\n" +
+			"		int t = switch (i) {\n" +
+			"		case 0 : {\n" +
+			"			break 1;\n" +
+			"		}\n" +
+			"		case 2 : {\n" +
+			"			break 2;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			break 3;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return v + t;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
+ * which are boolean-valued.
+ * The following rules apply only if the switch block of a switch expression (15.28) consists of switch
+ * labeled statement groups:
+ * V is [un]assigned before the selector expression iff V is [un]assigned before the switch statement.
+ */
+public void testBug542707_020() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 19)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v =1;\n" +
+			"		int t = switch (v) {\n" +
+			"		case 0 : {\n" +
+			"			break 1;\n" +
+			"		}\n" +
+			"		case 2 : {\n" +
+			"			break 2;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			break 3;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return t;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
+ * which are boolean-valued.
+ * The following rules apply only if the switch block of a switch expression (15.28) consists of switch
+ * labeled statement groups:
+ * V is [un]assigned before the selector expression iff V is [un]assigned before the switch statement.
+ */
+public void testBug542707_021() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 4)\n" + 
+			"	int t = switch (v) {\n" + 
+			"	                ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 19)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v;\n" +
+			"		int t = switch (v) {\n" +
+			"		case 0 : {\n" +
+			"			break 1;\n" +
+			"		}\n" +
+			"		case 2 : {\n" +
+			"			break 2;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			break 3;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return t;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
+ * which are boolean-valued.
+ * The following rules apply only if the switch block of a switch expression (15.28) consists of switch
+ * labeled statement groups:
+ * V is [un]assigned before the first statement of the first switch labeled statement group in the switch block
+ * iff V is [un]assigned after the selector expression.
+ */
+public void testBug542707_022() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 19)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v =1;\n" +
+			"		int t = switch (v) {\n" +
+			"		case 0 : {\n" +
+			"			break v;\n" +
+			"		}\n" +
+			"		case 2 : {\n" +
+			"			break 2;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			break 3;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return t;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
+ * which are boolean-valued.
+ * The following rules apply only if the switch block of a switch expression (15.28) consists of switch
+ * labeled statement groups:
+ * V is [un]assigned before the first statement of the first switch labeled statement group in the switch block
+ * iff V is [un]assigned after the selector expression.
+ */
+public void testBug542707_023() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 6)\n" + 
+			"	break v;\n" + 
+			"	      ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 19)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v;\n" +
+			"		int t = switch (i) {\n" +
+			"		case 0 : {\n" +
+			"			break v;\n" +
+			"		}\n" +
+			"		case 2 : {\n" +
+			"			break 2;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			break 3;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return t;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
+ * which are boolean-valued.
+ * The following rules apply only if the switch block of a switch expression (15.28) consists of switch
+ * labeled statement groups:
+ * V is [un]assigned before the first statement of any switch labeled statement group other than the first iff V is [un]assigned
+ * after the selector expression and V is [un]assigned after the preceding statement.
+ */
+public void testBug542707_024() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 9)\n" + 
+			"	break v;\n" + 
+			"	      ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 19)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"public class X {\n" +
+			"	public static int foo(int i) {\n" +
+			"		int v ;\n" +
+			"		int t = switch (i) {\n" +
+			"		case 0 : {\n" +
+			"			break 1;\n" +
+			"		}\n" +
+			"		case 2 : {\n" +
+			"			break v;\n" +
+			"		}\n" +
+			"		default : {\n" +
+			"			break 3;\n" +
+			"		}\n" +
+			"		};\n" +
+			"		return t;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		System.out.println(foo(3));\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
+ * which are boolean-valued.
+ * The following rules apply only if the switch block of a switch expression consists of switch labeled rules:
+ * V is definitely assigned after a switch expression iff for every switch labeled rule one of the following is true:
+ * 		It is a switch labeled expression e and V is definitely assigned after e.
+ * 		It is a switch labeled block b and for every value break statement expression e contained in b that may exit
+ * 			the switch expression, either V is definitely assigned before the value break statement or V is definitely
+ * 			assigned after e.
+ * 		It is a switch labeled throw statement.
+ */
+public void testBug542707_025() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 20)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"import java.io.IOException;\n" +
+			"\n" +
+			"public class X {\n" +
+			"	public static int foo(int i) throws IOException {\n" +
+			"		int v ;\n" +
+			"		int t = switch (i) {\n" +
+			"		case 0 -> v = 1;\n" +
+			"		case 2 -> {\n" +
+			"			if (i > 1) {\n" +
+			"				break v = 2;\n" +
+			"			}\n" +
+			"			break v = 3;\n" +
+			"		}\n" +
+			"		default -> throw new IOException();\n" +
+			"		};\n" +
+			"		return v + t;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		try {\n" +
+			"			System.out.println(foo(3));\n" +
+			"		} catch (IOException e) {\n" +
+			"			// TODO Auto-generated catch block\n" +
+			"			e.printStackTrace();\n" +
+			"		}\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
+ * which are boolean-valued.
+ * The following rules apply only if the switch block of a switch expression consists of switch labeled rules:
+ * V is definitely unassigned after a switch expression iff for every switch labeled rule one of the following is true:
+ * 		It is a switch labeled expression e and V is definitely unassigned after e.
+ * 		It is a switch labeled block b and for every value break statement expression e contained in b that may exit the
+ * 			switch expression, V is definitely unassigned before the value break statement
+ * 			and V is definitely unassigned after e.
+ * 		It is a switch labeled throw statement.
+ */
+public void testBug542707_026() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 16)\n" + 
+			"	return v + t;\n" + 
+			"	       ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 20)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"import java.io.IOException;\n" +
+			"\n" +
+			"public class X {\n" +
+			"	public static int foo(int i) throws IOException {\n" +
+			"		int v ;\n" +
+			"		int t = switch (i) {\n" +
+			"		case 0 ->  1;\n" +
+			"		case 2 -> {\n" +
+			"			if (i > 1) {\n" +
+			"				break  2;\n" +
+			"			}\n" +
+			"			break 3;\n" +
+			"		}\n" +
+			"		default -> throw new IOException();\n" +
+			"		};\n" +
+			"		return v + t;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		try {\n" +
+			"			System.out.println(foo(3));\n" +
+			"		} catch (IOException e) {\n" +
+			"			// TODO Auto-generated catch block\n" +
+			"			e.printStackTrace();\n" +
+			"		}\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
+ * which are boolean-valued.
+ * The following rules apply only if the switch block of a switch expression consists of switch labeled rules:
+ * V is [un]assigned before any switch labeled expression or statement in the switch block iff
+ * V is [un]assigned after the selector expression.
+ */
+public void testBug542707_027() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 20)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"import java.io.IOException;\n" +
+			"\n" +
+			"public class X {\n" +
+			"	public static int foo(int i) throws IOException {\n" +
+			"		int v ;\n" +
+			"		int t = switch (v = 1) {\n" +
+			"		case 0 ->  v;\n" +
+			"		case 2 -> {\n" +
+			"			if (i > 1) {\n" +
+			"				break  2;\n" +
+			"			}\n" +
+			"			break 3;\n" +
+			"		}\n" +
+			"		default -> throw new IOException();\n" +
+			"		};\n" +
+			"		return v + t;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		try {\n" +
+			"			System.out.println(foo(3));\n" +
+			"		} catch (IOException e) {\n" +
+			"			// TODO Auto-generated catch block\n" +
+			"			e.printStackTrace();\n" +
+			"		}\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.1.8, Suppose that the switch expression has result expressions e1, …, en, not all of
+ * which are boolean-valued.
+ * The following rules apply only if the switch block of a switch expression consists of switch labeled rules:
+ * V is [un]assigned before any switch labeled expression or statement in the switch block iff
+ * V is [un]assigned after the selector expression.
+ */
+public void testBug542707_028() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 7)\n" + 
+			"	case 0 ->  v;\n" + 
+			"	           ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 20)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"import java.io.IOException;\n" +
+			"\n" +
+			"public class X {\n" +
+			"	public static int foo(int i) throws IOException {\n" +
+			"		int v ;\n" +
+			"		int t = switch (i) {\n" +
+			"		case 0 ->  v;\n" +
+			"		case 2 -> {\n" +
+			"			if (i > 1) {\n" +
+			"				break  2;\n" +
+			"			}\n" +
+			"			break 3;\n" +
+			"		}\n" +
+			"		default -> throw new IOException();\n" +
+			"		};\n" +
+			"		return t;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		try {\n" +
+			"			System.out.println(foo(3));\n" +
+			"		} catch (IOException e) {\n" +
+			"			// TODO Auto-generated catch block\n" +
+			"			e.printStackTrace();\n" +
+			"		}\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.2.9, The following rules apply only if the switch block of the switch statement consists of switch labeled rules:
+ * V is [un]assigned after a switch statement iff for every switch labeled rule one of the following is true:
+ * 		It is a switch labeled expression e and either V is [un]assigned after e or after the selector expression.
+ * 		It is a switch labeled block b and either V is [un]assigned after e or V is [un]assigned before every
+ * 		break statement contained in b that may exit the switch statement.
+ * 		It is a switch labeled throw statement.
+ */
+public void testBug542707_029() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"2. ERROR in X.java (at line 24)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"import java.io.IOException;\n" +
+			"\n" +
+			"public class X {\n" +
+			"	public static int foo(int i) throws IOException {\n" +
+			"		int v ;\n" +
+			"		switch (i) {\n" +
+			"		case 0 -> {\n" +
+			"			v = 0;\n" +
+			"		}\n" +
+			"		case 2 -> {\n" +
+			"			if (i > 1) {\n" +
+			"				v =  2;\n" +
+			"				break;\n" +
+			"			}\n" +
+			"			v = 3;\n" +
+			"			break;\n" +
+			"		}\n" +
+			"		default -> throw new IOException();\n" +
+			"		};\n" +
+			"		return v;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		try {\n" +
+			"			System.out.println(foo(3));\n" +
+			"		} catch (IOException e) {\n" +
+			"			// TODO Auto-generated catch block\n" +
+			"			e.printStackTrace();\n" +
+			"		}\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
+/**
+ * From JLS 12 16.2.9, The following rules apply only if the switch block of the switch statement consists of switch labeled rules:
+ * V is [un]assigned after a switch statement iff for every switch labeled rule one of the following is true:
+ * 		It is a switch labeled expression e and either V is [un]assigned after e or after the selector expression.
+ * 		It is a switch labeled block b and either V is [un]assigned after e or V is [un]assigned before every
+ * 		break statement contained in b that may exit the switch statement.
+ * 		It is a switch labeled throw statement.
+ */
+public void testBug542707_030() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map<String, String> defaultOptions = super.getCompilerOptions();
+	defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	String expectedProblemLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 20)\n" + 
+			"	return v;\n" + 
+			"	       ^\n" + 
+			"The local variable v may not have been initialized\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 24)\n" + 
+			"	Zork();\n" + 
+			"	^^^^\n" + 
+			"The method Zork() is undefined for the type X\n" + 
+			"----------\n";
+	String[] testFiles = new String[] {
+			"X.java", // =================
+			"import java.io.IOException;\n" +
+			"\n" +
+			"public class X {\n" +
+			"	public static int foo(int i) throws IOException {\n" +
+			"		int v ;\n" +
+			"		switch (i) {\n" +
+			"		case 0 -> {\n" +
+			"			v = 0;\n" +
+			"		}\n" +
+			"		case 2 -> {\n" +
+			"			if (i > 1) {\n" +
+			"				v =  2;\n" +
+			"				break;\n" +
+			"			}\n" +
+			"	//		v = 3;\n" +
+			"			break;\n" +
+			"		}\n" +
+			"		default -> throw new IOException();\n" +
+			"		};\n" +
+			"		return v;\n" +
+			"	}\n" +
+			"	\n" +
+			"	public boolean bar() {\n" +
+			"		Zork();\n" +
+			"		return true;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		try {\n" +
+			"			System.out.println(foo(3));\n" +
+			"		} catch (IOException e) {\n" +
+			"			// TODO Auto-generated catch block\n" +
+			"			e.printStackTrace();\n" +
+			"		}\n" +
+			"	}\n" +
+			"}\n",
+	};
+	this.runNegativeTest(
+			testFiles,
+			expectedProblemLog,
+			null,
+			true,
+			defaultOptions);
+}
 public static Class testClass() {
 	return FlowAnalysisTest.class;
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
index 472c28f..35397b6 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -15344,7 +15344,9 @@
 			"1. ERROR in X.java (at line 6)\n" +
 			"	Integer[] var = cond ? tab1 : tab2;\n" +
 			"	                ^^^^^^^^^^^^^^^^^^\n" +
-			"Type mismatch: cannot convert from Object&Serializable&Comparable<? extends Object&Serializable&Comparable<?>>[] to Integer[]\n" +
+			"Type mismatch: cannot convert from Object&Serializable&" +
+			"" + intersection("Comparable<? extends Object&Serializable&" + intersection("Comparable<?>") + ">") +
+			"[] to Integer[]\n" +
 			"----------\n": 
 				"----------\n" + 
 				"1. ERROR in X.java (at line 6)\n" + 
@@ -19822,7 +19824,7 @@
 	    			"1. ERROR in X.java (at line 10)\n" + 
 	    			"	String s = l1 != null ? foo(l1, l2) : l3;\n" + 
 		    		"	                        ^^^^^^^^^^^\n" +
-		    		"Type mismatch: cannot convert from List<capture#2-of ? extends Number & Comparable<?>> to String\n" +
+		    		"Type mismatch: cannot convert from List<capture#2-of ? extends Number & "+intersection("Comparable<?>")+"> to String\n" +
 	    			"----------\n");
 	}
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92556
@@ -25446,7 +25448,7 @@
 		"1. ERROR in X.java (at line 7)\n" +
 		"	if (isGreater(i, d)) \n" +
 		"	    ^^^^^^^^^\n" +
-		"Bound mismatch: The generic method isGreater(T, T) of type X is not applicable for the arguments (Integer, Double). The inferred type Number&Comparable<?> is not a valid substitute for the bounded parameter <T extends Comparable<T>>\n" +
+		"Bound mismatch: The generic method isGreater(T, T) of type X is not applicable for the arguments (Integer, Double). The inferred type "+ intersection("Number", "Comparable<?>") +" is not a valid substitute for the bounded parameter <T extends Comparable<T>>\n" +
 		"----------\n" +
 		"2. ERROR in X.java (at line 15)\n" +
 		"	isGreater(c1, c2);\n" +
@@ -26071,7 +26073,9 @@
 		"2. ERROR in X.java (at line 14)\n" +
 		"	String s2 = foo(integers, floats);\n" +
 		"	            ^^^^^^^^^^^^^^^^^^^^^\n" +
-		"Type mismatch: cannot convert from "+intersection("Number","Comparable<? extends "+intersection("Number","Comparable<?>")+">[]")+" to String\n" +
+		"Type mismatch: cannot convert from "+intersection("Number",
+				intersection("Comparable<? extends "+intersection("Number","Comparable<?>")+">")
+				)+"[] to String\n" +
 		"----------\n");
 }
 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107079
@@ -33571,12 +33575,12 @@
 		"4. WARNING in X.java (at line 14)\n" + 
 		"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + 
 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
-		"Type safety: A generic array of Iterator<? extends Number&Comparable<?>> is created for a varargs parameter\n" + 
+		"Type safety: A generic array of Iterator<? extends "+ intersection("Number", "Comparable<?>") +"> is created for a varargs parameter\n" + 
 		"----------\n" + 
 		"5. ERROR in X.java (at line 14)\n" + 
 		"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + 
 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
-		"Type mismatch: cannot convert from Iterator<Number&Comparable<?>> to Iterator<Number>\n" + 
+		"Type mismatch: cannot convert from Iterator<"+ intersection("Number", "Comparable<?>") +"> to Iterator<Number>\n" + 
 		"----------\n" + 
 		"6. WARNING in X.java (at line 18)\n" + 
 		"	Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" + 
@@ -33613,12 +33617,12 @@
 			"5. WARNING in X.java (at line 14)\n" + 
 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + 
 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
-			"Type safety: A generic array of Iterator<? extends Number&Comparable<?>> is created for a varargs parameter\n" + 
+			"Type safety: A generic array of Iterator<? extends Number&"+ intersection("Comparable<?>") +"> is created for a varargs parameter\n" + 
 			"----------\n" + 
 			"6. ERROR in X.java (at line 14)\n" + 
 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + 
 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
-			"Type mismatch: cannot convert from Iterator<Number&Comparable<?>> to Iterator<Number>\n" + 
+			"Type mismatch: cannot convert from Iterator<Number&"+ intersection("Comparable<?>") +"> to Iterator<Number>\n" + 
 			"----------\n" + 
 			"7. WARNING in X.java (at line 18)\n" + 
 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" + 
@@ -34753,7 +34757,7 @@
 			"1. ERROR in X.java (at line 10)\n" +
 			"	List<Number> name = makeNumberList(5, 5D);\n" +
 			"	                    ^^^^^^^^^^^^^^^^^^^^^\n" +
-			"Type mismatch: cannot convert from List<Number&Comparable<?>> to List<Number>\n" +
+			"Type mismatch: cannot convert from List<"+ intersection("Number", "Comparable<?>") +"> to List<Number>\n" +
 			"----------\n",
 			null,
 			true,
@@ -39665,7 +39669,7 @@
 			"1. ERROR in X.java (at line 4)\n" +
 			"	List<Object>  l1 = Arrays.asList(1, \"X\");\n" +
 			"	                   ^^^^^^^^^^^^^^^^^^^^^\n" +
-			"Type mismatch: cannot convert from List<Object&Comparable<?>&Serializable> to List<Object>\n" +
+			"Type mismatch: cannot convert from List<Object&"+ intersection("Comparable<?>") +"&Serializable> to List<Object>\n" +
 			"----------\n" +
 			"2. ERROR in X.java (at line 8)\n" +
 			"	List<Object>  l2 = Arrays.asList(b, c);\n" +
@@ -43209,7 +43213,7 @@
 		"1. WARNING in X.java (at line 4)\n" +
 		"	Arrays.asList(String.class, Integer.class);\n" +
 		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
-		"Type safety: A generic array of Class<? extends Object&Serializable&Comparable<?>> is created for a varargs parameter\n" +
+		"Type safety: A generic array of Class<? extends Object&Serializable&"+ intersection("Comparable<?>") +"> is created for a varargs parameter\n" +
 		"----------\n" +
 		"2. ERROR in X.java (at line 6)\n" +
 		"	Zork z;\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java
index d7c3fb2..4d1d261 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2018 Jesper Steen Møller and others.
+ * Copyright (c) 2018, 2019 Jesper Steen Møller and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -69,7 +69,11 @@
 	simpleTypeNames.put("ComparableAny", "Comparable<?>");
 	simpleTypeNames.put("CollectionExt_ComparableAny", "Collection<? extends Comparable<?>>");
 	simpleTypeNames.put("CollectionSuperComparableAny", "Collection<? super Comparable<?>>");
-	simpleTypeNames.put("IntLongFloat", "java.lang.Number & Comparable<?>");
+	isJRE12Plus = isJRELevel(F_12);
+	if (isJRE12Plus)
+		simpleTypeNames.put("IntLongFloat", "java.lang.Number & Comparable<?> & java.lang.constant.Constable & java.lang.constant.ConstantDesc");
+	else 
+		simpleTypeNames.put("IntLongFloat", "java.lang.Number & Comparable<?>");
 	simpleTypeNames.put("ListTestAndSerializable", "List<? extends Z & java.io.Serializable>");
 	simpleTypeNames.put("TestAndSerializable", "Z & java.io.Serializable");
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
index a6e2ba3..bd58503 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
@@ -4327,6 +4327,121 @@
 	        true,
 	        /*not tested with javac*/"");
 	}
+	public void testReleaseOption20() throws Exception {
+		if (!isJRE12Plus) return;
+		this.runNegativeTest(
+				new String[] {
+					"X.java",
+					"import java.io.*;\n" + 
+					"\n" + 
+					"public class X {\n" + 
+					"	public static void main(String[] args) {\n" + 
+					"		String str = Integer.toUnsignedString(1, 1);\n" + 
+					"	}\n" + 
+					"}",
+				},
+		     "\"" + OUTPUT_DIR +  File.separator + "X.java\""
+		     + " --release 7 -d \"" + OUTPUT_DIR + "\"",
+		     "",
+		     "----------\n" + 
+    		 "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" + 
+    		 "	String str = Integer.toUnsignedString(1, 1);\n" + 
+    		 "	                     ^^^^^^^^^^^^^^^^\n" + 
+    		 "The method toUnsignedString(int, int) is undefined for the type Integer\n" + 
+    		 "----------\n" + 
+    		 "1 problem (1 error)\n",
+		     true);
+	}
+	public void testReleaseOption21() throws Exception {
+		if (!isJRE12Plus) return;
+		this.runConformTest(
+				new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	public static void main(String[] args) {\n" + 
+					"		Integer.toUnsignedString(1, 1);\n" + 
+					"	}\n" + 
+					"}",
+				},
+		     "\"" + OUTPUT_DIR +  File.separator + "X.java\""
+		     + " --release 8 -d \"" + OUTPUT_DIR + "\"",
+		     "",
+    		 "",
+		     true);
+	}
+	public void testReleaseOption22() {
+		if (isJRE11Plus || isJRE12Plus) return;
+		runConformTest(
+			new String[] {
+				"p/X.java",
+				"package p;\n" +
+				"public class X {\n" +
+				"	public static void main(String[] args) {\n" +
+				"	}\n" +
+				"}",
+				"module-info.java",
+				"module mod.one { \n" +
+				"	requires java.base;\n" +
+				"	requires java.xml.ws.annotation;\n" +
+				"}"
+	        },
+			" --limit-modules java.base,java.xml.ws.annotation " +
+			" --release 10 \"" + OUTPUT_DIR +  File.separator + "module-info.java\" "
+	        + "\"" + OUTPUT_DIR +  File.separator + "p/X.java\"",
+	        "",
+	        "----------\n" + 
+    		"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 3)\n" + 
+    		"	requires java.xml.ws.annotation;\n" + 
+    		"	         ^^^^^^^^^^^^^^^^^^^^^^\n" + 
+    		"The module java.xml.ws.annotation has been deprecated since version 9 and marked for removal\n" + 
+    		"----------\n" + 
+    		"1 problem (1 warning)\n",
+	        true);
+	}
+	public void testReleaseOption23() {
+		if (!isJRE11Plus) return;
+		runNegativeTest(
+			new String[] {
+				"p/X.java",
+				"package p;\n" +
+				"public class X {\n" +
+				"	public static void main(String[] args) {\n" +
+				"	}\n" +
+				"}",
+				"module-info.java",
+				"module mod.one { \n" +
+				"	requires java.xml.ws.annotation;\n" +
+				"}"
+	        },
+			" --limit-modules java.base,java.xml.ws.annotation " +
+			" --release 11 \"" + OUTPUT_DIR +  File.separator + "module-info.java\" "
+	        + "\"" + OUTPUT_DIR +  File.separator + "p/X.java\"",
+	        "",
+	        "invalid module name: java.xml.ws.annotation\n",
+	        true);
+	}
+	public void testReleaseOption24() {
+		if (!isJRE11Plus) return;
+		runNegativeTest(
+			new String[] {
+				"p/X.java",
+				"package p;\n" +
+				"public class X {\n" +
+				"	public static void main(String[] args) {\n" +
+				"	}\n" +
+				"}",
+				"module-info.java",
+				"module mod.one { \n" +
+				"	requires java.xml.ws.annotation;\n" +
+				"}"
+	        },
+			" --limit-modules java.base,java.xml.ws.annotation " +
+			" --release 12 \"" + OUTPUT_DIR +  File.separator + "module-info.java\" "
+	        + "\"" + OUTPUT_DIR +  File.separator + "p/X.java\"",
+	        "",
+	        "invalid module name: java.xml.ws.annotation\n",
+	        true);
+	}
 	public void testLimitModules1() {
 		File outputDirectory = new File(OUTPUT_DIR);
 		Util.flushDirectoryContent(outputDirectory);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
index f75e67e..4ed2b29 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2018 GK Software AG and others.
+ * Copyright (c) 2010, 2019 GK Software AG and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -10360,4 +10360,228 @@
 		"----------\n"
 	);
 }
+public void testBug542707_001() {
+	if (this.complianceLevel < ClassFileConstants.JDK12)
+		return;
+	Map options = getCompilerOptions();
+	options.put(JavaCore.COMPILER_PB_POTENTIAL_NULL_REFERENCE, JavaCore.ERROR);
+	options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12); 
+	options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	runNegativeTestWithLibs(
+			new String[] {
+			"X.java",
+			"import java.io.IOException;\n"+
+			"\n"+
+			"import org.eclipse.jdt.annotation.NonNull;\n"+
+			"\n"+
+			"public class X {\n"+
+			"	public static int foo(int i) throws IOException {\n"+
+			"		int k = 0;\n"+
+			"		@NonNull\n"+
+			"		X x = new X();\n"+
+			"		x  = switch (i) { \n"+
+			"		case 1  ->   {\n"+
+			"			x = null;\n"+
+			"			break x;\n"+
+			"		}\n"+
+			"		default -> null;\n"+
+			"		};\n"+
+			"\n"+
+			"		return k ;\n"+
+			"	}\n"+
+			"\n"+
+			"	public static void main(String[] args) {\n"+
+			"		try {\n"+
+			"			System.out.println(foo(3));\n"+
+			"		} catch (IOException e) {\n"+
+			"			// do nothing\n"+
+			"		}\n"+
+			"	}\n"+
+			"}\n"
+				},
+		options,
+		"----------\n" + 
+		"1. ERROR in X.java (at line 12)\n" + 
+		"	x = null;\n" + 
+		"	    ^^^^\n" + 
+		"Null type mismatch: required \'@NonNull X\' but the provided value is null\n" + 
+		"----------\n" + 
+		"2. ERROR in X.java (at line 15)\n" + 
+		"	default -> null;\n" + 
+		"	           ^^^^\n" + 
+		"Null type mismatch: required \'@NonNull X\' but the provided value is null\n" + 
+		"----------\n"
+	);
+}
+/**
+ * should not throw IOOBE while building - a safety check test case.
+ */
+public void testBug542707_002() {
+	if (this.complianceLevel != ClassFileConstants.JDK12)
+		return;
+	Map options = getCompilerOptions();
+	options.put(JavaCore.COMPILER_PB_POTENTIAL_NULL_REFERENCE, JavaCore.ERROR);
+	options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12); 
+	options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+	options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+	options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	runNegativeTestWithLibs(
+			new String[] {
+			"X.java",
+			"import org.eclipse.jdt.annotation.*;\n" +
+			"public class X {\n" +
+			"    	void m1(@NonNull String a) {}\n" +
+			"		void m2(@Nullable String b, int i) {\n" +
+			"			m1(switch(i) {\n" +
+			"			case 0 : {\n" +
+			"				break \"hello\";\n" +
+			"			}\n" +
+			"			default : break \"world\";\n" +
+			"			});\n" +
+			"		}\n" +
+			"		void m3() {\n" +
+			"			Zork();\n" +
+			"		}\n" +
+			"}\n"
+				},
+		options,
+		"----------\n" + 
+		"1. ERROR in X.java (at line 13)\n" + 
+		"	Zork();\n" + 
+		"	^^^^\n" + 
+		"The method Zork() is undefined for the type X\n" + 
+		"----------\n"
+	);
+}
+public void testBug542707_003() {
+	if (this.complianceLevel < ClassFileConstants.JDK12) return; // switch expression
+	// outer expected type (from assignment) is propagated deeply into a switch expression
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+	runner.customOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	runner.classLibraries = this.LIBS;
+	runner.testFiles = new String[] {
+		"X.java",
+		"import org.eclipse.jdt.annotation.*;\n" +
+		"public class X {\n" +
+		"	@Nullable String maybe() { return null; }\n" + 
+		"	void test(int i) {\n" +
+		"		@NonNull String s = switch (i) {\n" + 
+		"			case 1 -> \"\";\n" + 
+		"			default -> i == 3 ? maybe() : \"\";\n" + 
+		"		};\n" + 
+		"		System.out.println(s.toLowerCase());\n" +
+		"	}\n" +
+		"}\n"
+	};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 7)\n" + 
+			"	default -> i == 3 ? maybe() : \"\";\n" + 
+			"	                    ^^^^^^^\n" + 
+			"Null type mismatch (type annotations): required '@NonNull String' but this expression has type '@Nullable String'\n" + 
+			"----------\n";
+	runner.runNegativeTest();
+}
+// failing, see https://bugs.eclipse.org/543860
+public void _testBug542707_004() {
+	if (this.complianceLevel < ClassFileConstants.JDK12) return; // switch expression
+	// outer expected type (from method parameter) is propagated deeply into a switch expression
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+	runner.customOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	runner.classLibraries = this.LIBS;
+	runner.testFiles = new String[] {
+		"X.java",
+		"import org.eclipse.jdt.annotation.*;\n" +
+		"public class X {\n" +
+		"	@Nullable String maybe() { return null; }\n" + 
+		"	void need(@NonNull String s) {\n" + 
+		"		System.out.println(s.toLowerCase());\n" + 
+		"	}\n" +
+		"	void test(int i) {\n" +
+		"		need(switch (i) {\n" + 
+		"			case 1 -> \"\";\n" + 
+		"			default -> i == 3 ? maybe() : \"\";\n" + 
+		"		});\n" + 
+		"	}\n" +
+		"}\n"
+	};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 10)\n" + 
+			"	default -> i == 3 ? maybe() : \"\";\n" + 
+			"	                    ^^^^^^^\n" + 
+			"Null type mismatch (type annotations): required '@NonNull String' but this expression has type '@Nullable String'\n" + 
+			"----------\n";
+	runner.runNegativeTest();
+}
+public void testBug542707_005() {
+	if (this.complianceLevel < ClassFileConstants.JDK12) return; // switch expression
+	// switch value must not be null (@Nullable)
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+	runner.customOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	runner.classLibraries = this.LIBS;
+	runner.testFiles = new String[] {
+		"X.java",
+		"import org.eclipse.jdt.annotation.*;\n" +
+		"enum SomeDays { Mon, Wed, Fri }\n" +
+		"public class X {\n" +
+		"	int testEnum(@Nullable SomeDays day) {\n" + 
+		"		return switch(day) {\n" + 
+		"		case Mon -> 1;\n" + 
+		"		case Wed -> 2;\n" + 
+		"		case Fri -> 3;\n" + 
+		"		};\n" + 
+		"	}\n" +
+		"}\n"
+	};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 5)\n" + 
+			"	return switch(day) {\n" + 
+			"	              ^^^\n" + 
+			"Potential null pointer access: this expression has a \'@Nullable\' type\n" + 
+			"----------\n";
+	runner.runNegativeTest();
+}
+public void testBug542707_006() {
+	if (this.complianceLevel < ClassFileConstants.JDK12) return; // switch expression
+	// switch value must not be null (pot-null by flow analysis)
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+	runner.customOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	runner.classLibraries = this.LIBS;
+	runner.testFiles = new String[] {
+		"X.java",
+		"enum SomeDays { Mon, Wed, Fri }\n" +
+		"public class X {\n" +
+		"	int testEnum(boolean b) {\n" +
+		"		SomeDays day = b ? SomeDays.Mon : null;\n" + 
+		"		return switch(day) {\n" + 
+		"		case Mon -> 1;\n" + 
+		"		case Wed -> 2;\n" + 
+		"		case Fri -> 3;\n" + 
+		"		};\n" + 
+		"	}\n" +
+		"}\n"
+	};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"2. ERROR in X.java (at line 5)\n" + 
+			"	return switch(day) {\n" + 
+			"	              ^^^\n" + 
+			"Potential null pointer access: The variable day may be null at this location\n" + 
+			"----------\n";
+	runner.runNegativeTest();
+}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java
index 60f05cc..8649fd7 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -45,6 +45,7 @@
 package org.eclipse.jdt.core.tests.compiler.regression;
 
 import java.io.File;
+import java.util.HashMap;
 import java.util.Map;
 
 import junit.framework.Test;
@@ -18237,4 +18238,31 @@
 	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
 	runner.runNegativeTest();
 }
+public void testBug542707_1() {
+	if (this.complianceLevel < ClassFileConstants.JDK12) return; // switch expression
+	Runner runner = new Runner();
+	runner.customOptions = new HashMap<>();
+	runner.customOptions.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+	runner.customOptions.put(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
+	runner.testFiles = new String[] {
+		"X.java",
+		"public class X {\n" +
+		"	void test(int i) {\n" +
+		"		String s = switch (i) {\n" +
+		"			case 1 -> \"one\";\n" +
+		"			default -> null;\n" +
+		"		};\n" +
+		"		System.out.println(s.toLowerCase());\n" +
+		"	}\n" +
+		"}\n"
+	};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 7)\n" + 
+			"	System.out.println(s.toLowerCase());\n" + 
+			"	                   ^\n" + 
+			"Potential null pointer access: The variable s may be null at this location\n" + 
+			"----------\n";
+	runner.runNegativeTest();
+}
 }
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
index 0e9cab5..f440a44 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2018 GK Software AG and others.
+ * Copyright (c) 2012, 2019 GK Software AG and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -17771,4 +17771,52 @@
 		"----------\n"
 	);
 }
+public void testBug542707_1() {
+	if (this.complianceLevel < ClassFileConstants.JDK12) return; // switch expression
+	// switch expression has a functional type with interesting type inference and various null issues:
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+	runner.customOptions.put(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
+	runner.classLibraries = this.LIBS;
+	runner.testFiles = new String[] {
+		"X.java",
+		"import org.eclipse.jdt.annotation.*;\n" +
+		"import java.util.function.*;\n" +
+		"interface IN0 {}\n" + 
+		"interface IN1 extends IN0 {}\n" + 
+		"interface IN2 extends IN0 {}\n" +
+		"public class X {\n" +
+		"	@NonNull IN1 n1() { return new IN1() {}; }\n" + 
+		"	IN2 n2() { return null; }\n" + 
+		"	<M> void m(@NonNull Supplier<@NonNull M> m2) { }\n" + 
+		"	void testSw(int i) {\n" + 
+		"		m(switch(i) {\n" + 
+		"			case 1 -> this::n1;\n" + 
+		"			case 2 -> () -> n1();\n" + 
+		"			case 3 -> null;\n" + 
+		"			case 4 -> () -> n2();\n" + 
+		"			default -> this::n2; });\n" + 
+		"	}\n" +
+		"}\n"
+	};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 14)\n" + 
+			"	case 3 -> null;\n" + 
+			"	          ^^^^\n" + 
+			"Null type mismatch: required \'@NonNull Supplier<@NonNull IN0>\' but the provided value is null\n" + 
+			"----------\n" + 
+			"2. WARNING in X.java (at line 15)\n" + 
+			"	case 4 -> () -> n2();\n" + 
+			"	                ^^^^\n" + 
+			"Null type safety (type annotations): The expression of type \'IN2\' needs unchecked conversion to conform to \'@NonNull IN0\'\n" + 
+			"----------\n" + 
+			"3. WARNING in X.java (at line 16)\n" + 
+			"	default -> this::n2; });\n" + 
+			"	           ^^^^^^^^\n" + 
+			"Null type safety at method return type: Method descriptor Supplier<IN0>.get() promises \'@NonNull IN0\' but referenced method provides \'IN2\'\n" + 
+			"----------\n";
+	runner.runNegativeTest();
+}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java
index 6988995..9f56550 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 2014 GK Software AG and others.
+ * Copyright (c) 2011, 2019 GK Software AG and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -53,7 +53,7 @@
 	"}\n";
 
 static {
-//	TESTS_NAMES = new String[] { "testBug462371_shouldWarn" };
+//	TESTS_NAMES = new String[] { "testBug542707" };
 //	TESTS_NUMBERS = new int[] { 50 };
 //	TESTS_RANGE = new int[] { 11, -1 };
 }
@@ -5495,4 +5495,176 @@
 	};
 	runner.runConformTest();
 }
+public void testBug542707_001() {
+	if (this.complianceLevel < ClassFileConstants.JDK12) return; // uses switch expression
+	Map options = getCompilerOptions();
+	options.put(JavaCore.COMPILER_PB_UNCLOSED_CLOSEABLE, CompilerOptions.ERROR);
+	options.put(JavaCore.COMPILER_PB_POTENTIALLY_UNCLOSED_CLOSEABLE, CompilerOptions.ERROR);
+	options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	runLeakTest(
+		new String[] {
+			"X.java",
+			"import java.io.Closeable;\n"+
+			"import java.io.IOException;\n"+
+			"\n"+
+			"public class X implements Closeable{\n"+
+			"	public static int foo(int i) throws IOException {\n"+
+			"		int k = 0;\n"+
+			"		X x = null;\n"+
+			"		try {\n"+
+			"			x = new X();\n"+
+			"			x  = switch (i) { \n"+
+			"			  case 1  ->   {\n"+
+			"				 break x;\n"+
+			"			  }\n"+
+			"			  default -> x;\n"+
+			"			};\n"+
+			"		} finally {\n"+
+			"			x.close();\n"+
+			"		}\n"+
+			"		return k ;\n"+
+			"	}\n"+
+			"\n"+
+			"	public static void main(String[] args) {\n"+
+			"		try {\n"+
+			"			System.out.println(foo(3));\n"+
+			"		} catch (IOException e) {\n"+
+			"			// do nothing\n"+
+			"		}\n"+
+			"	}\n"+
+			"	@Override\n"+
+			"	public void close() throws IOException {\n"+
+			"		Zork();\n"+
+			"	}\n"+
+			"}\n"
+		},
+		"----------\n" +
+		"1. ERROR in X.java (at line 31)\n" + 
+		"	Zork();\n" + 
+		"	^^^^\n" + 
+		"The method Zork() is undefined for the type X\n" + 
+		"----------\n",
+		options);
+}
+public void testBug542707_002() {
+	if (this.complianceLevel < ClassFileConstants.JDK12) return; // uses switch expression
+	Map options = getCompilerOptions();
+	options.put(JavaCore.COMPILER_PB_UNCLOSED_CLOSEABLE, CompilerOptions.ERROR);
+	options.put(JavaCore.COMPILER_PB_POTENTIALLY_UNCLOSED_CLOSEABLE, CompilerOptions.ERROR);
+	options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	runLeakTest(
+		new String[] {
+			"X.java",
+			"import java.io.Closeable;\n"+
+			"import java.io.IOException;\n"+
+			"\n"+
+			"public class X implements Closeable{\n"+
+			"	public static int foo(int i) throws IOException {\n"+
+			"		int k = 0;\n"+
+			"		X x = null;\n"+
+			"		try {\n"+
+			"			x = new X();\n"+
+			"			x  = switch (i) { \n"+
+			"			  case 1  ->   {\n"+
+			"				 x = new X();\n"+
+			"				 break x;\n"+
+			"			  }\n"+
+			"			  default -> x;\n"+
+			"			};\n"+
+			"		} finally {\n"+
+			"			x.close();\n"+
+			"		}\n"+
+			"		return k ;\n"+
+			"	}\n"+
+			"\n"+
+			"	public static void main(String[] args) {\n"+
+			"		try {\n"+
+			"			System.out.println(foo(3));\n"+
+			"		} catch (IOException e) {\n"+
+			"			// do nothing\n"+
+			"		}\n"+
+			"	}\n"+
+			"	@Override\n"+
+			"	public void close() throws IOException {\n"+
+			"		Zork();\n"+
+			"	}\n"+
+			"}\n"
+		},
+		"----------\n" +
+		"1. ERROR in X.java (at line 12)\n" + 
+		"	x = new X();\n" + 
+		"	^^^^^^^^^^^\n" + 
+		"Resource leak: \'x\' is not closed at this location\n" + 
+		"----------\n" + 
+		"2. ERROR in X.java (at line 32)\n" + 
+		"	Zork();\n" + 
+		"	^^^^\n" + 
+		"The method Zork() is undefined for the type X\n" + 
+		"----------\n",
+		options);
+}
+public void testBug542707_003() {
+	if (this.complianceLevel < ClassFileConstants.JDK12) return; // uses switch expression
+	Map options = getCompilerOptions();
+	options.put(JavaCore.COMPILER_PB_UNCLOSED_CLOSEABLE, CompilerOptions.ERROR);
+	options.put(JavaCore.COMPILER_PB_POTENTIALLY_UNCLOSED_CLOSEABLE, CompilerOptions.ERROR);
+	options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+	options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+	runLeakTest(
+		new String[] {
+			"X.java",
+			"import java.io.Closeable;\n"+
+			"import java.io.IOException;\n"+
+			"\n"+
+			"public class X implements Closeable{\n"+
+			"	public static int foo(int i) throws IOException {\n"+
+			"		int k = 0;\n"+
+			"		X x = null;\n"+
+			"		try {\n"+
+			"			x = new X();\n"+
+			"			x  = switch (i) { \n"+
+			"			  case 1  ->   {\n"+
+			"				 break new X();\n"+
+			"			  }\n"+
+			"			  default -> x;\n"+
+			"			};\n"+
+			"		} finally {\n"+
+			"			x.close();\n"+
+			"		}\n"+
+			"		return k ;\n"+
+			"	}\n"+
+			"\n"+
+			"	public static void main(String[] args) {\n"+
+			"		try {\n"+
+			"			System.out.println(foo(3));\n"+
+			"		} catch (IOException e) {\n"+
+			"			// do nothing\n"+
+			"		}\n"+
+			"	}\n"+
+			"	@Override\n"+
+			"	public void close() throws IOException {\n"+
+			"		Zork();\n"+
+			"	}\n"+
+			"}\n"
+		},
+		"----------\n" +
+		"1. ERROR in X.java (at line 10)\n" + 
+		"	x  = switch (i) { \n" + 
+		"			  case 1  ->   {\n" + 
+		"				 break new X();\n" + 
+		"			  }\n" + 
+		"			  default -> x;\n" + 
+		"			};\n" + 
+		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+		"Resource leak: \'x\' is not closed at this location\n" + 
+		"----------\n" + 
+		"2. ERROR in X.java (at line 31)\n" + 
+		"	Zork();\n" + 
+		"	^^^^\n" + 
+		"The method Zork() is undefined for the type X\n" + 
+		"----------\n",
+		options);
+}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java
new file mode 100644
index 0000000..78b1202
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java
@@ -0,0 +1,2365 @@
+/*******************************************************************************
+ * Copyright (c) 2018, 2019 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.compiler.regression;
+
+import java.util.Map;
+
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+
+import junit.framework.Test;
+
+public class SwitchExpressionTest extends AbstractRegressionTest {
+
+	static {
+//		TESTS_NUMBERS = new int [] { 40 };
+//		TESTS_NAMES = new String[] { "testBug543240_1" };
+	}
+	
+	public static Class<?> testClass() {
+		return SwitchExpressionTest.class;
+	}
+	public static Test suite() {
+		return buildMinimalComplianceTestSuite(testClass(), F_12);
+	}
+	public SwitchExpressionTest(String testName){
+		super(testName);
+	}
+
+	// Enables the tests to run individually
+	protected Map<String, String> getCompilerOptions() {
+		Map<String, String> defaultOptions = super.getCompilerOptions();
+		defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12); // FIXME
+		defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+		defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+		defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		return defaultOptions;
+	}
+	
+	@Override
+	protected void runConformTest(String[] testFiles, Map customOptions) {
+		super.runConformTest(testFiles, "", null, true, new String[] {"--enable-preview"}, customOptions, null);
+	}
+
+	@Override
+	protected void runConformTest(String[] testFiles, String expectedOutput, Map customOptions) {
+		super.runConformTest(testFiles, expectedOutput, null, true, new String[] {"--enable-preview"}, customOptions, null);
+	}
+	public void testSimpleExpressions() {
+		runConformTest(
+				new String[] {
+						"X.java",
+						"public class X {\n" +
+						"	static int twice(int i) {\n" +
+						"		int tw = switch (i) {\n" +
+						"			case 0 -> i * 0;\n" +
+						"			case 1 -> 2;\n" +
+						"			default -> 3;\n" +
+						"		};\n" +
+						"		return tw;\n" +
+						"	}\n" +
+						"	public static void main(String... args) {\n" +
+						"		System.out.print(twice(3));\n" +
+						"	}\n" +
+						"}\n"
+				},
+				"3",
+				null,
+				new String[] {"--enable-preview"});
+	}
+	public void testSwitchExpression_531714_002() {
+		runConformTest(
+				new String[] {
+						"X.java",
+						"public class X {\n"+
+								"	static int twice(int i) throws Exception {\n"+
+								"		int tw = switch (i) {\n"+
+								"			case 0 -> 0;\n"+
+								"			case 1 -> { \n"+
+								"				System.out.println(\"do_not_print\");\n"+
+								"				break 1;\n"+
+								"			} \n"+
+								"			case 3 -> throw new Exception();\n"+
+								"			default -> throw new Exception();\n"+
+								"		};\n"+
+								"		return tw;\n"+
+								"	}\n"+
+								"	public static void main(String[] args) {\n"+
+								"		try {\n"+
+								"		    try {\n"+
+								"				System.out.print(twice(3));\n"+
+								"			} catch (Exception e) {\n"+
+								"				System.out.print(\"Got Exception - expected\");\n"+
+								"			}\n"+
+								"		} catch (Exception e) {\n"+
+								"		System.out.print(\"Got Exception\");\n"+
+								"		}\n"+
+								"	}\n"+
+								"}\n"
+				},
+				"Got Exception - expected",
+				null,
+				new String[] {"--enable-preview"});
+	}
+	public void testBug531714_error_003() {
+		this.runNegativeTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" +
+				"  public static void main(String[] args) {\n" +
+				"    twice(1);\n" +
+				"  }\n" +
+				"	public static int twice(int i) {\n" +
+				"		int tw = switch (i) {\n" +
+				"		};\n" +
+				"		return tw;\n" +
+				"	}\n" +
+				"}\n",
+			},
+			"----------\n" + 
+			"1. ERROR in X.java (at line 6)\n" + 
+			"	int tw = switch (i) {\n" + 
+			"		};\n" + 
+			"	         ^^^^^^^^^^^^^^^^\n" + 
+			"A switch expression should have a non-empty switch block\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 6)\n" + 
+			"	int tw = switch (i) {\n" + 
+			"	                 ^\n" + 
+			"A switch expression should have a default case\n" + 
+			"----------\n");
+	}
+	public void testBug531714_error_004() {
+		this.runNegativeTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" +
+				"  public static void main(String[] args) {\n" +
+				"    twice(1);\n" +
+				"  }\n" +
+				"	public static int twice(int i) {\n" +
+				"		int tw = switch (i) {\n" +
+				"			case 0 -> 0;\n" +
+				"			case 1 -> { \n" +
+				"				System.out.println(\"heel\");\n" +
+				"				break 1;\n" +
+				"			} \n" +
+				"			case \"hello\" -> throw new java.io.IOException(\"hello\");\n" +
+				"			default -> throw new java.io.IOException(\"world\");\n" +
+				"		};\n" +
+				"		return tw;\n" +
+				"	}\n" +
+				"}\n",
+			},
+			"----------\n" + 
+			"1. ERROR in X.java (at line 12)\n" + 
+			"	case \"hello\" -> throw new java.io.IOException(\"hello\");\n" + 
+			"	     ^^^^^^^\n" + 
+			"Type mismatch: cannot convert from String to int\n" + 
+			"----------\n");
+	}
+	public void testBug531714_error_005() {
+		this.runNegativeTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" +
+				"  public static void main(String[] args) {\n" +
+				"    twice(1);\n" +
+				"  }\n" +
+				"	public static int twice(int i) {\n" +
+				"		int tw = switch (i) {\n" +
+				"			case 0 -> 0;\n" +
+				"			case 1 -> { \n" +
+				"				System.out.println(\"heel\");\n" +
+				"				break 1;\n" +
+				"			} \n" +
+				"		    case 2 -> 2;\n" +
+				"		};\n" +
+				"		return tw;\n" +
+				"	}\n" +
+				"}\n",
+			},
+			"----------\n" + 
+			"1. ERROR in X.java (at line 6)\n" + 
+			"	int tw = switch (i) {\n" + 
+			"	                 ^\n" + 
+			"A switch expression should have a default case\n" + 
+			"----------\n");
+	}
+	/**
+	 * Add a test case for enum
+	 * If the type of the selector expression is an enum type, 
+	 * then the set of all the case constants associated with the switch block
+	 *  must contain all the enum constants of that enum type
+	 *  Add a missing enum test case
+	 */
+	public void _testBug531714_error_006() {
+		this.runNegativeTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" +
+				"  public static void main(String[] args) {\n" +
+				"    int x, y;\n" +
+				"    I i = () -> {\n" +
+				"      int z = 10;\n" +
+				"    };\n" +
+				"    i++;\n" +
+				"  }\n" +
+				"	public static int twice(int i) {\n" +
+				"		int tw = switch (i) {\n" +
+				"			case 0 -> 0;\n" +
+				"			case 1 -> { \n" +
+				"				System.out.println(\"heel\");\n" +
+				"				break 1;\n" +
+				"			} \n" +
+				"		//	case 2 -> 2;\n" +
+				"			case \"hello\" -> throw new IOException(\"hello\");\n" +
+				"		};\n" +
+				"		return tw;\n" +
+				"	}\n" +
+				"}\n",
+			},
+			"----------\n" + 
+			"1. ERROR in X.java (at line 7)\n" + 
+			"	int tw = switch (i) {\n" + 
+			"	      ^^^^^\n" + 
+			" The switch expression should have a default case\n" + 
+			"----------\n");
+	}
+	/*
+	 * should compile - test for adding additional nesting in variables
+	 * dev note: ref consumeToken().case Switch 
+	 */
+	public void testBug531714_error_007() {
+		runConformTest(
+				new String[] {
+						"X.java",
+						"public class X {\n"+
+						"	static int foo(int i) {\n"+
+						"		int tw = \n"+
+						"		switch (i) {\n"+
+						"			case 1 -> \n"+
+						"			 {\n"+
+						" 				int z = 100;\n"+
+						" 				break z;\n"+
+						"			}\n"+
+						"			default -> {\n"+
+						"				break 12;\n"+
+						"			}\n"+
+						"		};\n"+
+						"		return tw;\n"+
+						"	}\n"+
+						"	public static void main(String[] args) {\n"+
+						"		System.out.print(foo(1));\n"+
+						"	}\n"+
+						"}\n"
+				},
+				"100",
+				null,
+				new String[] {"--enable-preview"});
+	}
+	public void testBug531714_008() {
+		Map<String, String> disablePreviewOptions = getCompilerOptions();
+		disablePreviewOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+				"	static int twice(int i) {\n" +
+				"		int tw = switch (i) {\n" +
+				"			case 0 -> i * 0;\n" +
+				"			case 1 -> 2;\n" +
+				"			default -> 3;\n" +
+				"		};\n" +
+				"		return tw;\n" +
+				"	}\n" +
+				"	public static void main(String[] args) {\n" +
+				"		System.out.print(twice(3));\n" +
+				"	}\n" +
+				"}\n",
+		};
+
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 3)\n" + 
+				"	int tw = switch (i) {\n" + 
+				"			case 0 -> i * 0;\n" + 
+				"			case 1 -> 2;\n" + 
+				"			default -> 3;\n" + 
+				"		};\n" + 
+				"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+				"Switch Expressions is a preview feature and disabled by default. Use --enable-preview to enable\n" + 
+				"----------\n" + 
+				"2. ERROR in X.java (at line 4)\n" + 
+				"	case 0 -> i * 0;\n" + 
+				"	^^^^^^\n" + 
+				"Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" + 
+				"----------\n" + 
+				"3. ERROR in X.java (at line 5)\n" + 
+				"	case 1 -> 2;\n" + 
+				"	^^^^^^\n" + 
+				"Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" + 
+				"----------\n" + 
+				"4. ERROR in X.java (at line 6)\n" + 
+				"	default -> 3;\n" + 
+				"	^^^^^^^\n" + 
+				"Case Labels with '->' is a preview feature and disabled by default. Use --enable-preview to enable\n" + 
+				"----------\n";
+
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				disablePreviewOptions);
+	}
+	public void testBug543667_001() {
+		runConformTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" +
+				"\n" +
+				"	public static void bar(int  i) {\n" +
+				"		switch (i) {\n" +
+				"		case 1 -> System.out.println(\"hello\");\n" +
+				"		default -> System.out.println(\"DEFAULT\");\n" +
+				"		}\n" +
+				"	}\n" +
+				"	public static void main(String[] args) {\n" +
+				"		bar(1);\n" +
+				"	}\n" +
+				"}\n"
+			},
+			"hello",
+			null,
+			false,
+			new String[] { "--enable-preview"});
+	}
+	public void testBug531714_009() {
+		Map<String, String> disablePreviewOptions = getCompilerOptions();
+		disablePreviewOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+				"	static int twice(int i) {\n" +
+				"		switch (i) {\n" +
+				"			case 0 -> i * 0;\n" +
+				"			case 1 -> 2;\n" +
+				"			default -> 3;\n" +
+				"		}\n" +
+				"		return 0;\n" +
+				"	}\n" +
+				"	public static void main(String[] args) {\n" +
+				"		System.out.print(twice(3));\n" +
+				"	}\n" +
+				"}\n",
+		};
+
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 4)\n" + 
+				"	case 0 -> i * 0;\n" + 
+				"	^^^^^^\n" + 
+				"Case Labels with \'->\' is a preview feature and disabled by default. Use --enable-preview to enable\n" + 
+				"----------\n" + 
+				"2. ERROR in X.java (at line 5)\n" + 
+				"	case 1 -> 2;\n" + 
+				"	^^^^^^\n" + 
+				"Case Labels with \'->\' is a preview feature and disabled by default. Use --enable-preview to enable\n" + 
+				"----------\n" + 
+				"3. ERROR in X.java (at line 6)\n" + 
+				"	default -> 3;\n" + 
+				"	^^^^^^^\n" + 
+				"Case Labels with \'->\' is a preview feature and disabled by default. Use --enable-preview to enable\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				disablePreviewOptions);
+	}
+	public void testBug531714_010() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.ERROR);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+				"	static int twice(int i) {\n" +
+				"		switch (i) {\n" +
+				"			default -> 3;\n" +
+				"		}\n" +
+				"		return 0;\n" +
+				"	}\n" +
+				"	public static void main(String[] args) {\n" +
+				"		System.out.print(twice(3));\n" +
+				"	}\n" +
+				"}\n",
+		};
+
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 4)\n" + 
+				"	default -> 3;\n" + 
+				"	^^^^^^^\n" + 
+				"You are using a preview language feature that may or may not be supported in a future release\n" + 
+				"----------\n" + 
+				"2. ERROR in X.java (at line 4)\n" + 
+				"	default -> 3;\n" + 
+				"	           ^\n" + 
+				"Invalid expression as statement\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				options);
+	}
+	public void testBug531714_011() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+				"	@SuppressWarnings(\"preview\")\n" +
+				"	static int twice(int i) {\n" +
+				"		switch (i) {\n" +
+				"			default -> 3;\n" +
+				"		}\n" +
+				"		return 0;\n" +
+				"	}\n" +
+				"	public static void main(String[] args) {\n" +
+				"		System.out.print(twice(3));\n" +
+				"	}\n" +
+				"}\n",
+		};
+
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 5)\n" + 
+				"	default -> 3;\n" + 
+				"	           ^\n" + 
+				"Invalid expression as statement\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				getCompilerOptions());
+	}
+	public void testBug531714_012() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
+		String release = options.get(CompilerOptions.OPTION_Release);
+		options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11);
+		try {
+			String[] testFiles = new String[] {
+					"X.java",
+					"public class X {\n" +
+					"	static int twice(int i) {\n" +
+					"		switch (i) {\n" +
+					"			default -> 3;\n" +
+					"		}\n" +
+					"		return 0;\n" +
+					"	}\n" +
+					"	public static void main(String[] args) {\n" +
+					"		System.out.print(twice(3));\n" +
+					"	}\n" +
+					"}\n",
+			};
+
+			String expectedProblemLog =
+					"----------\n" + 
+					"1. ERROR in X.java (at line 4)\n" + 
+					"	default -> 3;\n" + 
+					"	^^^^^^^\n" + 
+					"The preview feature Case Labels with \'->\' is only available with source level 12 and above\n" + 
+					"----------\n" + 
+					"2. ERROR in X.java (at line 4)\n" + 
+					"	default -> 3;\n" + 
+					"	           ^\n" + 
+					"Invalid expression as statement\n" + 
+					"----------\n";
+			this.runNegativeTest(
+					testFiles,
+					expectedProblemLog,
+					null,
+					true,
+					options);
+		} finally {
+			options.put(CompilerOptions.OPTION_Source, release);
+		}
+	}
+	public void testBug531714_013() {
+			String[] testFiles = new String[] {
+					"X.java",
+					"public class X {\n" +
+					"	public static int foo(int i) {\n" +
+					"		int v;\n" +
+					"		int t = switch (i) {\n" +
+					"		case 0 : {\n" +
+					"			break 0;\n" +
+					"		}\n" +
+					"		default :v = 2;\n" +
+					"		};\n" +
+					"		return t;\n" +
+					"	}\n" +
+					"	\n" +
+					"	public boolean bar() {\n" +
+					"		return true;\n" +
+					"	}\n" +
+					"	public static void main(String[] args) {\n" +
+					"		System.out.println(foo(3));\n" +
+					"	}\n" +
+					"}\n",
+			};
+
+			String expectedProblemLog =
+					"----------\n" + 
+					"1. ERROR in X.java (at line 8)\n" + 
+					"	default :v = 2;\n" + 
+					"	         ^^^^^\n" + 
+					"A switch labeled block in a switch expression should not complete normally\n" + 
+					"----------\n";
+			this.runNegativeTest(
+					testFiles,
+					expectedProblemLog,
+					null,
+					true,
+					getCompilerOptions());
+	}
+	public void testBug531714_014() {
+		// switch expression is not a Primary
+		Runner runner = new Runner();
+		runner.customOptions = getCompilerOptions();
+		runner.testFiles = new String[] {
+			"X.java",
+			"public class X {\n" +
+			"	void test(int i) {\n" +
+			"		System.out.println(switch (i) {\n" +
+			"			case 1 -> \"one\";\n" +
+			"			default -> null;\n" +
+			"		}.toLowerCase());\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		new X().test(1);\n" +
+			"	}\n" +
+			"}\n"
+		};
+		runner.expectedCompilerLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 6)\n" + 
+				"	}.toLowerCase());\n" + 
+				"	 ^\n" + 
+				"Syntax error on token \".\", , expected\n" + 
+				"----------\n";
+		runner.runNegativeTest();
+	}
+	public void testBug543673_001() {
+		runConformTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" +
+				"	public static int foo(Day day) {\n" +
+				"\n" +
+				"		var len= switch (day) {\n" +
+				"			case SUNDAY-> 6;\n" +
+				"			default -> 10;\n" +
+				"		};\n" +
+				"\n" +
+				"		return len;\n" +
+				"	}\n" +
+				"\n" +
+				"	public static void main(String[] args) {\n" +
+				"		System.out.println(foo(Day.SUNDAY));\n" +
+				"	}\n" +
+				"}\n" +
+				"enum Day {\n" +
+				"	MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
+				"}\n"
+			},
+			"6",
+			null,
+			false,
+			new String[] { "--enable-preview"});
+	}
+	/*
+	 * A simple multi constant case statement, compiled and run as expected
+	 */
+	public void testBug543240_1() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+						"public static void bar(Day day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATURDAY, SUNDAY: \n" + 
+						"			System.out.println(Day.SUNDAY);\n" + 
+						"			break;\n" + 
+						"		case MONDAY : System.out.println(Day.MONDAY);\n" + 
+						"					break;\n" + 
+						"		}\n" + 
+						"	}" +
+						"	public static void main(String[] args) {\n" +
+						"		bar(Day.SATURDAY);\n" +
+						"	}\n" +
+						"}\n" +
+						"enum Day { SATURDAY, SUNDAY, MONDAY;}",
+		};
+
+		String expectedProblemLog =
+				"SUNDAY";
+		this.runConformTest(
+				testFiles,
+				expectedProblemLog,
+				options,
+				new String[] { "--enable-preview"});
+	}
+	/*
+	 * A simple multi constant case statement, compiler reports missing enum constants
+	 */
+	public void testBug543240_1a() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+						"	public static void main(String[] args) {\n" + 
+						"	}\n" + 
+						"public static void bar(Day day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATURDAY, SUNDAY: \n" + 
+						"			System.out.println(Day.SUNDAY);\n" + 
+						"			break;\n" + 
+						"		case MONDAY : System.out.println(Day.MONDAY);\n" + 
+						"					break;\n" + 
+						"		}\n" + 
+						"	}" +
+						"}\n" +
+						"enum Day { SATURDAY, SUNDAY, MONDAY, TUESDAY;}",
+		};
+
+		String expectedProblemLog =
+						"----------\n" + 
+						"1. WARNING in X.java (at line 5)\n" + 
+						"	switch (day) {\n" + 
+						"	        ^^^\n" + 
+						"The enum constant TUESDAY needs a corresponding case label in this enum switch on Day\n" + 
+						"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				new String[] { "--enable-preview"},
+				options);
+	}
+	/*
+	 * A simple multi constant case statement with duplicate enums
+	 */
+	public void testBug543240_2() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+						"public static void bar(Day day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATURDAY, SUNDAY: \n" + 
+						"			System.out.println(Day.SUNDAY);\n" + 
+						"			break;\n" + 
+						"		case SUNDAY : System.out.println(Day.SUNDAY);\n" + 
+						"					break;\n" + 
+						"		}\n" + 
+						"	}" +
+						"	public static void main(String[] args) {\n" +
+						"		bar(Day.SATURDAY);\n" +
+						"	}\n" +
+						"}\n" +
+						"enum Day { SATURDAY, SUNDAY, MONDAY;}",
+		};
+
+		String expectedProblemLog =
+						"----------\n" + 
+						"1. ERROR in X.java (at line 7)\n" + 
+						"	case SUNDAY : System.out.println(Day.SUNDAY);\n" + 
+						"	^^^^^^^^^^^\n" + 
+						"Duplicate case\n" + 
+						"----------\n" + 
+						"2. ERROR in X.java (at line 7)\n" + 
+						"	case SUNDAY : System.out.println(Day.SUNDAY);\n" + 
+						"	^^^^^^^^^^^\n" + 
+						"Duplicate case\n" + 
+						"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				options);
+	}
+	/*
+	 * A simple multi constant case statement with duplicate enums
+	 */
+	public void testBug543240_2a() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+						"public static void bar(Day day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATURDAY, SUNDAY: \n" + 
+						"			System.out.println(Day.SUNDAY);\n" + 
+						"			break;\n" + 
+						"		case SUNDAY, SATURDAY : \n" +
+						"			System.out.println(Day.SUNDAY);\n" + 
+						"			break;\n" + 
+						"		}\n" + 
+						"	}" +
+						"}\n" +
+						"enum Day { SATURDAY, SUNDAY, MONDAY;}",
+		};
+
+		String expectedProblemLog =
+						"----------\n" + 
+						"1. WARNING in X.java (at line 3)\n" + 
+						"	switch (day) {\n" + 
+						"	        ^^^\n" + 
+						"The enum constant MONDAY needs a corresponding case label in this enum switch on Day\n" + 
+						"----------\n" + 
+						"2. ERROR in X.java (at line 7)\n" + 
+						"	case SUNDAY, SATURDAY : \n" + 
+						"	^^^^^^^^^^^^^^^^^^^^^\n" + 
+						"Duplicate case\n" + 
+						"----------\n" + 
+						"3. ERROR in X.java (at line 7)\n" + 
+						"	case SUNDAY, SATURDAY : \n" + 
+						"	^^^^^^^^^^^^^^^^^^^^^\n" + 
+						"Duplicate case\n" + 
+						"----------\n" + 
+						"4. ERROR in X.java (at line 7)\n" + 
+						"	case SUNDAY, SATURDAY : \n" + 
+						"	^^^^^^^^^^^^^^^^^^^^^\n" + 
+						"Duplicate case\n" + 
+						"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				options);
+	}
+	/*
+	 * 
+	 */
+	public void testBug543240_3() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+						"public static void bar(Day day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATURDAY, SUNDAY: \n" + 
+						"			System.out.println(Day.SUNDAY);\n" + 
+						"			break;\n" + 
+						"		case TUESDAY : System.out.println(Day.SUNDAY);\n" + 
+						"					break;\n" + 
+						"		}\n" + 
+						"	}" +
+						"	public static void main(String[] args) {\n" +
+						"		bar(Day.SATURDAY);\n" +
+						"	}\n" +
+						"}\n" +
+						"enum Day { SATURDAY, SUNDAY, MONDAY, TUESDAY;}",
+		};
+
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. WARNING in X.java (at line 3)\n" + 
+				"	switch (day) {\n" + 
+				"	        ^^^\n" + 
+				"The enum constant MONDAY needs a corresponding case label in this enum switch on Day\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				new String[] {"--enable-preview"},
+				options);
+	}
+	public void testBug543240_4() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+						"public static void bar(Day day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATURDAY, SUNDAY: \n" + 
+						"			System.out.println(day);\n" + 
+						"			break;\n" + 
+						"		case MONDAY : System.out.println(0);\n" + 
+						"					break;\n" + 
+						"		}\n" + 
+						"	}" +
+						"	public static void main(String[] args) {\n" +
+						"		bar(Day.SATURDAY);\n" +
+						"		bar(Day.MONDAY);\n" +
+						"		bar(Day.SUNDAY);\n" +
+						"	}\n" +
+						"}\n" +
+						"enum Day { SATURDAY, SUNDAY, MONDAY;}",
+		};
+
+		String expectedProblemLog =
+				"SATURDAY\n" + 
+				"0\n" + 
+				"SUNDAY";
+		this.runConformTest(
+				testFiles,
+				expectedProblemLog,
+				options,
+				new String[] {"--enable-preview"});
+	}
+	/*
+	 * Simple switch case with string literals
+	 */
+	public void testBug543240_5() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(\"a\");\n" + 
+						"		bar(\"b\");\n" + 
+						"		bar(\"c\");\n" + 
+						"		bar(\"d\");\n" + 
+						"	}\n" + 
+						"	public static void bar(String s) {\n" + 
+						"		switch(s) {\n" + 
+						"		case \"a\":\n" + 
+						"		case \"b\":\n" + 
+						"			System.out.println(\"A/B\");\n" + 
+						"			break;\n" + 
+						"		case \"c\":\n" + 
+						"			System.out.println(\"C\");\n" + 
+						"			break;\n" + 
+						"		default:\n" + 
+						"			System.out.println(\"NA\");\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"}",
+		};
+		String expectedProblemLog =
+				"A/B\n" + 
+				"A/B\n" + 
+				"C\n" + 
+				"NA";
+		this.runConformTest(
+				testFiles,
+				expectedProblemLog,
+				options,
+				new String[] {"--enable-preview"});
+	}
+	public void testBug543240_6() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(\"a\");\n" + 
+						"		bar(\"b\");\n" + 
+						"		bar(\"c\");\n" + 
+						"		bar(\"d\");\n" + 
+						"	}\n" + 
+						"	public static void bar(String s) {\n" + 
+						"		switch(s) {\n" + 
+						"		case \"a\", \"b\":\n" + 
+						"			System.out.println(\"A/B\");\n" + 
+						"			break;\n" + 
+						"		case \"c\":\n" + 
+						"			System.out.println(\"C\");\n" + 
+						"			break;\n" + 
+						"		default:\n" + 
+						"			System.out.println(\"NA\");\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"}",
+		};
+		String expectedProblemLog =
+				"A/B\n" + 
+				"A/B\n" + 
+				"C\n" + 
+				"NA";
+		this.runConformTest(
+				testFiles,
+				expectedProblemLog,
+				options,
+				new String[] {"--enable-preview"});
+	}
+	/*
+	 * Switch with multi constant case statements with string literals
+	 * two string literals with same hashcode
+	 */
+	public void testBug543240_7() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(\"FB\");\n" + 
+						"		bar(\"Ea\");\n" + 
+						"		bar(\"c\");\n" + 
+						"		bar(\"D\");\n" + 
+						"	}\n" + 
+						"	public static void bar(String s) {\n" + 
+						"		switch(s) {\n" + 
+						"		case \"FB\", \"c\":\n" + 
+						"			System.out.println(\"A\");\n" + 
+						"			break;\n" + 
+						"		case \"Ea\":\n" + 
+						"			System.out.println(\"B\");\n" + 
+						"			break;\n" + 
+						"		default:\n" + 
+						"			System.out.println(\"NA\");\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"}",
+		};
+		String expectedProblemLog =
+				"A\n" + 
+				"B\n" + 
+				"A\n" + 
+				"NA";
+		this.runConformTest(
+				testFiles,
+				expectedProblemLog,
+				options,
+				new String[] {"--enable-preview"});
+	}
+	/*
+	 * Switch with multi constant case statements with integer constants
+	 */
+	public void testBug543240_8() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(1);\n" + 
+						"		bar(2);\n" + 
+						"		bar(3);\n" + 
+						"		bar(4);\n" + 
+						"		bar(5);\n" + 
+						"	}\n" + 
+						"	public static void bar(int i) {\n" + 
+						"		switch (i) {\n" + 
+						"		case 1, 3: \n" + 
+						"			System.out.println(\"Odd\");\n" + 
+						"			break;\n" + 
+						"		case 2, 4: \n" + 
+						"			System.out.println(\"Even\");\n" + 
+						"			break;\n" + 
+						"		default:\n" + 
+						"			System.out.println(\"Out of range\");\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"}",
+		};
+		String expectedProblemLog =
+				"Odd\n" + 
+				"Even\n" + 
+				"Odd\n" + 
+				"Even\n" + 
+				"Out of range";
+		this.runConformTest(
+				testFiles,
+				expectedProblemLog,
+				options,
+				new String[] {"--enable-preview"});
+	}
+	/*
+	 * Switch multi-constant with mixed constant types, reported
+	 */
+	public void testBug543240_9() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"	}\n" + 
+						"	public static void bar(int i) {\n" + 
+						"		switch (i) {\n" + 
+						"		case 1, 3: \n" + 
+						"			System.out.println(\"Odd\");\n" + 
+						"			break;\n" + 
+						"		case \"2\": \n" + 
+						"			System.out.println(\"Even\");\n" + 
+						"			break;\n" + 
+						"		default:\n" + 
+						"				System.out.println(\"Out of range\");\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"}",
+		};
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 9)\n" + 
+				"	case \"2\": \n" + 
+				"	     ^^^\n" + 
+				"Type mismatch: cannot convert from String to int\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				options);
+	}
+	/*
+	 * Switch multi-constant without break statement, reported
+	 */
+	public void testBug543240_10() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.WARNING);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+				"	public static void main(String[] args) {\n" + 
+				"	}\n" + 
+				"	public static void bar(int i) {\n" + 
+				"		switch (i) {\n" + 
+				"		case 1, 3: \n" + 
+				"			System.out.println(\"Odd\");\n" + 
+				"		case 2, 4: \n" + 
+				"			System.out.println(\"Even\");\n" + 
+				"			break;\n" +
+				"		default:\n" + 
+				"				System.out.println(\"Out of range\");\n" + 
+				"		}\n" + 
+				"	}\n" + 
+				"}",
+		};
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. WARNING in X.java (at line 8)\n" + 
+				"	case 2, 4: \n" + 
+				"	^^^^^^^^^\n" + 
+				"Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				new String[] { "--enable-preview"},
+				options);
+	}
+	/*
+	 * Switch multi-constant without break statement, reported
+	 */
+	public void testBug543240_11() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		options.put(CompilerOptions.OPTION_ReportMissingDefaultCase, CompilerOptions.WARNING);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+				"	public static void main(String[] args) {\n" + 
+				"	}\n" + 
+				"	public static void bar(int i) {\n" + 
+				"		switch (i) {\n" + 
+				"		case 1, 3: \n" + 
+				"			System.out.println(\"Odd\");\n" + 
+				"		case 2, 4: \n" + 
+				"			System.out.println(\"Even\");\n" + 
+				"		}\n" + 
+				"	}\n" + 
+				"}",
+		};
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. WARNING in X.java (at line 5)\n" + 
+				"	switch (i) {\n" + 
+				"	        ^\n" + 
+				"The switch statement should have a default case\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				new String[] { "--enable-preview"},
+				options);
+	}
+	/*
+	 * Switch multi-constant with duplicate int constants
+	 */
+	public void testBug543240_12() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"	}\n" + 
+						"	public static void bar(int i) {\n" + 
+						"		switch (i) {\n" + 
+						"		case 1, 3: \n" + 
+						"			System.out.println(\"Odd\");\n" + 
+						"		case 3, 4: \n" + 
+						"			System.out.println(\"Odd\");\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"}",
+		};
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 8)\n" + 
+				"	case 3, 4: \n" + 
+				"	^^^^^^^^^\n" + 
+				"Duplicate case\n" + 
+				"----------\n" + 
+				"2. ERROR in X.java (at line 8)\n" + 
+				"	case 3, 4: \n" + 
+				"	^^^^^^^^^\n" + 
+				"Duplicate case\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				options);
+	}
+	/*
+	 * Switch multi-constant with duplicate String literals
+	 */
+	public void testBug543240_13() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"	}\n" + 
+						"	public static void bar(String s) {\n" + 
+						"		switch (s) {\n" + 
+						"		case \"a\", \"b\": \n" + 
+						"			System.out.println(\"Odd\");\n" + 
+						"		case \"b\", \"c\": \n" + 
+						"			System.out.println(\"Odd\");\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"}",
+		};
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 8)\n" + 
+				"	case \"b\", \"c\": \n" + 
+				"	^^^^^^^^^^^^^\n" + 
+				"Duplicate case\n" + 
+				"----------\n" + 
+				"2. ERROR in X.java (at line 8)\n" + 
+				"	case \"b\", \"c\": \n" + 
+				"	^^^^^^^^^^^^^\n" + 
+				"Duplicate case\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				options);
+	}
+	/*
+	 * Switch multi-constant with illegal qualified enum constant
+	 */
+	public void testBug543240_14() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"	}\n" + 
+						"	public static void bar(Num s) {\n" + 
+						"		switch (s) {\n" + 
+						"		case ONE, Num.TWO: \n" + 
+						"			System.out.println(\"Odd\");\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"}\n" +
+						"enum Num { ONE, TWO}\n",
+		};
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 6)\n" + 
+				"	case ONE, Num.TWO: \n" + 
+				"	          ^^^^^^^\n" + 
+				"The qualified case label Num.TWO must be replaced with the unqualified enum constant TWO\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				options);
+	}
+	public void testBug543240_15() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+				"	public void bar(int s) {\n" + 
+				"		int j = switch (s) {\n" + 
+				"			case 1, 2, 3 -> (s+1);\n" +
+				"			default -> j;\n" + 
+				"		};\n" + 
+				"	}\n" + 
+				"}\n",
+		};
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 5)\n" + 
+				"	default -> j;\n" + 
+				"	           ^\n" + 
+				"The local variable j may not have been initialized\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				options);
+	}
+	public void testBug543240_16() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+				"	public static void main(String[] args) {\n" + 
+				"	}\n" + 
+				"	public void bar(int s) {\n" +
+				"		int j = 0;" + 
+				"		j = switch (s) {\n" + 
+				"			case 1, 2, 3 -> (s+1);\n" +
+				"			default -> j;\n" + 
+				"		};\n" + 
+				"	}\n" + 
+				"}\n",
+		};
+		this.runNegativeTest(
+				testFiles,
+				"",
+				null,
+				true,
+				new String[] { "--enable-preview"},
+				options);
+	}
+	public void testBug543795_01() {
+		this.runNegativeTest(
+			new String[] {
+				"X.java",
+				"import java.io.IOException;\n" +
+				"\n" +
+				"public class X {\n" +
+				"	public static int foo(int i) throws IOException {\n" +
+				"		int t = switch (i) {\n" +
+				"		case 0 : {\n" +
+				"			break 0;\n" +
+				"		}\n" +
+				"		case 2 : {\n" +
+				"			break;\n" +
+				"		}\n" +
+				"		default : break 10;\n" +
+				"		};\n" +
+				"		return t;\n" +
+				"	}\n" +
+				"	\n" +
+				"	public boolean bar() {\n" +
+				"		return true;\n" +
+				"	}\n" +
+				"	public static void main(String[] args) {\n" +
+				"		try {\n" +
+				"			System.out.println(foo(3));\n" +
+				"		} catch (IOException e) {\n" +
+				"			// TODO Auto-generated catch block\n" +
+				"			e.printStackTrace();\n" +
+				"		}\n" +
+				"	}\n" +
+				"}\n",
+			},
+			"----------\n" + 
+			"1. ERROR in X.java (at line 10)\n" + 
+			"	break;\n" + 
+			"	^^^^^^\n" + 
+			"Break of a switch expression should have a value\n" + 
+			"----------\n");
+	}
+	public void testBug543691() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" + 
+				"	@SuppressWarnings(\"preview\")\n" + 
+				"	public static void bar(int  i) {\n" + 
+				"		i = switch (i+0) {\n" + 
+				"			default: System.out.println(0);\n" + 
+				"		}; " + 
+				"	}\n" + 
+				"}",
+		};
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 4)\n" + 
+				"	i = switch (i+0) {\n" + 
+				"			default: System.out.println(0);\n" + 
+				"		}; 	}\n" + 
+				"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+				"A switch expression should have at least one result expression\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				options);
+	}
+	public void testBug543799_1() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+			"X.java",
+			"public class X {\n" +
+			"	void test(int i) {\n" + 
+			"		need(switch (i) {\n" + 
+			"			case 1 -> \"\";\n" + 
+			"			default -> i == 3 ? null : \"\";\n" + 
+			"		}); \n" + 
+			"	}\n" + 
+			"	void need(String s) {\n" + 
+			"		System.out.println(s.toLowerCase());\n" + 
+			"	}\n" + 
+			"	public static void main(String[] args) {\n" + 
+			"		new X().need(\"Hello World\");\n" + 
+			"	}\n" + 
+			"}\n"
+		};
+		String expectedOutput = "hello world";
+		runConformTest(testFiles, expectedOutput, options);
+	}
+	public void testBug543799_2() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+			"X.java",
+			"public class X {\n" +
+			"	void test(int i) {\n" + 
+			"		need(switch (i) {\n" + 
+			"			case 1: break \"\";\n" + 
+			"			default: break i == 3 ? null : \"\";\n" + 
+			"		}); \n" + 
+			"	}\n" + 
+			"	void need(String s) {\n" + 
+			"		System.out.println(s.toLowerCase());\n" + 
+			"	}\n" +
+			"	public static void main(String[] args) {\n" + 
+			"		new X().need(\"Hello World\");\n" + 
+			"	}\n" + 
+			"}\n"
+		};
+		String expectedOutput = "hello world";
+		runConformTest(testFiles, expectedOutput, options);
+	}
+	public void testBug543799_3() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+			"X.java",
+			"interface I0 { void i(); }\n" + 
+			"interface I1 extends I0 {}\n" + 
+			"interface I2 extends I0 {}\n" +
+			"public class X {\n" +
+			"	I1 n1() { return null; }\n" + 
+			"	<I extends I2> I n2() { return null; }\n" + 
+			"	<M> M m(M m) { return m; }\n" + 
+			"	void test(int i, boolean b) {\n" + 
+			"		m(switch (i) {\n" + 
+			"			case 1 -> n1();\n" + 
+			"			default -> b ? n1() : n2();\n" + 
+			"		}).i(); \n" + 
+			"	}\n" + 
+			"	public static void main(String[] args) {\n" + 
+			"		try {\n" +
+			"			new X().test(1, true);\n" +
+			"		} catch (NullPointerException e) {\n" +
+			"			System.out.println(\"NPE as expected\");\n" +
+			"		}\n" +
+			"	}\n" + 
+			"}\n"
+		};
+		String expectedOutput = "NPE as expected";
+		runConformTest(testFiles, expectedOutput, options);
+	}
+	public void testBug543799_4() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+			"X.java",
+			"import java.util.function.Supplier;\n" +
+			"interface I0 { void i(); }\n" + 
+			"interface I1 extends I0 {}\n" + 
+			"interface I2 extends I0 {}\n" +
+			"public class X {\n" +
+			"	I1 n1() { return null; }\n" + 
+			"	<I extends I2> I n2() { return null; }\n" + 
+			"	<M> M m(Supplier<M> m) { return m.get(); }\n" + 
+			"	void test(int i, boolean b) {\n" + 
+			"		m(switch (i) {\n" + 
+			"			case 1 -> this::n1;\n" + 
+			"			default -> this::n2;\n" + 
+			"		}).i(); \n" + 
+			"	}\n" + 
+			"	public static void main(String[] args) {\n" + 
+			"		try {\n" +
+			"			new X().test(1, true);\n" +
+			"		} catch (NullPointerException e) {\n" +
+			"			System.out.println(\"NPE as expected\");\n" +
+			"		}\n" +
+			"	}\n" + 
+			"}\n"
+		};
+		String expectedOutput = "NPE as expected";
+		runConformTest(testFiles, expectedOutput, options);
+	}
+	public void testBug543799_5() {
+		// require resolving/inferring of poly-switch-expression during ASTNode.resolvePolyExpressionArguments()
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+			"X.java",
+			"public class X {\n" +
+			"		void test(int i) {\n" + 
+			"		need(switch (i) {\n" + 
+			"			case 1 -> 1.0f;\n" + 
+			"			default -> i == 3 ? 3 : 5.0d;\n" + 
+			"		}); \n" + 
+			"	}\n" + 
+			"	<N extends Number> void need(N s) {\n" + 
+			"		System.out.println(s.toString());\n" + 
+			"	}\n" + 
+			"	public static void main(String[] args) {\n" + 
+			"		new X().need(3);\n" +
+			"	}\n" + 
+			"}\n"
+		};
+		String expectedOutput = "3";
+		runConformTest(testFiles, expectedOutput, options);
+	}
+	public void testSwitchStatementWithBreakExpression() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	static int twice(int i) throws Exception {\n" + 
+					"		switch (i) {\n" + 
+					"			case 0 -> System.out.println(\"hellow\");\n" + 
+					"			case 1 -> foo();\n" + 
+					"			default -> throw new Exception();\n" + 
+					"		};\n" + 
+					"		return 0;\n" + 
+					"	}\n" + 
+					"\n" + 
+					"	static int foo() {\n" + 
+					"		System.out.println(\"inside foo\");\n" + 
+					"		return 1;\n" + 
+					"	}\n" + 
+					"\n" + 
+					"	public static void main(String[] args) {\n" + 
+					"		try {\n" + 
+					"			System.out.print(twice(1));\n" + 
+					"		} catch (Exception e) {\n" + 
+					"			System.out.print(\"Got Exception\");\n" + 
+					"		}\n" + 
+					"	}\n" + 
+					"}"
+			},
+			"inside foo\n"
+			+ "0",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testSwitchStatementWithEnumValues() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"enum SomeDays {\n" + 
+					"	Mon, Wed, Fri\n" + 
+					"}\n" + 
+					"\n" + 
+					"public class X {\n" + 
+					"	int testEnum(boolean b) {\n" + 
+					"		SomeDays day = b ? SomeDays.Mon : null;\n" + 
+					"		return switch(day) {\n" + 
+					"			case Mon -> 1;\n" + 
+					"			case Wed -> 2;\n" + 
+					"			case Fri -> 3;\n" + 
+					"		};\n" + 
+					"	}\n" + 
+					"\n" + 
+					"	public static void main(String[] args) {\n" + 
+					"		System.out.println(new X().testEnum(true));\n" + 
+					"	}\n" + 
+					"}\n" + 
+					""
+			},
+			"1",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug543967_01() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+				"	static int foo(int i) {\n" +
+				"		switch (i) {\n" +
+				"			default -> 3; // should flag an error\n" +
+				"			\n" +
+				"		};\n" +
+				"		return 0;\n" +
+				"	}\n" +
+				"	public static void main(String[] args) {\n" +
+				"		foo(1);\n" +
+				"	}\n" +
+				"}\n",
+		};
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 4)\n" + 
+				"	default -> 3; // should flag an error\n" + 
+				"	           ^\n" + 
+				"Invalid expression as statement\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				new String[] { "--enable-preview"},
+				options);
+	}
+	public void testBug544204() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	public void foo(int i) {\n" + 
+					"		int j = switch (i) {\n" + 
+					"			case 1 -> i;\n" + 
+					"			default -> i;\n" + 
+					"		};\n" + 
+					"		System.out.println(j);\n" + 
+					"	}\n" + 
+					"	\n" + 
+					"	public static void main(String[] args) {\n" + 
+					"		new X().foo(1);\n" + 
+					"	}\n" + 
+					"}"
+			},
+			"1",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544204_2() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	public void foo(int i) {\n" + 
+					"		long j = switch (i) {\n" + 
+					"			case 1 -> 10L;\n" + 
+					"			default -> 20L;\n" + 
+					"		};\n" + 
+					"		System.out.println(j);\n" + 
+					"	}\n" + 
+					"	\n" + 
+					"	public static void main(String[] args) {\n" + 
+					"		new X().foo(1);\n" + 
+					"	}\n" + 
+					"}"
+			},
+			"10",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544223() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	public int foo(String s) throws Exception {\n" + 
+					"		int i = switch (s) {\n" + 
+					"			case \"hello\" -> 1;\n" + 
+					"			default -> throw new Exception();\n" + 
+					"		};\n" + 
+					"		return i;\n" + 
+					"	}\n" + 
+					"\n" + 
+					"	public static void main(String[] argv) {\n" + 
+					"		try {\n" + 
+					"			System.out.print(new X().foo(\"hello\"));\n" + 
+					"		} catch (Exception e) {\n" + 
+					"			//\n" + 
+					"		}\n" + 
+					"	}\n" + 
+					"}"
+			},
+			"1",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544258_01() {
+		this.runNegativeTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" +
+				"    public void foo(Day day) {\n" +
+				"    	var today = 1;\n" +
+				"    	today =  switch (day) {\n" +
+				"    		      case SATURDAY,SUNDAY :\n" +
+				"    		         today=1;\n" +
+				"    		         break today;\n" +
+				"    		      case MONDAY,TUESDAY,WEDNESDAY,THURSDAY :\n" +
+				"    			 today=2;\n" +
+				"    			 break today;\n" +
+				"    		};\n" +
+				"    }\n" +
+				"    public static void main(String argv[]) {\n" +
+				"    	new X().foo(Day.FRIDAY);\n" +
+				"    }\n" +
+				"}\n" +
+				"\n" +
+				"enum Day {\n" +
+				"	SUNDAY,\n" +
+				"	MONDAY,\n" +
+				"	TUESDAY,\n" +
+				"	WEDNESDAY,\n" +
+				"	THURSDAY,\n" +
+				"	FRIDAY,\n" +
+				"	SATURDAY\n" +
+				"}\n",
+			},
+			"----------\n" + 
+			"1. ERROR in X.java (at line 4)\n" + 
+			"	today =  switch (day) {\n" + 
+			"	                 ^^^\n" + 
+			"A Switch expression should cover all possible values\n" + 
+			"----------\n");
+	}
+	public void testBug544253() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"    public void foo(int i ) {\n" + 
+					"        boolean b = switch (i) {\n" + 
+					"            case 0 -> i == 1;\n" + 
+					"            default -> true;\n" + 
+					"        };\n" + 
+					"        System.out.println( b ? \" true\" : \"false\");\n" + 
+					"    }\n" + 
+					"    public static void main(String[] argv) {\n" + 
+					"    	new X().foo(0);\n" + 
+					"    }\n" + 
+					"}"
+			},
+			"false",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544254() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"    public void foo(String s) {\n" + 
+					"        try {\n" + 
+					"            int i = switch (s) {\n" + 
+					"                case \"hello\" -> 0;\n" + 
+					"                default -> 2;\n" + 
+					"            };\n" + 
+					"        } finally {\n" + 
+					"        	System.out.println(s);\n" + 
+					"        }\n" + 
+					"    }\n" + 
+					"    public static void main(String argv[]) {\n" + 
+					"    	new X().foo(\"hello\");\n" + 
+					"    }\n" + 
+					"}"
+			},
+			"hello",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544254_2() {
+		Map<String, String> customOptions = getCompilerOptions();
+		customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"    public void foo(String s) {\n" + 
+					"        try {\n" + 
+					"            int i = switch (s) {\n" + 
+					"                case \"hello\" -> 0;\n" + 
+					"                default -> 2;\n" + 
+					"            };\n" + 
+					"        } finally {\n" + 
+					"        	System.out.println(s);\n" + 
+					"        }\n" + 
+					"    }\n" + 
+					"    public static void main(String argv[]) {\n" + 
+					"    	new X().foo(\"hello\");\n" + 
+					"    }\n" + 
+					"}"
+			},
+			"hello",
+			customOptions,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544254_3() {
+		Map<String, String> customOptions = getCompilerOptions();
+		customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"    public void foo(String s) {\n" + 
+					"        try {\n" + 
+					"            long l = switch (s) {\n" + 
+					"                case \"hello\" -> 0;\n" + 
+					"                default -> 2;\n" + 
+					"            };\n" + 
+					"        } finally {\n" + 
+					"        	System.out.println(s);\n" + 
+					"        }\n" + 
+					"    }\n" + 
+					"    public static void main(String argv[]) {\n" + 
+					"    	new X().foo(\"hello\");\n" + 
+					"    }\n" + 
+					"}"
+			},
+			"hello",
+			customOptions,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544224_1() {
+		Map<String, String> customOptions = getCompilerOptions();
+		customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" +
+					"    public int foo(int i)  {\n" +
+					"        int j = (switch (i) {\n" +
+					"            case 1 -> 1;\n" +
+					"            default -> 2;\n" +
+					"        });\n" +
+					"        return j;\n" +
+					"    }\n" +
+					"    public static void main(String[] argv) {\n" +
+					"    	new X().foo(1);\n" +
+					"    }\n" +
+					"}\n"
+			},
+			"",
+			customOptions,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544298() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	enum MyEnum {\n" + 
+					"		FIRST;\n" + 
+					"	}\n" + 
+					"\n" + 
+					"	public void foo(MyEnum myEnum) {\n" + 
+					"		int i = switch (myEnum) {\n" + 
+					"			case FIRST ->  1;\n" + 
+					"		};\n" + 
+					"			System.out.println( \"i:\" + i);\n" + 
+					"	}\n" + 
+					"\n" + 
+					"	public static void main(String argv[]) {\n" + 
+					"		new X().foo(MyEnum.FIRST);\n" + 
+					"	}\n" + 
+					"}"
+			},
+			"i:1",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544298_2() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	enum MyEnum {\n" + 
+					"		FIRST;\n" + 
+					"	}\n" + 
+					"\n" + 
+					"	public void foo(MyEnum myEnum) {\n" + 
+					"		int i = switch (myEnum) {\n" + 
+					"			case FIRST ->  1;\n" + 
+					"			default ->  0;\n" + 
+					"		};\n" + 
+					"			System.out.println( \"i:\" + i);\n" + 
+					"	}\n" + 
+					"\n" + 
+					"	public static void main(String argv[]) {\n" + 
+					"		new X().foo(MyEnum.FIRST);\n" + 
+					"	}\n" + 
+					"}"
+			},
+			"i:1",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544428_01() {
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String[] testFiles = new String[] {
+				"X.java",
+				"public class X {\n" +
+				"    public int foo(int i) {\n" +
+				"    	var v = switch(i) {\n" +
+				"    	case 0 -> x;\n" +
+				"    	default -> 1;\n" +
+				"    	};\n" +
+				"    	return v;\n" +
+				"    }\n" +
+				"    public static void main(String[] argv) {\n" +
+				"       System.out.println(new X().foo(0));\n" +
+				"    }\n" +
+				"}",
+		};
+		String expectedProblemLog =
+				"----------\n" + 
+				"1. ERROR in X.java (at line 4)\n" + 
+				"	case 0 -> x;\n" + 
+				"	          ^\n" + 
+				"x cannot be resolved to a variable\n" + 
+				"----------\n";
+		this.runNegativeTest(
+				testFiles,
+				expectedProblemLog,
+				null,
+				true,
+				new String[] { "--enable-preview"},
+				options);
+	}
+	public void testBug544523_01() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" +
+					"    @SuppressWarnings(\"preview\")\n" +
+					"	public int foo(int i) {\n" +
+					"    	int v = switch(i) {\n" +
+					"    	case 0 -> switch(i) {\n" +
+					"    			case 0 -> 0;\n" +
+					"    			default -> 1;\n" +
+					"    		};\n" +
+					"    	default -> 1;\n" +
+					"    	};\n" +
+					"    	return v;\n" +
+					"    }\n" +
+					"    public static void main(String[] argv) {\n" +
+					"       System.out.println(new X().foo(0));\n" +
+					"    }\n" +
+					"}"
+			},
+			"0",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544560_01() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" +
+					"    public int foo(int i) {\n" +
+					"    	@SuppressWarnings(\"preview\")\n" +
+					"    	int v = switch(switch(i) {\n" +
+					"        		default -> 1;\n" +
+					"        		}) {\n" +
+					"        	default -> 1;\n" +
+					"        };\n" +
+					"       return v;\n" +
+					"    }\n" +
+					"\n" +
+					"    public static void main(String[] argv) {\n" +
+					"       System.out.println(new X().foo(0));\n" +
+					"    }\n" +
+					"}\n"
+			},
+			"1",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544458() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	public static int foo(int i) {\n" + 
+					"		boolean v = switch (i) {\n" + 
+					"			case 1: i = 10; break true;\n" + 
+					"			default: break false;\n" + 
+					"		};\n" + 
+					"		return v ? 0 : 1;\n" + 
+					"	}\n" + 
+					"	public static void main(String[] argv) {\n" + 
+					"		System.out.println(X.foo(0));\n" + 
+					"	}\n" + 
+					"}"
+			},
+			"1",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544458_2() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	public static int foo(int i) {\n" + 
+					"		boolean v = switch (i) {\n" + 
+					"			case 1: i++; break true;\n" + 
+					"			default: break false;\n" + 
+					"		};\n" + 
+					"		return v ? 0 : 1;\n" + 
+					"	}\n" + 
+					"	public static void main(String[] argv) {\n" + 
+					"		System.out.println(X.foo(1));\n" + 
+					"	}\n" + 
+					"}"
+			},
+			"0",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544458_3() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	public static int foo(int i) {\n" + 
+					"		boolean v = switch (i) {\n" + 
+					"			case 1: i+= 10; break true;\n" + 
+					"			default: break false;\n" + 
+					"		};\n" + 
+					"		return v ? 0 : 1;\n" + 
+					"	}\n" + 
+					"	public static void main(String[] argv) {\n" + 
+					"		System.out.println(X.foo(1));\n" + 
+					"	}\n" + 
+					"}"
+			},
+			"0",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544458_4() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	public static int foo(int i) {\n" + 
+					"		boolean v = switch (i) {\n" + 
+					"			case 1: switch(i) {case 4: break;}; break true;\n" + 
+					"			default: break false;\n" + 
+					"		};\n" + 
+					"		return v ? 0 : 1;\n" + 
+					"	}\n" + 
+					"	public static void main(String[] argv) {\n" + 
+					"		System.out.println(X.foo(1));\n" + 
+					"	}\n" + 
+					"}"
+			},
+			"0",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544458_5() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"	public static int foo(int i) {\n" + 
+					"		boolean v = switch (i) {\n" + 
+					"			case 1: foo(5); break true;\n" + 
+					"			default: break false;\n" + 
+					"		};\n" + 
+					"		return v ? 0 : 1;\n" + 
+					"	}\n" + 
+					"	public static void main(String[] argv) {\n" + 
+					"		System.out.println(X.foo(1));\n" + 
+					"	}\n" + 
+					"}"
+			},
+			"0",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544601_1() {
+		runConformTest(
+			new String[] {
+					"X.java",
+					"public class X {\n" +
+					"    public int foo(int i) {\n" +
+					"    @SuppressWarnings(\"preview\")\n" +
+					"	boolean v = switch (i) {\n" +
+					"        case 1:\n" +
+					"        	switch (i) {\n" +
+					"        		case 1 : i = 10;\n" +
+					"        			break;\n" +
+					"        		default :\n" +
+					"        			i = 2;\n" +
+					"        			break;\n" +
+					"        		}\n" +
+					"        break true;\n" +
+					"        default: break false;\n" +
+					"    };\n" +
+					"    return v ? 0 : 1;\n" +
+					"    }\n" +
+					"\n" +
+					"    public static void main(String[] argv) {\n" +
+					"       System.out.println(new X().foo(0));\n" +
+					"    }\n" +
+					"}\n"
+			},
+			"1",
+			null,
+			new String[] {"--enable-preview"});
+	}
+	public void testBug544556() {
+		runConformTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" + 
+				"	public int foo(int i) {\n" + 
+				"		@SuppressWarnings(\"preview\")\n" + 
+				"		int v =\n" + 
+				"			switch(switch(i) {\n" + 
+				"					case 0 -> { break 2; }\n" + 
+				"					default -> { break 3; }\n" + 
+				"				}) {\n" + 
+				"			case 0 -> { break 0; }\n" + 
+				"			default -> { break 1; }\n" + 
+				"		};\n" + 
+				"	return v == 1 ? v : 0;\n" + 
+				"	}\n" + 
+				"	public static void main(String[] argv) {\n" + 
+				"		System.out.println(new X().foo(0));\n" + 
+				"	}\n" + 
+				"}"
+		},
+		"1",
+		null,
+		new String[] {"--enable-preview"});
+	}
+	public void testBug544702_01() {
+		runConformTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" +
+				"    @SuppressWarnings(\"preview\")\n" +
+				"	public int foo(int i) {\n" +
+				"    	int k = 10;\n" +
+				"    	switch (i) {\n" +
+				"    		case 0 -> { k = 0;}\n" +
+				"    		default -> k = -1;\n" +
+				"    	}\n" +
+				"        return k;\n" +
+				"    }\n" +
+				"    public static void main(String[] argv) {\n" +
+				"        System.out.println(new X().foo(0) == 0 ? \"Success\" : \"Failure\");\n" +
+				"    }\n" +
+				"\n" +
+				"}\n"
+		},
+		"Success",
+		null,
+		new String[] {"--enable-preview"});
+	}
+	public void testBug545168_01() {
+		runConformTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" +
+				"	@SuppressWarnings(\"preview\")\n" +
+				"	public static void foo(Day day) {\n" +
+				"		switch (day) {\n" +
+				"		case MONDAY, FRIDAY -> System.out.println(Day.SUNDAY);\n" +
+				"		case TUESDAY                -> System.out.println(7);\n" +
+				"		case THURSDAY, SATURDAY     -> System.out.println(8);\n" +
+				"		case WEDNESDAY              -> System.out.println(9);\n" +
+				"		default -> {}\n" +
+				"		}     \n" +
+				"	}\n" +
+				"	public static void main(String[] args) {\n" +
+				"		X.foo(Day.WEDNESDAY);\n" +
+				"	}\n" +
+				"}\n" +
+				"\n" +
+				"enum Day {\n" +
+				"	MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" +
+				"}\n"
+		},
+		"9",
+		null,
+		new String[] {"--enable-preview"});
+	}
+	public void testBug545255_01() {
+		runConformTest(
+			new String[] {
+				"X.java",
+				"public class X {\n"+
+				"	public static void foo (int i) {\n"+
+				"		int v = switch (i) {\n"+
+				"			case 60, 600: break 6;\n"+
+				"			case 70: break 7;\n"+
+				"			case 80: break 8;\n"+
+				"			case 90, 900: break 9;\n"+
+				"			default: break 0;\n"+
+				"		};\n"+
+				"		System.out.println(v);\n"+
+				"	}\n"+
+				"	public static void main(String[] args) {\n"+
+				"		X.foo(10);\n"+
+				"	}\n"+
+				"}\n"
+		},
+		"0",
+		null,
+		new String[] {"--enable-preview"});
+	}
+	// see comment 12 in the bug 
+	public void testBug513766_01() {
+		this.runNegativeTest(
+			new String[] {
+				"X.java",
+				"public class X {\n"+
+				"    @SuppressWarnings(\"preview\")\n"+
+				"    public void foo(int i) {\n"+
+				"    	if (switch(i) { default -> magic(); })\n"+
+				"            System.out.println(\"true\");\n"+
+				"        if (magic())\n"+
+				"            System.out.println(\"true, too\");\n"+
+				"    }\n"+
+				"    <T> T magic() { return null; }\n"+
+				"}\n",
+			},
+			"----------\n" + 
+			"1. ERROR in X.java (at line 4)\n" + 
+			"	if (switch(i) { default -> magic(); })\n" + 
+			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+			"Type mismatch: cannot convert from Object to boolean\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 6)\n" + 
+			"	if (magic())\n" + 
+			"	    ^^^^^^^\n" + 
+			"Type mismatch: cannot convert from Object to boolean\n" + 
+			"----------\n");
+	}
+	public void testBug545333() {
+		runNegativeTest(
+			new String[] {
+				"X.java",
+				"public class X {\n"+
+				"    @SuppressWarnings(\"preview\")\n"+
+				"	public static int foo(int i) throws MyException {\n"+
+				"    	int v = switch (i) {\n"+
+				"    		default -> throw new MyException();\n"+
+				"    	};\n"+
+				"        return v;\n"+
+				"    }\n"+
+				"    public static void main(String argv[]) {\n"+
+				"    	try {\n"+
+				"			System.out.println(X.foo(1));\n"+
+				"		} catch (MyException e) {\n"+
+				"			System.out.println(\"Exception thrown as expected\");\n"+
+				"		}\n"+
+				"	}\n"+
+				"}\n"+
+				"class MyException extends Exception {\n"+
+				"	private static final long serialVersionUID = 3461899582505930473L;	\n"+
+				"}\n"
+			},
+			"----------\n" + 
+			"1. ERROR in X.java (at line 4)\n" + 
+			"	int v = switch (i) {\n" + 
+			"    		default -> throw new MyException();\n" + 
+			"    	};\n" + 
+			"	        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+			"A switch expression should have at least one result expression\n" + 
+			"----------\n");
+	}
+	public void testBug545518() {
+		if (this.complianceLevel < ClassFileConstants.JDK12)
+			return;
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
+		String message = 
+				"----------\n" + 
+				"1. WARNING in X.java (at line 5)\n" + 
+				"	case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" + 
+				"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+				"You are using a preview language feature that may or may not be supported in a future release\n" + 
+				"----------\n" + 
+				"2. WARNING in X.java (at line 5)\n" + 
+				"	case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" + 
+				"	                     ^^^^^^^^^^^^\n" + 
+				"Dead code\n" + 
+				"----------\n";
+		
+		this.runNegativeTest(new String[] {
+				"X.java",
+				"public class X {\n" +
+				"  public static void main(String [] args) {\n" +
+				"  	 String arg = \"ABD\";\n" +
+				"    switch(arg) {\n" + 
+				"      case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
+				"	 }\n" +
+				"  }\n" +
+				"}\n"
+			},
+			message,
+			null,
+			true,
+			new String[] { "--enable-preview"},
+			options);
+	}
+	public void testBug545518a() {
+		if (this.complianceLevel < ClassFileConstants.JDK12)
+			return;
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		String message = 
+				"----------\n" + 
+				"1. WARNING in X.java (at line 5)\n" + 
+				"	case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" + 
+				"	                     ^^^^^^^^^^^^\n" + 
+				"Dead code\n" + 
+				"----------\n";
+		
+		this.runNegativeTest(new String[] {
+				"X.java",
+				"public class X {\n" +
+				"  public static void main(String [] args) {\n" +
+				"  	 String arg = \"ABD\";\n" +
+				"    switch(arg) {\n" + 
+				"      case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
+				"	 }\n" +
+				"  }\n" +
+				"}\n"
+			},
+			message,
+			null,
+			true,
+			new String[] { "--enable-preview"},
+			options);
+	}
+	public void testBug545518b() {
+		if (this.complianceLevel < ClassFileConstants.JDK1_8)
+			return;
+		Map<String, String> options = getCompilerOptions();
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.DISABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
+		String message = 
+				"----------\n" + 
+				"1. ERROR in X.java (at line 5)\n" + 
+				"	case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" + 
+				"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+				"Multi constant case is a preview feature and disabled by default. Use --enable-preview to enable\n" + 
+				"----------\n";
+		
+		this.runNegativeTest(new String[] {
+				"X.java",
+				"public class X {\n" +
+				"  public static void main(String [] args) {\n" +
+				"  	 String arg = \"ABD\";\n" +
+				"    switch(arg) {\n" + 
+				"      case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
+				"	 }\n" +
+				"  }\n" +
+				"}\n"
+			},
+			message,
+			null,
+			true,
+			new String[] { "--enable-preview"},
+			options);
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
index cc7fc5f..004768e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
@@ -3106,6 +3106,30 @@
 			"}\n"
 		});
 }
+public void testBug545518() {
+	if (this.complianceLevel < ClassFileConstants.JDK1_8 || this.complianceLevel >= ClassFileConstants.JDK12)
+		return;
+	String message = 
+			"----------\n" + 
+			"1. ERROR in X.java (at line 5)\n" + 
+			"	case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" + 
+			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+			"The preview feature Multi constant case is only available with source level 12 and above\n" + 
+			"----------\n";
+	
+	this.runNegativeTest(new String[] {
+			"X.java",
+			"public class X {\n" +
+			"  public static void main(String [] args) {\n" +
+			"  	 String arg = \"ABD\";\n" +
+			"    switch(arg) {\n" + 
+			"      case \"ABC\", (false ? (String) \"c\" : (String) \"d\") : break;\n" +
+			"	 }\n" +
+			"  }\n" +
+			"}\n"
+		},
+		message);
+}
 public static Class testClass() {
 	return SwitchTest.class;
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
index f828948..644b96e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -177,12 +177,18 @@
 	// add 10 specific test here (check duplicates)
 	ArrayList since_10 = new ArrayList();
 	since_10.add(JEP286Test.class);
+	since_10.add(Unicode10Test.class);
 	
 	// add 11 specific test here (check duplicates)
 	ArrayList since_11 = new ArrayList();
 	 since_11.add(JEP323VarLambdaParamsTest.class);
 	 since_11.add(JEP181NestTest.class);
 
+	// add 12 specific test here (check duplicates)
+	 ArrayList since_12 = new ArrayList();
+	 since_12.add(SwitchExpressionTest.class);
+	 since_12.add(Unicode11Test.class);
+
 	// Build final test suite
 	TestSuite all = new TestSuite(TestAll.class.getName());
 	all.addTest(new TestSuite(StandAloneASTParserTest.class));
@@ -280,6 +286,20 @@
 		TestCase.resetForgottenFilters(tests_11);
 		all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11), tests_11));
 	}
+	if ((possibleComplianceLevels & AbstractCompilerTest.F_12) != 0) {
+		ArrayList tests_12 = (ArrayList)standardTests.clone();
+		tests_12.addAll(since_1_4);
+		tests_12.addAll(since_1_5);
+		tests_12.addAll(since_1_6);
+		tests_12.addAll(since_1_7);
+		tests_12.addAll(since_1_8);
+		tests_12.addAll(since_9);
+		tests_12.addAll(since_10);
+		tests_12.addAll(since_11);
+		tests_12.addAll(since_12);
+		TestCase.resetForgottenFilters(tests_12);
+		all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_12), tests_12));
+	}
 	all.addTest(new TestSuite(Jsr14Test.class));
 	return all;
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode11Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode11Test.java
new file mode 100644
index 0000000..99940b1
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode11Test.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2019 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.compiler.regression;
+
+import java.util.Map;
+
+import junit.framework.Test;
+
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+
+public class Unicode11Test extends AbstractRegressionTest {
+public Unicode11Test(String name) {
+	super(name);
+}
+public static Test suite() {
+	return buildMinimalComplianceTestSuite(testClass(), F_12);
+}
+public void test1() {
+	Map<String, String> options = getCompilerOptions();
+	options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" + 
+			"		public int a\u0560; // new unicode character in unicode 11.0 \n" + 
+			"}",
+		},
+		"",
+		options);
+}
+public void test2() {
+	Map<String, String> options = getCompilerOptions();
+	options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11);
+	this.runNegativeTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" + 
+			"		public int a\\u0560; // new unicode character in unicode 11.0 \n" + 
+			"}",
+		},
+		"----------\n" + 
+		"1. ERROR in X.java (at line 2)\n" + 
+		"	public int a\\u0560; // new unicode character in unicode 11.0 \n" + 
+		"	            ^^^^^^\n" + 
+		"Syntax error on token \"Invalid Character\", delete this token\n" + 
+		"----------\n",
+		null,
+		true,
+		options);
+}
+public static Class<Unicode11Test> testClass() {
+	return Unicode11Test.class;
+}
+}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java
index d0e2f28..6e7d315 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -50,7 +50,11 @@
 	public static Class testClass() {
 		return VarargsTest.class;
 	}
-
+	protected String intersection(String... types) {
+		if (this.complianceLevel >= ClassFileConstants.JDK1_8)
+			return String.join(" & ", types);
+		return String.join("&", types);
+	}
 	public void test001() {
 		this.runConformTest(
 			new String[] {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java
index caca176..170bb63 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2018 IBM Corporation and others.
+ * Copyright (c) 2010, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -32,6 +32,7 @@
 import org.eclipse.jdt.core.dom.ASTNode;
 import org.eclipse.jdt.core.dom.ASTParser;
 import org.eclipse.jdt.core.dom.Block;
+import org.eclipse.jdt.core.dom.BreakStatement;
 import org.eclipse.jdt.core.dom.CompilationUnit;
 import org.eclipse.jdt.core.dom.Expression;
 import org.eclipse.jdt.core.dom.ExpressionStatement;
@@ -49,11 +50,13 @@
 import org.eclipse.jdt.core.dom.NodeFinder;
 import org.eclipse.jdt.core.dom.SimpleName;
 import org.eclipse.jdt.core.dom.SimpleType;
+import org.eclipse.jdt.core.dom.SwitchExpression;
 import org.eclipse.jdt.core.dom.Type;
 import org.eclipse.jdt.core.dom.TypeDeclaration;
 import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
 import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
 import org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest;
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
 
 @SuppressWarnings({ "rawtypes" })
 public class StandAloneASTParserTest extends AbstractRegressionTest {
@@ -61,7 +64,7 @@
 		super(name);
 	}
 	
-	private static final int AST_JLS_LATEST = AST.JLS11;
+	private static final int AST_JLS_LATEST = AST.JLS12;
 
 	public ASTNode runConversion(
 			int astLevel,
@@ -1755,5 +1758,41 @@
 			SimpleName simpleName = (SimpleName) name;
 			assertFalse("A var", simpleName.isVar());
 	}
+	public void testBug545383_01() throws JavaModelException {
+		String contents =
+				"class X {\n"+
+				"	public static int foo(int i) {\n"+
+				"		int result = switch (i) {\n"+
+				"		case 1 -> {break 5;}\n"+
+				"		default -> 0;\n"+
+				"		};\n"+
+				"		return result;\n"+
+				"	}\n"+
+				"}\n";
+
+		ASTParser parser = ASTParser.newParser(AST_JLS_LATEST);
+		parser.setSource(contents.toCharArray());
+		parser.setEnvironment(null, null, null, true);
+		parser.setResolveBindings(false);
+		Map<String, String> options = getCompilerOptions();
+		options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_12);
+		options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_12);
+		options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_12);
+		options.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
+		options.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
+		parser.setCompilerOptions(options);
 	
+		ASTNode node = parser.createAST(null);
+		assertTrue("Should be a compilation unit", node instanceof CompilationUnit);
+		CompilationUnit cu = (CompilationUnit) node;
+		TypeDeclaration typeDeclaration = (TypeDeclaration) cu.types().get(0);
+		MethodDeclaration[] methods = typeDeclaration.getMethods();
+		MethodDeclaration methodDeclaration = methods[0];
+		VariableDeclarationStatement stmt = (VariableDeclarationStatement) methodDeclaration.getBody().statements().get(0);
+		VariableDeclarationFragment fragment = (VariableDeclarationFragment) stmt.fragments().get(0);
+		SwitchExpression se = (SwitchExpression) fragment.getInitializer();
+		BreakStatement breakStatement = (BreakStatement) ((Block)se.statements().get(1)).statements().get(0);
+		assertNull("Unexpected Non null label", breakStatement.getLabel());
+		assertNotNull("Expression null", breakStatement.getExpression());
+	}	
 }
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
index fee9aac..ace9a6a 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -43,6 +43,7 @@
 	public static final int F_9   = 0x40;
 	public static final int F_10  = 0x80;
 	public static final int F_11  = 0x100;
+	public static final int F_12  = 0x200;
 
 	public static final boolean RUN_JAVAC = CompilerOptions.ENABLED.equals(System.getProperty("run.javac"));
 	private static final int UNINITIALIZED = -1;
@@ -98,6 +99,9 @@
 		if ((complianceLevels & AbstractCompilerTest.F_11) != 0) {
 			suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11)));
 		}
+		if ((complianceLevels & AbstractCompilerTest.F_12) != 0) {
+			suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_12)));
+		}
 	}
 
 	/**
@@ -140,6 +144,9 @@
 		if ((complianceLevels & AbstractCompilerTest.F_11) != 0) {
 			suite.addTest(buildComplianceTestSuite(testClasses, setupClass, ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11)));
 		}
+		if ((complianceLevels & AbstractCompilerTest.F_12) != 0) {
+			suite.addTest(buildComplianceTestSuite(testClasses, setupClass, ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_12)));
+		}
 		return suite;
 	}
 
@@ -148,7 +155,7 @@
          int lessthan9 = F_1_3 | F_1_4 | F_1_5 | F_1_6 | F_1_7 | F_1_8;
          isJRE9Plus = !isJRELevel(lessthan9);
          isJRE11Plus = isJRELevel(F_11);
-         isJRE12Plus = "12".equals(System.getProperty("java.specification.version"));
+         isJRE12Plus = isJRELevel(F_12);
 	 }
 
 	/**
@@ -291,6 +298,14 @@
 				suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11)));
 			}
 		}
+		int level12 = complianceLevels & AbstractCompilerTest.F_12;
+		if (level12 != 0) {
+			if (level12 < minimalCompliance) {
+				System.err.println("Cannot run "+evaluationTestClass.getName()+" at compliance 12!");
+			} else {
+				suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_12)));
+			}
+		}
 		return suite;
 	}
 
@@ -324,7 +339,7 @@
 			else if (highestLevel == ClassFileConstants.JDK1_3)
 				complianceString = "1.3";
 			else {
-				highestLevel = ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11);
+				highestLevel = ClassFileConstants.getLatestJDKLevel();
 				if (highestLevel > 0) {
 					complianceString = CompilerOptions.versionFromJdkLevel(highestLevel);
 				} else {
@@ -349,6 +364,9 @@
 	 */
 	public static long highestComplianceLevels() {
 		int complianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
+		if ((complianceLevels & AbstractCompilerTest.F_12) != 0) {
+			return ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_12);
+		}
 		if ((complianceLevels & AbstractCompilerTest.F_11) != 0) {
 			return ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11);
 		}
@@ -402,10 +420,10 @@
 	public static int getPossibleComplianceLevels() {
 		if (possibleComplianceLevels == UNINITIALIZED) {
 			String specVersion = System.getProperty("java.specification.version");
-			isJRE9Plus = CompilerOptions.VERSION_9.equals(specVersion)
-					||	CompilerOptions.VERSION_10.equals(specVersion)
-					||	CompilerOptions.VERSION_11.equals(specVersion);
-			isJRE11Plus = CompilerOptions.VERSION_11.equals(specVersion);
+			isJRE12Plus = CompilerOptions.VERSION_12.equals(specVersion);
+			isJRE11Plus = isJRE12Plus || CompilerOptions.VERSION_11.equals(specVersion);
+			isJRE9Plus = isJRE11Plus || CompilerOptions.VERSION_9.equals(specVersion)
+					||	CompilerOptions.VERSION_10.equals(specVersion);
 			initReflectionVersion();
 			String compliances = System.getProperty("compliance");
 			if (compliances != null) {
@@ -429,6 +447,8 @@
 						possibleComplianceLevels |= F_10;
 					} else if (CompilerOptions.VERSION_11.equals(compliance)) {
 						possibleComplianceLevels |= F_11;
+					} else if (CompilerOptions.VERSION_12.equals(compliance)) {
+						possibleComplianceLevels |= F_12;
 					} else {
 						System.out.println("Ignoring invalid compliance (" + compliance + ")");
 						System.out.print("Use one of ");
@@ -441,7 +461,8 @@
 						System.out.print(CompilerOptions.VERSION_1_8 + ", ");
 						System.out.print(CompilerOptions.VERSION_9 + ", ");
 						System.out.print(CompilerOptions.VERSION_10 + ", ");
-						System.out.println(CompilerOptions.VERSION_11);
+						System.out.print(CompilerOptions.VERSION_11 + ", ");
+						System.out.println(CompilerOptions.VERSION_12);
 					}
 				}
 				if (possibleComplianceLevels == 0) {
@@ -487,6 +508,10 @@
 					if (canRun11) {
 						possibleComplianceLevels |= F_11;
 					}
+					boolean canRun12 = canRun11 && !CompilerOptions.VERSION_11.equals(specVersion);
+					if (canRun12) {
+						possibleComplianceLevels |= F_12;
+					}
 				} else if ("1.0".equals(specVersion)
 							|| CompilerOptions.VERSION_1_1.equals(specVersion)
 							|| CompilerOptions.VERSION_1_2.equals(specVersion)
@@ -507,6 +532,9 @@
 										possibleComplianceLevels |= F_10;
 										if (!CompilerOptions.VERSION_10.equals(specVersion)) {
 											possibleComplianceLevels |= F_11;
+											if (!CompilerOptions.VERSION_11.equals(specVersion)) {
+												possibleComplianceLevels |= F_12;
+											}
 										}
 									}
 								}
@@ -662,6 +690,8 @@
 			options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_10);
 			options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_10);
 		} else {
+			// This is already good enough to cover versions from future 
+			// (as long as versionFromJdkLevel does its job)
 			String ver = CompilerOptions.versionFromJdkLevel(this.complianceLevel);
 			options.put(CompilerOptions.OPTION_Compliance, ver);
 			options.put(CompilerOptions.OPTION_Source, ver);
@@ -683,6 +713,11 @@
 		if (compliance < ClassFileConstants.JDK9) return "version 1.8 : 52.0";
 		if (compliance == ClassFileConstants.JDK9) return "version 9 : 53.0";
 		if (compliance == ClassFileConstants.JDK10) return "version 10 : 54.0";
+		if (compliance > ClassFileConstants.JDK10) {
+			String ver = CompilerOptions.versionFromJdkLevel(compliance);
+			int major = Integer.parseInt(ver) + ClassFileConstants.MAJOR_VERSION_0;
+			return "version " + ver + " : " + major + ".0";
+		}
 		if (compliance >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11)) return version; // keep this stmt for search for next bump up
 		return version;
 	}
diff --git a/org.eclipse.jdt.core.tests.model/JCL/converterJclMin12.jar b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin12.jar
new file mode 100644
index 0000000..eed2c4d
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin12.jar
Binary files differ
diff --git a/org.eclipse.jdt.core.tests.model/JCL/converterJclMin12.zip b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin12.zip
new file mode 100644
index 0000000..35e5589
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin12.zip
Binary files differ
diff --git a/org.eclipse.jdt.core.tests.model/JCL/converterJclMin12src.zip b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin12src.zip
new file mode 100644
index 0000000..35e5589
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin12src.zip
Binary files differ
diff --git a/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9.jar b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9.jar
index df361f5..bb48557 100644
--- a/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9.jar
+++ b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9.jar
Binary files differ
diff --git a/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9src.zip b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9src.zip
index 23ce774..031b53a 100644
--- a/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9src.zip
+++ b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9src.zip
Binary files differ
diff --git a/org.eclipse.jdt.core.tests.model/JCL/jclMin12.jar b/org.eclipse.jdt.core.tests.model/JCL/jclMin12.jar
new file mode 100644
index 0000000..0f621d1
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/JCL/jclMin12.jar
Binary files differ
diff --git a/org.eclipse.jdt.core.tests.model/JCL/jclMin12src.zip b/org.eclipse.jdt.core.tests.model/JCL/jclMin12src.zip
new file mode 100644
index 0000000..bf05b46
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/JCL/jclMin12src.zip
Binary files differ
diff --git a/org.eclipse.jdt.core.tests.model/pom.xml b/org.eclipse.jdt.core.tests.model/pom.xml
index f051a83..f676b24 100644
--- a/org.eclipse.jdt.core.tests.model/pom.xml
+++ b/org.eclipse.jdt.core.tests.model/pom.xml
@@ -15,7 +15,7 @@
   <parent>
     <artifactId>tests-pom</artifactId>
     <groupId>eclipse.jdt.core</groupId>
-    <version>4.11.0-SNAPSHOT</version>
+    <version>4.12.0-SNAPSHOT</version>
     <relativePath>../tests-pom/</relativePath>
   </parent>
   <groupId>org.eclipse.jdt</groupId>
@@ -139,6 +139,37 @@
 			<tycho.surefire.argLine>--add-modules ALL-SYSTEM -Dcompliance=1.4,1.7,1.8,11</tycho.surefire.argLine>
 		</properties>
 	</profile>
+	<profile>
+		<id>test-on-javase-12</id>
+		<build>
+			<plugins>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-toolchains-plugin</artifactId>
+					<version>1.1</version>
+					<executions>
+						<execution>
+							<phase>validate</phase>
+							<goals>
+								<goal>toolchain</goal>
+							</goals>
+						</execution>
+					</executions>
+					<configuration>
+						<toolchains>
+							<jdk>
+								<id>JavaSE-12</id>
+							</jdk>
+						</toolchains>
+					</configuration>
+				</plugin>
+			</plugins>
+		</build>
+		<properties>
+			<!-- Overridden in https://ci.eclipse.org/jdt/job/eclipse.jdt.core-run.javac-12/configure  -->
+			<tycho.surefire.argLine>--add-modules ALL-SYSTEM -Dcompliance=1.4,1.7,1.8,12</tycho.surefire.argLine>
+		</properties>
+	</profile>
   </profiles>
 
 </project>
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava12Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava12Tests.java
new file mode 100644
index 0000000..eabf761
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava12Tests.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2019 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.eclipse.jdt.core.tests.dom.ASTConverter12Test;
+import org.eclipse.jdt.core.tests.dom.ConverterTestSetup;
+import org.eclipse.jdt.core.tests.util.AbstractCompilerTest;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+@SuppressWarnings({"rawtypes", "unchecked"})
+public class RunAllJava12Tests extends TestCase {
+
+	public RunAllJava12Tests(String name) {
+		super(name);
+	}
+	public static Class[] getAllTestClasses() {
+		return new Class[] {
+				// to be filled after other tests are added
+		};
+	}
+
+	public static Class[] getConverterTestClasses() {
+		return new Class[] {
+				ASTConverter12Test.class,
+		};
+	}
+
+	public static Class[] getCompilerClasses() {
+		return new Class[] {
+			org.eclipse.jdt.core.tests.eval.TestAll.class,
+			org.eclipse.jdt.core.tests.compiler.regression.TestAll.class,
+		};
+	}
+
+	public static Test suite() {
+		TestSuite ts = new TestSuite(RunAllJava12Tests.class.getName());
+
+		Class[] testClasses = getAllTestClasses();
+		addTestsToSuite(ts, testClasses);
+		testClasses = getConverterTestClasses();
+		addTestsToSuite(ts, testClasses);
+
+		AbstractCompilerTest.setpossibleComplianceLevels(AbstractCompilerTest.F_11);
+		addTestsToSuite(ts, getCompilerClasses());
+		// ComplianceDiagnoseTest is already added to the test suite through getTestSuite
+		ts.addTest(org.eclipse.jdt.core.tests.compiler.parser.TestAll.getTestSuite(false));
+		return ts;
+	}
+	public static void addTestsToSuite(TestSuite suite, Class[] testClasses) {
+
+		for (int i = 0; i < testClasses.length; i++) {
+			Class testClass = testClasses[i];
+			// call the suite() method and add the resulting suite to the suite
+			try {
+				Method suiteMethod = testClass.getDeclaredMethod("suite", new Class[0]); //$NON-NLS-1$
+				Test test = (Test)suiteMethod.invoke(null, new Object[0]);
+				suite.addTest(test);
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
+			} catch (InvocationTargetException e) {
+				e.getTargetException().printStackTrace();
+			} catch (NoSuchMethodException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+	protected void tearDown() throws Exception {
+		ConverterTestSetup.PROJECT_SETUP = false;
+		super.tearDown();
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava12Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava12Tests.java
new file mode 100644
index 0000000..11bc2fa
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunOnlyJava12Tests.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2019 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.jdt.core.tests.dom.ASTConverter12Test;
+import org.eclipse.jdt.core.tests.dom.ConverterTestSetup;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+@SuppressWarnings({"rawtypes", "unchecked"})
+public class RunOnlyJava12Tests extends TestCase {
+	
+	public RunOnlyJava12Tests(String name) {
+		super(name);
+	}
+	public static Class[] getAllTestClasses() {
+		return new Class[] {
+			// to be filled after other tests are added
+		};
+	}
+	
+	public static Class[] getConverterTestClasses() {
+		return new Class[] {
+				ASTConverter12Test.class
+		};
+	}
+	public static Test suite() {
+		TestSuite ts = new TestSuite(RunOnlyJava12Tests.class.getName());
+
+		Class[] testClasses = getAllTestClasses();
+		addTestsToSuite(ts, testClasses);
+		testClasses = getConverterTestClasses();
+		ConverterTestSetup.TEST_SUITES = new ArrayList(Arrays.asList(testClasses));
+		addTestsToSuite(ts, testClasses);
+		return ts;
+	}
+	public static void addTestsToSuite(TestSuite suite, Class[] testClasses) {
+
+		for (int i = 0; i < testClasses.length; i++) {
+			Class testClass = testClasses[i];
+			// call the suite() method and add the resulting suite to the suite
+			try {
+				Method suiteMethod = testClass.getDeclaredMethod("suite", new Class[0]); //$NON-NLS-1$
+				Test test = (Test)suiteMethod.invoke(null, new Object[0]);
+				suite.addTest(test);
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
+			} catch (InvocationTargetException e) {
+				e.getTargetException().printStackTrace();
+			} catch (NoSuchMethodException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+	protected void tearDown() throws Exception {
+		ConverterTestSetup.PROJECT_SETUP = false;
+		super.tearDown();
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter12Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter12Test.java
new file mode 100644
index 0000000..7efc9f1
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter12Test.java
@@ -0,0 +1,391 @@
+/*******************************************************************************
+ * Copyright (c) 2019 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.dom;
+
+import java.util.List;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.Block;
+import org.eclipse.jdt.core.dom.BreakStatement;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jdt.core.dom.IBinding;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.Statement;
+import org.eclipse.jdt.core.dom.SwitchCase;
+import org.eclipse.jdt.core.dom.SwitchExpression;
+import org.eclipse.jdt.core.dom.SwitchStatement;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
+
+import junit.framework.Test;
+
+@SuppressWarnings("rawtypes")
+public class ASTConverter12Test extends ConverterTestSetup {
+
+	ICompilationUnit workingCopy;
+
+	public void setUpSuite() throws Exception {
+		super.setUpSuite();
+		this.ast = AST.newAST(getAST12());
+	}
+
+	public ASTConverter12Test(String name) {
+		super(name);
+	}
+
+	static {
+//		TESTS_NUMBERS = new int[] { 19 };
+//		TESTS_RANGE = new int[] { 1, -1 };
+//		TESTS_NAMES = new String[] {"test0001"};
+	}
+	public static Test suite() {
+		return buildModelTestSuite(ASTConverter12Test.class);
+	}
+	
+	static int getAST12() {
+		return AST.JLS12;
+	}
+	protected void tearDown() throws Exception {
+		super.tearDown();
+		if (this.workingCopy != null) {
+			this.workingCopy.discardWorkingCopy();
+			this.workingCopy = null;
+		}
+	}
+	/*
+	 * Test that a simple switch expression's return type holds the correct type
+	 */
+	public void test0001() throws JavaModelException {
+		String contents =
+			"	public class X {\n" +
+			"   enum Day\n" +
+			"   {\n" + 
+			"   	SUNDAY, MONDAY, TUESDAY, WEDNESDAY,\n" + 
+			"   	THURSDAY, FRIDAY, SATURDAY;\n" + 
+			"	}\n" +
+			"	public static void main(String[] args) {\n" + 
+			"		Day day = Day.SUNDAY;\n" +
+			"		int k = switch (day) {\n" + 
+			"    	case MONDAY  -> throw new NullPointerException();\n" + 
+			"    	case TUESDAY -> 1;\n" + 
+			"\n" +     
+			"	 	case WEDNESDAY -> {break 10;}\n" + 
+			"    	default      -> {\n" +
+			"        	int g = day.toString().length();\n" +
+			"        	break g;\n" +
+			"   	}};\n" +
+			"   	System.out.println(k);\n" +
+			"	}\n" +
+			"}" ;
+		this.workingCopy = getWorkingCopy("/Converter12/src/X.java", true/*resolve*/);
+		IJavaProject javaProject = this.workingCopy.getJavaProject();
+		String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+		try {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+			javaProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
+			ASTNode node = buildAST(
+				contents,
+				this.workingCopy);
+			assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
+			CompilationUnit compilationUnit = (CompilationUnit) node;
+			assertProblemsSize(compilationUnit, 0);
+			node = getASTNode(compilationUnit, 0, 1);
+			MethodDeclaration methodDeclaration = (MethodDeclaration) node;
+			VariableDeclarationStatement vStmt1 = (VariableDeclarationStatement) methodDeclaration.getBody().statements().get(1);
+			Type type = vStmt1.getType();
+			IBinding binding = type.resolveBinding();
+			assertTrue("null binding", binding != null);
+			assertTrue("binding incorrect", binding.getName().equals("int"));
+		} finally {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+		}
+	}
+	/*
+	 * Test that a case statement with multiple cases is resolved correctly
+	 * and has the correct source range
+	 */
+	public void test0002() throws JavaModelException {
+		String contents =
+			"public class X {\n" + 
+			"	static enum Day {MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY, SATURDAY,SUNDAY}\n" + 
+			"	String aa(Day day) throws Exception {\n" + 
+			"		var today = \"\";\n" + 
+			"		switch (day) {\n" + 
+			"			case SATURDAY,SUNDAY ->\n" + 
+			"				today=\"Weekend\";\n" + 
+			"			case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY ->\n" + 
+			"				today=\"Working\";\n" + 
+			"			default ->\n" + 
+			"				throw new Exception(\"Invalid day: \" + day.name());\n" + 
+			"		}\n" + 
+			"		return today;\n" + 
+			"	}\n" + 
+			"	\n" + 
+			"	String bb(Day day) throws Exception {\n" + 
+			"		var today = \"\";\n" + 
+			"		switch (day) {\n" + 
+			"			case SATURDAY,SUNDAY:\n" + 
+			"				today = \"Weekend day\";\n" + 
+			"				break;\n" + 
+			"			case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY:\n" + 
+			"				today = \"Working day\";\n" + 
+			"				break;\n" + 
+			"			default:\n" + 
+			"				throw new Exception(\"Invalid day: \" + day.name());\n" + 
+			"		}\n" + 
+			"		return today;\n" + 
+			"	}\n" + 
+			"}" ;
+		this.workingCopy = getWorkingCopy("/Converter12/src/X.java", true/*resolve*/);
+		IJavaProject javaProject = this.workingCopy.getJavaProject();
+		String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+		try {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+			javaProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
+			ASTNode node = buildAST(
+				contents,
+				this.workingCopy);
+			assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
+			CompilationUnit compilationUnit = (CompilationUnit) node;
+			assertProblemsSize(compilationUnit, 0);
+			node = getASTNode(compilationUnit, 0, 1, 1);
+			assertEquals("Switch statement", node.getNodeType(), ASTNode.SWITCH_STATEMENT);
+			SwitchStatement switchStatement = (SwitchStatement) node;
+			checkSourceRange((Statement) switchStatement.statements().get(0), "case SATURDAY,SUNDAY ->", contents);
+			checkSourceRange((Statement) switchStatement.statements().get(2), "case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY ->", contents);
+		} finally {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+		}
+	}
+	
+	/* test implicit break statement */
+
+	public void test0003() throws JavaModelException {
+		String contents =
+			"public class X {\n" +
+			"	static enum Day {MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY, SATURDAY,SUNDAY}\n" +
+			"	String aa(Day day) throws Exception {\n" +
+			"		var today = \"\";\n" +
+			"		switch (day) {\n" +
+			"			case SATURDAY,SUNDAY ->\n" +
+			"				today=\"Weekend\";\n" +
+			"			case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY ->\n" +
+			"				today=\"Working\";\n" +
+			"			default ->\n" +
+			"				throw new Exception(\"Invalid day: \" + day.name());\n" +
+			"		}\n" +
+			"		return today;\n" +
+			"	}\n" +
+			"	\n" +
+			"	String bb(Day day) throws Exception {\n" +
+			"		String today = \"\";\n" +
+			"		today = switch (day) {\n" +
+			"			case SATURDAY,SUNDAY:\n" +
+			"				break \"Weekend day\";\n" +
+			"			case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY:\n" +
+			"				break \"Week day\";\n" +
+			"			default:\n" +
+			"				break \"Any day\";\n" +
+			"		};\n" +
+			"		return today;\n" +
+			"	}\n" +
+			"}" ;
+		this.workingCopy = getWorkingCopy("/Converter12/src/X.java", true/*resolve*/);
+		IJavaProject javaProject = this.workingCopy.getJavaProject();
+		String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+		try {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+			javaProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
+			ASTNode node = buildAST(
+					contents,
+					this.workingCopy);
+				assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
+				CompilationUnit compilationUnit = (CompilationUnit) node;
+				assertProblemsSize(compilationUnit, 0);
+				node = getASTNode(compilationUnit, 0, 1, 1);
+				assertEquals("Switch statement", node.getNodeType(), ASTNode.SWITCH_STATEMENT);
+				SwitchStatement switchStatement = (SwitchStatement) node;
+				checkSourceRange((Statement) switchStatement.statements().get(0), "case SATURDAY,SUNDAY ->", contents);
+			
+		} finally {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+		}
+	}
+	public void test0004() throws JavaModelException {
+		String contents =
+				"public class X {\n" +
+				"	static enum Day {MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY, SATURDAY,SUNDAY}\n" +
+				"	String bb(Day day) throws Exception {\n" +
+				"		String today = switch (day) {\n" +
+				"			case SATURDAY,SUNDAY:\n" +
+				"				break \"Weekend day\";\n" +
+				"			case MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY:\n" +
+				"				break \"Week day\";\n" +
+				"			default:\n" +
+				"				break \"Any day\";\n" +
+				"		};\n" +
+				"		return today;\n" +
+				"	}\n" +
+				"}" ;
+		this.workingCopy = getWorkingCopy("/Converter12/src/X.java", true/*resolve*/);
+		IJavaProject javaProject = this.workingCopy.getJavaProject();
+		String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+		try {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+			javaProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
+			ASTNode node = buildAST(
+					contents,
+					this.workingCopy);
+				assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
+				CompilationUnit compilationUnit = (CompilationUnit) node;
+				assertProblemsSize(compilationUnit, 0);
+				node = getASTNode(compilationUnit, 0, 1, 0);
+				assertEquals("Switch statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
+				List fragments = ((VariableDeclarationStatement) node).fragments();
+				assertEquals("Incorrect no of fragments", 1, fragments.size());
+				node = (ASTNode) fragments.get(0);
+				assertEquals("Switch statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_FRAGMENT);
+				VariableDeclarationFragment fragment = (VariableDeclarationFragment) node;
+				Expression initializer = fragment.getInitializer();
+				assertEquals("incorrect type", ASTNode.SWITCH_EXPRESSION, initializer.getNodeType());
+				Expression expression = ((SwitchExpression) initializer).getExpression();
+				assertEquals("incorrect type", ASTNode.SIMPLE_NAME, expression.getNodeType());
+				assertEquals("incorrect name", "day", ((SimpleName) expression).getFullyQualifiedName());
+				List statements = ((SwitchExpression) initializer).statements();
+				assertEquals("incorrect no of statements", 6, statements.size());
+				BreakStatement brStmt = (BreakStatement) statements.get(1);
+				Expression expression2 = brStmt.getExpression();
+				assertNotNull("should not null", expression2);
+				assertEquals("incorrect node type", ASTNode.STRING_LITERAL, expression2.getNodeType());
+				
+				//default case:
+				SwitchCase caseStmt = (SwitchCase) statements.get(4);
+				assertTrue("not default", caseStmt.isDefault());
+				brStmt = (BreakStatement) statements.get(5);
+				expression2 = brStmt.getExpression();
+				assertNotNull("should not null", expression2);
+				assertEquals("incorrect node type", ASTNode.STRING_LITERAL, expression2.getNodeType());
+			
+		} finally {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+		}
+	}
+	public void test0005() throws JavaModelException {
+		String contents =
+				"public class X {\n" +
+				"	public String test001() {\n" + 
+				"		int i = 0;\n" + 
+				"		String ret = switch(i%2) {\n" + 
+				"		case 0 -> \"odd\";\n" + 
+				"		case 1 -> \"even\";\n" + 
+				"		default -> \"\";\n" + 
+				"		};\n" + 
+				"		return ret;\n" + 
+				"	}" +
+				"}" ;
+		this.workingCopy = getWorkingCopy("/Converter12/src/X.java", true/*resolve*/);
+		IJavaProject javaProject = this.workingCopy.getJavaProject();
+		String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+		try {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+			javaProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
+			ASTNode node = buildAST(
+					contents,
+					this.workingCopy);
+				assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
+				CompilationUnit compilationUnit = (CompilationUnit) node;
+				assertProblemsSize(compilationUnit, 0);
+				node = getASTNode(compilationUnit, 0, 0, 1);
+				assertEquals("Switch statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
+				List fragments = ((VariableDeclarationStatement) node).fragments();
+				assertEquals("Incorrect no of fragments", 1, fragments.size());
+				node = (ASTNode) fragments.get(0);
+				assertEquals("Switch statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_FRAGMENT);
+				VariableDeclarationFragment fragment = (VariableDeclarationFragment) node;
+				Expression initializer = fragment.getInitializer();
+				assertEquals("incorrect type", ASTNode.SWITCH_EXPRESSION, initializer.getNodeType());
+				Expression expression = ((SwitchExpression) initializer).getExpression();
+				assertEquals("incorrect type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
+				List statements = ((SwitchExpression) initializer).statements();
+				assertEquals("incorrect no of statements", 6, statements.size());
+				BreakStatement brStmt = (BreakStatement) statements.get(1);
+				Expression expression2 = brStmt.getExpression();
+				assertNotNull("should not null", expression2);
+				assertEquals("incorrect node type", ASTNode.STRING_LITERAL, expression2.getNodeType());
+
+				//default case:
+				SwitchCase caseStmt = (SwitchCase) statements.get(4);
+				assertTrue("not default", caseStmt.isDefault());
+				brStmt = (BreakStatement) statements.get(5);
+				expression2 = brStmt.getExpression();
+				assertNotNull("should not null", expression2);
+				assertEquals("incorrect node type", ASTNode.STRING_LITERAL, expression2.getNodeType());
+			
+		} finally {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+		}
+	}
+	public void test0006() throws JavaModelException {
+		String contents =
+				"public class X {\n" +
+						"	public String test001() {\n" + 
+						"		int i = 0;\n" + 
+						"		String ret = switch(i%2) {\n" + 
+						"		case 0 -> {return \"odd\"; }\n" + 
+						"		case 1 -> \"even\";\n" + 
+						"		default -> \"\";\n" + 
+						"		};\n" + 
+						"		return ret;\n" + 
+						"	}" +
+						"}" ;
+		this.workingCopy = getWorkingCopy("/Converter12/src/X.java", true/*resolve*/);
+		IJavaProject javaProject = this.workingCopy.getJavaProject();
+		String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+		try {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+			javaProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
+			ASTNode node = buildAST(
+					contents,
+					this.workingCopy);
+			assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
+			CompilationUnit compilationUnit = (CompilationUnit) node;
+			assertProblemsSize(compilationUnit, 0);
+			node = getASTNode(compilationUnit, 0, 0, 1);
+			assertEquals("Switch statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
+			List fragments = ((VariableDeclarationStatement) node).fragments();
+			assertEquals("Incorrect no of fragments", 1, fragments.size());
+			node = (ASTNode) fragments.get(0);
+			assertEquals("Switch statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_FRAGMENT);
+			VariableDeclarationFragment fragment = (VariableDeclarationFragment) node;
+			Expression initializer = fragment.getInitializer();
+			List statements = ((SwitchExpression) initializer).statements();
+			assertEquals("incorrect no of statements", 6, statements.size());
+			Block block = (Block) statements.get(1);
+			statements = block.statements();
+			assertEquals("incorrect no of statements", 1, statements.size());
+			Statement stmt = (Statement) statements.get(0);
+			assertEquals("incorrect node type", ASTNode.RETURN_STATEMENT, stmt.getNodeType());
+
+		} finally {
+			javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+		}
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java
index dc6db31..21383f0 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java
@@ -4829,12 +4829,14 @@
 		statement = (Statement) statements.get(0);
     	assertEquals("Not a switch case statement", ASTNode.SWITCH_CASE, statement.getNodeType());
 		SwitchCase switchCase = (SwitchCase) statement;
+		@SuppressWarnings("deprecation")
 		Expression expression = switchCase.getExpression();
 		assertNull("Got a constant", expression.resolveConstantExpressionValue());
    }
 
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88548
-    public void test0152() throws CoreException {
+    @SuppressWarnings("deprecation")
+	public void test0152() throws CoreException {
     	this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
     	String contents =
 	   		"public class X {\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java
index 32ef339..546c5a5 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java
@@ -4759,7 +4759,8 @@
    }
 
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88548
-    public void test0151() throws CoreException {
+    @SuppressWarnings("deprecation")
+	public void test0151() throws CoreException {
     	this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
     	String contents =
 	   		"public enum X {\n" +
@@ -4822,7 +4823,8 @@
    }
 
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88548
-    public void test0152() throws CoreException {
+    @SuppressWarnings("deprecation")
+	public void test0152() throws CoreException {
     	this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
     	String contents =
 	   		"public class X {\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java
index 3a42702..00cd53b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java
@@ -4781,7 +4781,8 @@
    }
 
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88548
-    public void test0151() throws CoreException {
+    @SuppressWarnings("deprecation")
+	public void test0151() throws CoreException {
     	this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
     	String contents =
 	   		"public enum X {\n" +
@@ -4844,7 +4845,8 @@
    }
 
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88548
-    public void test0152() throws CoreException {
+    @SuppressWarnings("deprecation")
+	public void test0152() throws CoreException {
     	this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/);
     	String contents =
 	   		"public class X {\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java
index 6321d36..550672a 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2016, 2018 IBM Corporation and others.
+ * Copyright (c) 2016, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -37,6 +37,7 @@
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.compiler.IProblem;
 
 @SuppressWarnings({"rawtypes"})
 public class ASTConverter9Test extends ConverterTestSetup {
@@ -1414,5 +1415,93 @@
 			deleteProject("Foo");
 		}
 	}
+	// TODO: should probably start a new test class
+	public void testBug531714_015() throws CoreException {
+		// saw NPE in SwitchExpression.resolveType(SwitchExpression.java:423)
+		if (!isJRE12) {
+			System.err.println("Test "+getName()+" requires a JRE 12");
+			return;
+		}
+		IJavaProject p =  createJavaProject("Foo", new String[] {"src"}, new String[] {jcl9lib}, "bin", "12"); // FIXME jcl12?
+		p.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		p.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
+		try {
+			String source =
+				"import java.util.*;\n" +
+				"public class X {\n" +
+				"	void testForeach1(int i, List<String> list) {\n" + 
+				"		for (String s : switch(i) { case 1 -> list; default -> ; }) {\n" + 
+				"			\n" + 
+				"		}\n" +
+				"		Throwable t = switch (i) {\n" +
+				"			case 1 -> new Exception();\n" +
+				"			case 2 -> new RuntimeException();\n" + // trigger !typeUniformAcrossAllArms
+				"			default -> missing;\n" +
+				"		};\n" +
+				"	}\n" + 
+				"	void testForeach0(int i, List<String> list) {\n" + // errors in first arm
+				"		for (String s : switch(i) { case 1 -> ; default -> list; }) {\n" + 
+				"			\n" + 
+				"		}\n" +
+				"		Throwable t = switch (i) {\n" +
+				"			case 0 -> missing;\n" +
+				"			case 1 -> new Exception();\n" +
+				"			default -> new RuntimeException();\n" + // trigger !typeUniformAcrossAllArms
+				"		};\n" +
+				"	}\n" +
+				"	void testForeachAll(int i) {\n" + // only erroneous arms
+				"		Throwable t = switch (i) {\n" +
+				"			case 0 -> missing;\n" +
+				"			default -> absent;\n" +
+				"		};\n" +
+				"	}\n" +
+				"}\n";
+			createFile("Foo/src/X.java", source);
+			ICompilationUnit cuD = getCompilationUnit("/Foo/src/X.java");
+				
+			ASTParser parser = ASTParser.newParser(AST_INTERNAL_JLS11);
+			parser.setProject(p);
+			parser.setSource(cuD);
+			parser.setResolveBindings(true);
+			parser.setStatementsRecovery(true);
+			parser.setBindingsRecovery(true);
+			org.eclipse.jdt.core.dom.CompilationUnit cuAST = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(null);
+			IProblem[] problems = cuAST.getProblems();
+			assertProblems("Unexpected problems",
+					"1. ERROR in /Foo/src/X.java (at line 4)\n" + 
+					"	for (String s : switch(i) { case 1 -> list; default -> ; }) {\n" + 
+					"	                                                    ^^\n" + 
+					"Syntax error on token \"->\", Expression expected after this token\n" + 
+					"----------\n" + 
+					"2. ERROR in /Foo/src/X.java (at line 10)\n" + 
+					"	default -> missing;\n" + 
+					"	           ^^^^^^^\n" + 
+					"missing cannot be resolved to a variable\n" + 
+					"----------\n" + 
+					"3. ERROR in /Foo/src/X.java (at line 14)\n" + 
+					"	for (String s : switch(i) { case 1 -> ; default -> list; }) {\n" + 
+					"	                                   ^^\n" + 
+					"Syntax error on token \"->\", Expression expected after this token\n" + 
+					"----------\n" + 
+					"4. ERROR in /Foo/src/X.java (at line 18)\n" + 
+					"	case 0 -> missing;\n" + 
+					"	          ^^^^^^^\n" + 
+					"missing cannot be resolved to a variable\n" + 
+					"----------\n" + 
+					"5. ERROR in /Foo/src/X.java (at line 25)\n" + 
+					"	case 0 -> missing;\n" + 
+					"	          ^^^^^^^\n" + 
+					"missing cannot be resolved to a variable\n" + 
+					"----------\n" + 
+					"6. ERROR in /Foo/src/X.java (at line 26)\n" + 
+					"	default -> absent;\n" + 
+					"	           ^^^^^^\n" + 
+					"absent cannot be resolved to a variable\n" + 
+					"----------\n",
+					problems, source.toCharArray());
+		} finally {
+			deleteProject(p);
+		}
+	}
 // Add new tests here
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java
index addae41..f4d1f0e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java
@@ -2088,6 +2088,7 @@
 	/**
 	 * SwitchStatement ==> SwitchStatement
 	 */
+	@SuppressWarnings("deprecation")
 	public void test0097() throws JavaModelException {
 		ICompilationUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0097", "Test.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 		char[] source = sourceUnit.getSource().toCharArray();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java
index 926d8a3..4b77b6e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java
@@ -2088,6 +2088,7 @@
 	/**
 	 * SwitchStatement ==> SwitchStatement
 	 */
+	@SuppressWarnings("deprecation")
 	public void test0097() throws JavaModelException {
 		ICompilationUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0097", "Test.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 		char[] source = sourceUnit.getSource().toCharArray();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java
index 9c83e01..9e617b1 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java
@@ -2072,6 +2072,7 @@
 	/**
 	 * SwitchStatement ==> SwitchStatement
 	 */
+	@SuppressWarnings("deprecation")
 	public void test0097() throws JavaModelException {
 		ICompilationUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0097", "Test.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 		char[] source = sourceUnit.getSource().toCharArray();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java
index acbd8dd..dfafd6d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java
@@ -2177,6 +2177,7 @@
 	/**
 	 * SwitchStatement ==> SwitchStatement
 	 */
+	@SuppressWarnings("deprecation")
 	public void test0097() throws JavaModelException {
 		ICompilationUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0097", "Test.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 		char[] source = sourceUnit.getSource().toCharArray();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java
index 04ca9bb..6b421b9 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java
@@ -1206,6 +1206,7 @@
 		x1.setName(this.N2);
 		basicMatch(x1);
 	}
+	@SuppressWarnings("deprecation")
 	public void testSwitchCase() {
 		SwitchCase x1 = this.ast.newSwitchCase();
 		x1.setExpression(this.E1);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java
index ebd9686..34be3d5 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -8878,6 +8878,7 @@
 			ASTNode.USES_DIRECTIVE,
 			ASTNode.PROVIDES_DIRECTIVE,
 			ASTNode.MODULE_MODIFIER,
+			ASTNode.SWITCH_EXPRESSION,
 //{ObjectTeams:
 			ASTNode.METHOD_SPEC,
 			ASTNode.CALLIN_MAPPING_DECLARATION,
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java
index 0407d10..c5e62c6 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java
@@ -2096,6 +2096,7 @@
 		String result = this.b.toString();
 		assertTrue(result.equals("[(eSMR"+this.N1S+this.N2S+"eSMR)]")); //$NON-NLS-1$ //$NON-NLS-2$
 	}
+	@SuppressWarnings("deprecation")
 	public void testSwitchCase() {
 		SwitchCase x1 = this.ast.newSwitchCase();
 		x1.setExpression(this.E1);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java
index b6fafe4..65102b4 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2018 IBM Corporation and others.
+ * Copyright (c) 2004, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -493,7 +493,9 @@
 		String option = cu.getJavaProject().getOption(JavaCore.COMPILER_COMPLIANCE, true);
 		long jdkLevel = CompilerOptions.versionToJdkLevel(option);
 		int JLSLevel = AST_INTERNAL_JLS3;
-		if (jdkLevel >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11)) {
+		if (jdkLevel >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_12)) {
+			JLSLevel = AST_INTERNAL_JLS12;
+		} else if (jdkLevel >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11)) {
 			JLSLevel = AST_INTERNAL_JLS11;			
 		} else if (jdkLevel >= ClassFileConstants.JDK10) {
 			JLSLevel = AST_INTERNAL_JLS10;			
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java
index f34d73e..47ab610 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -105,6 +105,7 @@
 			this.deleteProject("Converter9"); //$NON-NLS-1$
 			this.deleteProject("Converter10"); //$NON-NLS-1$
 			this.deleteProject("Converter11"); //$NON-NLS-1$
+			this.deleteProject("Converter12"); //$NON-NLS-1$
 			PROJECT_SETUP = false;
 		} else {
 			TEST_SUITES.remove(getClass());
@@ -117,6 +118,7 @@
 				this.deleteProject("Converter9"); //$NON-NLS-1$
 				this.deleteProject("Converter10"); //$NON-NLS-1$
 				this.deleteProject("Converter11"); //$NON-NLS-1$
+				this.deleteProject("Converter12"); //$NON-NLS-1$
 				PROJECT_SETUP = false;
 			}
 		}
@@ -178,6 +180,14 @@
 						new IPath[] {getConverterJCLPath("11"), getConverterJCLSourcePath("11"), getConverterJCLRootSourcePath()},
 						null);
 			}
+		} else if ("12".equals(compliance)) {
+			if (JavaCore.getClasspathVariable("CONVERTER_JCL12_LIB") == null) {
+				setupExternalJCL("converterJclMin12");
+				JavaCore.setClasspathVariables(
+						new String[] {"CONVERTER_JCL11_LIB", "CONVERTER_JCL11_SRC", "CONVERTER_JCL11_SRCROOT"},
+						new IPath[] {getConverterJCLPath("12"), getConverterJCLSourcePath("12"), getConverterJCLRootSourcePath()},
+						null);
+			}
 		} else if (JavaCore.getClasspathVariable("CONVERTER_JCL_LIB") == null) {
 			setupExternalJCL("converterJclMin");
 			JavaCore.setClasspathVariables(
@@ -202,6 +212,7 @@
 			setUpJavaProject("Converter9", "9"); //$NON-NLS-1$ //$NON-NLS-2$
 			setUpJavaProject("Converter10", "10"); //$NON-NLS-1$ //$NON-NLS-2$
 			setUpJavaProject("Converter11", "11"); //$NON-NLS-1$ //$NON-NLS-2$
+			setUpJavaProject("Converter12", "12"); //$NON-NLS-1$ //$NON-NLS-2$
 			waitUntilIndexesReady(); // needed to find secondary types
 			PROJECT_SETUP = true;
 		}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java
index 028e170..f12cc67 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java
@@ -52,6 +52,7 @@
 		TypeAnnotationsConverterTest.class,
 		ASTConverter18Test.class,
 		ASTConverter9Test.class,
+		ASTConverter12Test.class,
 	};
 }
 public static Test suite() {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
index 36ec699..678c648 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -7,7 +7,7 @@
  * https://www.eclipse.org/legal/epl-2.0/
  *
  * SPDX-License-Identifier: EPL-2.0
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Brock Janiczak - Contribution for bug 150741
@@ -14837,4 +14837,79 @@
 	String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
 	formatSource(input, getCompilationUnit("Formatter", "", "test541011", "G_out.java").getSource());
 }
+/**
+ * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
+ */
+public void testBug543818a() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_12);
+	this.formatterPrefs.insert_space_before_comma_in_switch_case_expressions = true;
+	this.formatterPrefs.insert_space_before_colon_in_case = true;
+	this.formatterPrefs.indent_switchstatements_compare_to_switch = true;
+	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "A_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
+ */
+public void testBug543818b() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_12);
+	this.formatterPrefs.insert_space_after_comma_in_switch_case_expressions = false;
+	this.formatterPrefs.insert_space_before_closing_paren_in_switch = true;
+	this.formatterPrefs.indent_switchstatements_compare_to_cases = false;
+	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "B_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
+ */
+public void testBug543818c() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_12);
+	this.formatterPrefs.insert_space_before_arrow_in_switch_case = false;
+	this.formatterPrefs.insert_space_before_opening_paren_in_switch = false;
+	this.formatterPrefs.indent_breaks_compare_to_cases = false;
+	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "C_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
+ */
+public void testBug543818d() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_12);
+	this.formatterPrefs.insert_space_after_arrow_in_switch_case = false;
+	this.formatterPrefs.insert_space_after_opening_paren_in_switch = true;
+	this.formatterPrefs.insert_space_before_opening_brace_in_block = false;
+	this.formatterPrefs.brace_position_for_switch = DefaultCodeFormatterConstants.NEXT_LINE;
+	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "D_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
+ */
+public void testBug543818e() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_12);
+	this.formatterPrefs.insert_space_before_arrow_in_switch_default = false;
+	this.formatterPrefs.insert_space_before_colon_in_default = true;
+	this.formatterPrefs.parenthesis_positions_in_switch_statement = DefaultCodeFormatterConstants.SEPARATE_LINES;
+	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "E_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
+ */
+public void testBug543818f() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_12);
+	this.formatterPrefs.insert_space_after_arrow_in_switch_default = false;
+	this.formatterPrefs.insert_space_before_opening_brace_in_switch = false;
+	this.formatterPrefs.insert_space_before_opening_brace_in_block = false;
+	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "F_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
+ */
+public void testBug543818g() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_12);
+	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "G_out.java").getSource());
+}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
index 7260030..3bc7436 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
@@ -90,11 +90,10 @@
 			}
 		}
 		long jdkLevel = CompilerOptions.versionToJdkLevel(javaVersion.length() > 3 ? javaVersion.substring(0, 3) : javaVersion);
+		if (jdkLevel >= ClassFileConstants.getLatestJDKLevel()) {
+			isJRE12 = true;
+		}
 		if (jdkLevel >= ClassFileConstants.JDK11) {
-			if (CompilerOptions.versionToJdkLevel(javaVersion.length() > 3 ? javaVersion.substring(0, 3) : javaVersion, false) == 0) {
-				// version was capped to 11 during versionToJdkLevel(version, true)
-				isJRE12 = true;
-			}
 			isJRE11 = true;
 		}
 		if (jdkLevel >= ClassFileConstants.JDK10) {
@@ -114,7 +113,7 @@
 						"jdk.packager,jdk.packager.services,jdk.plugin.dom," +												// not present in OpenJDK
 						"jdk.scripting.nashorn,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsupported,jdk.xml.dom," +
 						"oracle.desktop,oracle.net";																		// not present in OpenJDK
-			} else if (vmName.contains("OpenJDK")) {
+			} else if (vmName.contains("OpenJDK") || vmName.contains("OpenJ9")) {
 				DEFAULT_MODULES = "java.se," +
 						"jdk.accessibility,jdk.attach,jdk.compiler,jdk.dynalink,jdk.httpserver," +
 						"jdk.incubator.httpclient,jdk.jartool,jdk.javadoc,jdk.jconsole,jdk.jdi," +
@@ -124,7 +123,7 @@
 				System.out.println(System.getProperties());
 				fail("Unexpected java vm "+javaVersion+" "+vmName);
 			}
-			System.out.println("Recognized Java 9 version '"+javaVersion+"' with vm.name '"+vmName+"'");
+			System.out.println("Recognized Java version '"+javaVersion+"' with vm.name '"+vmName+"'");
 		}
 	}
 
@@ -142,11 +141,16 @@
 	protected static final int AST_INTERNAL_JLS10 = AST.JLS10;
 
 	/**
+	 * Internal synonym for constant AST.JSL12
+	 * to alleviate deprecation warnings once AST.JLS12 is deprecated in future.
+	 */
+	protected static final int AST_INTERNAL_JLS12 = AST.JLS12;
+
+	/**
 	 * Internal synonym for constant AST.JSL11
 	 * to alleviate deprecation warnings once AST.JLS11 is deprecated in future.
 	 */
 	protected static final int AST_INTERNAL_JLS11 = AST.JLS11;
-
 	public static class BasicProblemRequestor implements IProblemRequestor {
 		public void acceptProblem(IProblem problem) {}
 		public void beginReporting() {}
@@ -2044,6 +2048,12 @@
 					options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11);
 					options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11);
 					javaProject.setOptions(options);
+				} else if ("12".equals(compliance)) {
+					Map options = new HashMap();
+					options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
+					options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
+					options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+					javaProject.setOptions(options);
 				}
 				result[0] = javaProject;
 			}
@@ -3119,6 +3129,7 @@
 		javaProject.setOption(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.IGNORE);
 		javaProject.setOption(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.IGNORE);
 		javaProject.setOption(JavaCore.COMPILER_PB_TYPE_PARAMETER_HIDING, JavaCore.IGNORE);
+//		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
 		return javaProject;
 	}
 	protected void setUpProjectCompliance(IJavaProject javaProject, String compliance) throws JavaModelException, IOException {
@@ -3136,7 +3147,10 @@
 			newJclLibString = "JCL18_FULL";
 			newJclSrcString = "JCL18_SRC"; // Use the same source
 		} else {
-			if (compliance.equals("11")) {
+			if (compliance.equals("12")) {
+				newJclLibString = "JCL12_LIB";
+				newJclSrcString = "JCL12_SRC";
+			} else if (compliance.equals("11")) {
 				newJclLibString = "JCL11_LIB";
 				newJclSrcString = "JCL11_SRC";
 			} else if (compliance.equals("10")) {
@@ -3193,10 +3207,11 @@
 		IPath jcl9Lib = new Path("JCL19_LIB");
 		IPath jcl10Lib = new Path("JCL10_LIB");
 		IPath jcl11Lib = new Path("JCL11_LIB");
+		IPath jcl12Lib = new Path("JCL12_LIB");
 		IPath jclFull = new Path("JCL18_FULL");
 
 		return path.equals(jclLib) || path.equals(jcl5Lib) || path.equals(jcl8Lib) || path.equals(jcl9Lib)
-				|| path.equals(jcl10Lib) ||  path.equals(jcl11Lib) || path.equals(jclFull);
+				|| path.equals(jcl10Lib) ||  path.equals(jcl11Lib) || path.equals(jcl12Lib) || path.equals(jclFull);
 	}
 	public void setUpJCLClasspathVariables(String compliance) throws JavaModelException, IOException {
 		setUpJCLClasspathVariables(compliance, false);
@@ -3259,6 +3274,14 @@
 					new IPath[] {getExternalJCLPath("11"), getExternalJCLSourcePath("11"), getExternalJCLRootSourcePath()},
 					null);
 			}
+		} else if ("12".equals(compliance)) {
+			if (JavaCore.getClasspathVariable("JCL12_LIB") == null) {
+				setupExternalJCL("jclMin12");
+				JavaCore.setClasspathVariables(
+					new String[] {"JCL12_LIB", "JCL12_SRC", "JCL_SRCROOT"},
+					new IPath[] {getExternalJCLPath("12"), getExternalJCLSourcePath("12"), getExternalJCLRootSourcePath()},
+					null);
+			}
 		} else {
 			if (JavaCore.getClasspathVariable("JCL_LIB") == null) {
 				setupExternalJCL("jclMin");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java
index 2f58097..5f37bc3 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -102,6 +102,7 @@
 		ResolveTests2.class,
 		ResolveTests_1_5.class,
 		ResolveTests18.class,
+		ResolveTests12.class,
 		SelectionJavadocModelTests.class,
 
 		// Support for completion tests
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
index a7d9e60..ba4462e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
@@ -1903,6 +1903,7 @@
 		System.err.println(this.getClass().getName()+'.'+getName()+" needs a Java 9 JRE - skipped");
 		return;
 	}
+	if (isJRE12) return;
 	try {
 		IJavaProject prj = createJava9Project("Test", new String[]{"src"});
 		String moduleSrc =
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests12.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests12.java
new file mode 100644
index 0000000..ea03702
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests12.java
@@ -0,0 +1,856 @@
+/*******************************************************************************
+ * Copyright (c) 2019 IBM and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ * 
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.model;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.codeassist.RelevanceConstants;
+
+import junit.framework.Test;
+
+public class CompletionTests12 extends AbstractJavaModelCompletionTests {
+
+	static {
+//		TESTS_NAMES = new String[]{"test018e"};
+	}
+
+	public CompletionTests12(String name) {
+		super(name);
+	}
+	public void setUpSuite() throws Exception {
+		if (COMPLETION_PROJECT == null)  {
+			COMPLETION_PROJECT = setUpJavaProject("Completion", "12");
+		} else {
+			setUpProjectCompliance(COMPLETION_PROJECT, "12");
+		}
+		super.setUpSuite();
+	}
+	public static Test suite() {
+		return buildModelTestSuite(CompletionTests12.class);
+	}
+	public void test001() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(MyDay day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATURDAY, SUN ->\n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n" + 
+				"enum MyDay { SATURDAY, SUNDAY}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "SATURDAY, SUN";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"SUNDAY[FIELD_REF]{SUNDAY, LMyDay;, LMyDay;, SUNDAY, null, "+ 
+						(RelevanceConstants.R_DEFAULT + RelevanceConstants.R_RESOLVED + RelevanceConstants.R_INTERESTING+
+								RelevanceConstants.R_CASE + RelevanceConstants.R_EXACT_EXPECTED_TYPE +
+								RelevanceConstants.R_ENUM + RelevanceConstants.R_ENUM_CONSTANT +
+								RelevanceConstants.R_UNQUALIFIED + RelevanceConstants.R_NON_RESTRICTED)+ "}",
+						requestor.getResults());
+	}
+	public void test002() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(MyDay day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATURDAY, SUN :\n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n" + 
+				"enum MyDay { SATURDAY, SUNDAY}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "SATURDAY, SUN";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"SUNDAY[FIELD_REF]{SUNDAY, LMyDay;, LMyDay;, SUNDAY, null, "+ 
+						(RelevanceConstants.R_DEFAULT + RelevanceConstants.R_RESOLVED + RelevanceConstants.R_INTERESTING+
+								RelevanceConstants.R_CASE + RelevanceConstants.R_EXACT_EXPECTED_TYPE +
+								RelevanceConstants.R_ENUM + RelevanceConstants.R_ENUM_CONSTANT +
+								RelevanceConstants.R_UNQUALIFIED + RelevanceConstants.R_NON_RESTRICTED)+ "}",
+						requestor.getResults());
+	}
+	public void test003() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(MyDay day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATU -> \n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n" + 
+				"enum MyDay { SATURDAY, SUNDAY}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "SATU";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"SATURDAY[FIELD_REF]{SATURDAY, LMyDay;, LMyDay;, SATURDAY, null, "+ 
+						(RelevanceConstants.R_DEFAULT + RelevanceConstants.R_RESOLVED + RelevanceConstants.R_INTERESTING+
+								RelevanceConstants.R_CASE + RelevanceConstants.R_EXACT_EXPECTED_TYPE +
+								RelevanceConstants.R_ENUM + RelevanceConstants.R_ENUM_CONSTANT +
+								RelevanceConstants.R_UNQUALIFIED + RelevanceConstants.R_NON_RESTRICTED)+ "}",
+						requestor.getResults());
+	}
+	public void test004() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(MyDay day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATURDAY, SUNDAY, MOND -> \n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n" + 
+				"enum MyDay { SATURDAY, SUNDAY, MONDAY}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "MOND";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"MONDAY[FIELD_REF]{MONDAY, LMyDay;, LMyDay;, MONDAY, null, "+ 
+						(RelevanceConstants.R_DEFAULT + RelevanceConstants.R_RESOLVED + RelevanceConstants.R_INTERESTING+
+								RelevanceConstants.R_CASE + RelevanceConstants.R_EXACT_EXPECTED_TYPE +
+								RelevanceConstants.R_ENUM + RelevanceConstants.R_ENUM_CONSTANT +
+								RelevanceConstants.R_UNQUALIFIED + RelevanceConstants.R_NON_RESTRICTED)+ "}",
+						requestor.getResults());
+	}
+	public void test005() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(MyDay day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATURDAY, SUND, MONDAY -> \n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n" + 
+				"enum MyDay { SATURDAY, SUNDAY, MONDAY}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "SUND";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"SUNDAY[FIELD_REF]{SUNDAY, LMyDay;, LMyDay;, SUNDAY, null, "+ 
+						(RelevanceConstants.R_DEFAULT + RelevanceConstants.R_RESOLVED + RelevanceConstants.R_INTERESTING+
+								RelevanceConstants.R_CASE + RelevanceConstants.R_EXACT_EXPECTED_TYPE +
+								RelevanceConstants.R_ENUM + RelevanceConstants.R_ENUM_CONSTANT +
+								RelevanceConstants.R_UNQUALIFIED + RelevanceConstants.R_NON_RESTRICTED)+ "}",
+						requestor.getResults());
+	}
+	public void test005a() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(MyDay day) {\n" + 
+						"		switch (day) {\n" + 
+						"		case SATURDAY, SUNDAY -> \n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		case MON -> \n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n" + 
+				"enum MyDay { SATURDAY, SUNDAY, MONDAY}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "case MON";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"MONDAY[FIELD_REF]{MONDAY, LMyDay;, LMyDay;, MONDAY, null, "+ 
+						(RelevanceConstants.R_DEFAULT + RelevanceConstants.R_RESOLVED + RelevanceConstants.R_INTERESTING+
+								RelevanceConstants.R_CASE + RelevanceConstants.R_EXACT_EXPECTED_TYPE +
+								RelevanceConstants.R_ENUM + RelevanceConstants.R_ENUM_CONSTANT +
+								RelevanceConstants.R_UNQUALIFIED + RelevanceConstants.R_NON_RESTRICTED)+ "}",
+						requestor.getResults());
+	}
+	public void test006() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(MyDay day) {\n" + 
+						"		switch (day.toS) {\n" + 
+						"		case \"SATURDAY\" -> \n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n" + 
+						"enum MyDay { SATURDAY, SUNDAY}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "day.toS";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, 60}",
+						requestor.getResults());
+	}
+	public void test007() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(MyDay day) {\n" + 
+						"		switch (day.o) {\n" + 
+						"		case 0 -> \n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n" + 
+						"enum MyDay { SATURDAY, SUNDAY}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "day.o";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"ordinal[METHOD_REF]{ordinal(), Ljava.lang.Enum<LMyDay;>;, ()I, ordinal, null, 60}",
+						requestor.getResults());
+	}
+	public void test008() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(MyDay day) {\n" + 
+						"		switch (1 + day.o) {\n" + 
+						"		case 0 -> \n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n" + 
+						"enum MyDay { SATURDAY, SUNDAY}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "day.o";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"ordinal[METHOD_REF]{ordinal(), Ljava.lang.Enum<LMyDay;>;, ()I, ordinal, null, 90}",
+						requestor.getResults());
+	}
+	public void test009() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(MyDay day) {\n" + 
+						"		switch (1 + da) {\n" + 
+						"		case 0 -> \n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n" + 
+						"enum MyDay { SATURDAY, SUNDAY}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "1 + da";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"day[LOCAL_VARIABLE_REF]{day, null, LMyDay;, day, null, 52}",
+						requestor.getResults());
+	}
+	public void test010() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(MyDay day) {\n" + 
+						"		switch (1 + da + 1) {\n" + 
+						"		case 0 -> \n" + 
+						"			System.out.println(day.toString());\n" + 
+						"		}\n" + 
+						"	}\n" + 
+						"	public static void main(String[] args) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n" + 
+						"enum MyDay { SATURDAY, SUNDAY}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "1 + da";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"day[LOCAL_VARIABLE_REF]{day, null, LMyDay;, day, null, 52}",
+						requestor.getResults());
+	}
+	public void test011() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(int arg0) {\n" + 
+						"		foo(\n" + 
+						"		switch (arg) {\n" + 
+						"		case 1 -> 1;\n" + 
+						"		default -> 0;\n" +
+						"		}\n" + 
+						"	});\n" + 
+						"	public static void foo(int arg0) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "switch (arg";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"arg0[LOCAL_VARIABLE_REF]{arg0, null, I, arg0, null, 52}",
+						requestor.getResults());
+	}
+	public void test012() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(int arg0) {\n" + 
+						"		foo(\n" + 
+						"		switch (arg0) {\n" + 
+						"		case 1 -> arg;\n" + 
+						"		default -> 0;\n" +
+						"		}\n" + 
+						"	});\n" + 
+						"	public static void foo(int arg0) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "-> arg";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"arg0[LOCAL_VARIABLE_REF]{arg0, null, I, arg0, null, 52}",
+						requestor.getResults());
+	}
+	public void test013() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/Switch.java",
+				"public class Switch {\n" + 
+						"	public static void bar(int arg0) {\n" + 
+						"		foo(\n" + 
+						"		switch (0 + arg) {\n" + 
+						"		case 1 -> 1;\n" + 
+						"		default -> 0;\n" +
+						"		}\n" + 
+						"	});\n" + 
+						"	public static void foo(int arg0) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "0 + arg";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"arg0[LOCAL_VARIABLE_REF]{arg0, null, I, arg0, null, 82}",
+						requestor.getResults());
+	}
+	public void test014() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"public class X {\n" + 
+						"	public static void bar(int arg0) {\n" + 
+						"		foo(\n" + 
+						"		swi);\n" + 
+						"	public static void foo(int arg0) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "swi";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"switch[KEYWORD]{switch, null, null, switch, null, 49}",
+						requestor.getResults());
+	}
+	public void _test015() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"public class Switch {\n" + 
+						"	public static void bar(int arg0) {\n" + 
+						"		foo(\n" + 
+						"		switch (0 + arg0) {\n" + 
+						"		case 1 -> {break ar;}\n" + 
+						"		default -> 0;\n" +
+						"		}\n" + 
+						"	});\n" + 
+						"	public static void foo(int arg0) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "break ar";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"arg0[LOCAL_VARIABLE_REF]{arg0, null, I, arg0, null, 52}",
+						requestor.getResults());
+	}
+	public void test016() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"public class Switch {\n" + 
+						"	public static void bar(int arg0) {\n" + 
+						"		foo(\n" + 
+						"		switch (0 + arg0) {\n" + 
+						"		case 1 -> {break 1;}\n" + 
+						"		default -> ar;\n" +
+						"		}\n" + 
+						"	});\n" + 
+						"	public static void foo(int arg0) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "-> ar";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"arg0[LOCAL_VARIABLE_REF]{arg0, null, I, arg0, null, 52}",
+						requestor.getResults());
+	}
+	public void _test017() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"public class Switch {\n" + 
+						"	public static void bar(int arg0) {\n" + 
+						"		int arg1 = 0;\n" + 
+						"		foo(\n" + 
+						"		switch (0 + arg0) {\n" + 
+						"		case 1 -> 1;\n" + 
+						"		default -> {break ar;}\n" +
+						"		}\n" + 
+						"	});\n" + 
+						"	public static void foo(int arg0) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "break ar";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"arg0[LOCAL_VARIABLE_REF]{arg0, null, I, arg0, null, 52}",
+						requestor.getResults());
+	}
+	public void _test017a() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"public class Switch {\n" + 
+						"	public static void bar(int arg0) {\n" + 
+						"		foo(\n" + 
+						"		argLabel: switch (0 + arg0) {\n" + 
+						"		case 1 -> 1;\n" + 
+						"		default -> {break ar;}\n" +
+						"		}\n" + 
+						"	});\n" + 
+						"	public static void foo(int arg0) {\n" + 
+						"		bar(MyDay.SUNDAY);\n" + 
+						"	}\n" + 
+						"}\n");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "break ar";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"arg0[LOCAL_VARIABLE_REF]{arg0, null, I, arg0, null, 52}\n" +
+				"argLabel[LABEL_REF]{argLabel, null, null, argLabel, null, 49}",
+						requestor.getResults());
+	}
+	public void test018a() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"import org.eclipse.jdt.annotation.*;\n" + 
+				"import java.util.function.*;\n" + 
+				"interface IN0 {} \n" + 
+				"interface IN1 extends IN0 {} \n" + 
+				"interface IN2 extends IN0 {}\n" + 
+				"public class X {\n" + 
+				"	@NonNull IN1 n_1() { return new IN1() {}; } \n" + 
+				"	IN2 n_2() { return null; } \n" + 
+				"	<M> void m(@NonNull Supplier<@NonNull M> m2) { } \n" + 
+				"	void testSw(int i) { \n" + 
+				"		m(switch(i) { \n" + 
+				"			case 1 -> this::n_; \n" + 
+				"			case 2 -> () -> n1(); \n" + 
+				"			case 3 -> null; \n" + 
+				"			case 4 -> () -> n2(); \n" + 
+				"			default -> this::n2; }); \n" + 
+				"	}\n" + 
+				"}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "this::n_";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"n_1[METHOD_NAME_REFERENCE]{n_1, LX;, ()LIN1;, n_1, null, 60}\n" + 
+				"n_2[METHOD_NAME_REFERENCE]{n_2, LX;, ()LIN2;, n_2, null, 60}",
+						requestor.getResults());
+	}
+	public void test018b() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"import org.eclipse.jdt.annotation.*;\n" + 
+				"interface IN0 {} \n" + 
+				"interface IN1 extends IN0 {} \n" + 
+				"interface IN2 extends IN0 {}\n" + 
+				"public class X {\n" + 
+				"	@NonNull IN1 n_1() { return new IN1() {}; } \n" + 
+				"	IN2 n_2() { return null; } \n" + 
+				"	<M> void m(@NonNull Supplier<@NonNull M> m2) { } \n" + 
+				"	void testSw(int i) { \n" + 
+				"		m(switch(i) { \n" + 
+				"			case 2 -> () -> n_; \n" + 
+				"	}\n" + 
+				"}\n" +
+				"interface Supplier<T> {\n" + 
+				"    T get();\n" + 
+				"}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "-> n_";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"n_1[METHOD_REF]{n_1(), LX;, ()LIN1;, n_1, null, 52}\n" + 
+				"n_2[METHOD_REF]{n_2(), LX;, ()LIN2;, n_2, null, 52}",
+						requestor.getResults());
+	}
+	public void test018c() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"import org.eclipse.jdt.annotation.*;\n" + 
+				"interface IN0 {} \n" + 
+				"interface IN1 extends IN0 {} \n" + 
+				"interface IN2 extends IN0 {}\n" + 
+				"public class X {\n" + 
+				"	@NonNull IN1 n_1() { return new IN1() {}; } \n" + 
+				"	IN2 n_2() { return null; } \n" + 
+				"	<M> void m(@NonNull Supplier<@NonNull M> m2) { } \n" + 
+				"	void testSw(int i) { \n" + 
+				"		m(switch(i) { \n" + 
+				"			default -> this::n_; }); \n" + 
+				"	}\n" + 
+				"}\n" +
+				"interface Supplier<T> {\n" + 
+				"    T get();\n" + 
+				"}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "this::n_";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"n_1[METHOD_NAME_REFERENCE]{n_1, LX;, ()LIN1;, n_1, null, 60}\n" + 
+				"n_2[METHOD_NAME_REFERENCE]{n_2, LX;, ()LIN2;, n_2, null, 60}",
+						requestor.getResults());
+	}
+	public void test018d() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"import org.eclipse.jdt.annotation.*;\n" + 
+				"interface IN0 {} \n" + 
+				"interface IN1 extends IN0 {} \n" + 
+				"interface IN2 extends IN0 {}\n" + 
+				"public class X {\n" + 
+				"	@NonNull IN1 n_1() { return new IN1() {}; } \n" + 
+				"	IN2 n_2() { return null; } \n" + 
+				"	<M> void m(@NonNull Supplier<@NonNull M> m2) { } \n" + 
+				"	void testSw(int i) { \n" + 
+				"		m(switch(i) { \n" + 
+				"			default -> () -> n_; }); \n" + 
+				"	}\n" + 
+				"}\n" +
+				"interface Supplier<T> {\n" + 
+				"    T get();\n" + 
+				"}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "() -> n_";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"n_1[METHOD_REF]{n_1(), LX;, ()LIN1;, n_1, null, 52}\n" + 
+				"n_2[METHOD_REF]{n_2(), LX;, ()LIN2;, n_2, null, 52}",
+						requestor.getResults());
+	}
+	public void test018e() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"import org.eclipse.jdt.annotation.*;\n" + 
+				"interface IN0 {} \n" + 
+				"interface IN1 extends IN0 {} \n" + 
+				"interface IN2 extends IN0 {}\n" + 
+				"public class X {\n" + 
+				"	@NonNull IN1 n_1() { return new IN1() {}; } \n" + 
+				"	IN2 n_2() { return null; } \n" + 
+				"	<M> void m(@NonNull Supplier<@NonNull M> m2) { } \n" + 
+				"	void testSw(int i) { \n" + 
+				"		m(switch(i) { \n" + 
+				"			case 1 -> this::n_1; \n" + 
+				"			case 2 -> () -> n_; \n" + 
+				"	}\n" + 
+				"}\n" +
+				"interface Supplier<T> {\n" + 
+				"    T get();\n" + 
+				"}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "() -> n_";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"n_1[LOCAL_VARIABLE_REF]{n_1, null, Ljava.lang.Object;, n_1, null, 51}\n" + 
+				"n_1[METHOD_REF]{n_1(), LX;, ()LIN1;, n_1, null, 52}\n" + 
+				"n_2[METHOD_REF]{n_2(), LX;, ()LIN2;, n_2, null, 52}",
+						requestor.getResults());
+	}
+	public void test018f() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"import org.eclipse.jdt.annotation.*;\n" + 
+				"interface IN0 {} \n" + 
+				"interface IN1 extends IN0 {} \n" + 
+				"interface IN2 extends IN0 {}\n" + 
+				"public class X {\n" + 
+				"	@NonNull IN1 n_1() { return new IN1() {}; } \n" + 
+				"	IN2 n_2() { return null; } \n" + 
+				"	<M> void m(@NonNull Supplier<@NonNull M> m2) { } \n" + 
+				"	void testSw(int i) { \n" + 
+				"		m(switch(i) { \n" + 
+				"			case 1 -> () -> n_1; \n" + 
+				"			case 2 -> this::n_; \n" + 
+				"	}\n" + 
+				"}\n" +
+				"interface Supplier<T> {\n" + 
+				"    T get();\n" + 
+				"}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "this::n_";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"n_1[METHOD_NAME_REFERENCE]{n_1, LX;, ()LIN1;, n_1, null, 60}\n" + 
+				"n_2[METHOD_NAME_REFERENCE]{n_2, LX;, ()LIN2;, n_2, null, 60}",
+						requestor.getResults());
+	}
+	public void test019() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"import org.eclipse.jdt.annotation.*;\n" + 
+				"	<M> void m(@NonNull Supplier<@NonNull M> m2) { } \n" + 
+				"public class X {\n" + 
+				"	void testSw(int i) { \n" + 
+				"		m(swi);\n" + 
+				"}\n" +
+				"interface Supplier<T> {\n" + 
+				"    T get();\n" + 
+				"}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "swi";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"switch[KEYWORD]{switch, null, null, switch, null, 49}",
+						requestor.getResults());
+	}
+	public void test020() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"public class X {\n" + 
+				"	static final String MONDAY = \"MONDAY\";\n" + 
+				"	static final String TUESDAY = \"TUESDAY\";\n" + 
+				"	static final String WEDNESDAY = \"WEDNESDAY\";\n" + 
+				"	static final String THURSDAY = \"THURSDAY\";\n" + 
+				"	static final String FRIDAY = \"FRIDAY\";\n" + 
+				"	static final String SATURDAY = \"SATURDAY\";\n" + 
+				"	static final String SUNDAY = \"SUNDAY\"; \n" + 
+				"	@SuppressWarnings(\"preview\")\n" + 
+				"	public static void main(String[] args) {\n" + 
+				"		String day = \"MONDAY\";\n" + 
+				"		switch (day) {\n" + 
+				"		    case MONDAY, FRIDAY, SUNDAY  -> System.out.println(6);\n" + 
+				"		    case TUESDAY           		 -> System.out.println(7);\n" + 
+				"		    case THURSDAY, SATURDAY     -> System.out.println(8);\n" + 
+				"		    case WEDNESDAY              -> System.out.println(9);\n" + 
+				"		}\n" + 
+				"		int k = switch (day) {\n" + 
+				"	    case MONDAY  -> throw new NullPointerException();\n" + 
+				"	    case TUESDAY -> 1;\n" + 
+				"	    case WEDNESDAY -> {break 10;}\n" + 
+				"	    default      -> {\n" + 
+				"	        int g = day.h();\n" + 
+				"	        int result = f(g);\n" + 
+				"	        break result;\n" + 
+				"	    }};\n" + 
+				"	}\n" + 
+				"	static int f(int k) {\n" + 
+				"		return k*k;\n" + 
+				"	}\n" + 
+				"}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "day.h";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"hashCode[METHOD_REF]{hashCode, Ljava.lang.Object;, ()I, hashCode, null, 90}",
+						requestor.getResults());
+	}
+	public void test021() throws JavaModelException {
+		this.workingCopies = new ICompilationUnit[1];
+		this.workingCopies[0] = getWorkingCopy(
+				"/Completion/src/X.java",
+				"public class X {\n" + 
+				"	static final String MONDAY = \"MONDAY\";\n" + 
+				"	static final String TUESDAY = \"TUESDAY\";\n" + 
+				"	static final String WEDNESDAY = \"WEDNESDAY\";\n" + 
+				"	static final String THURSDAY = \"THURSDAY\";\n" + 
+				"	static final String FRIDAY = \"FRIDAY\";\n" + 
+				"	static final String SATURDAY = \"SATURDAY\";\n" + 
+				"	static final String SUNDAY = \"SUNDAY\"; \n" + 
+				"	@SuppressWarnings(\"preview\")\n" + 
+				"	public static void main(String[] args) {\n" + 
+				"		String day = \"MONDAY\";\n" + 
+				"		int k = switch (day) {\n" + 
+				"	    case MONDAY  -> throw new NullPointerException();\n" + 
+				"	    case TUESDAY -> 1;\n" + 
+				"	    case WEDNESDAY -> {break 10;}\n" + 
+				"	    default      -> {\n" + 
+				"	        int g = day.h();\n" + 
+				"	        int result = f(g);\n" + 
+				"	        break result;\n" + 
+				"	    }};\n" + 
+				"	}\n" + 
+				"	static int f(int k) {\n" + 
+				"		return k*k;\n" + 
+				"	}\n" + 
+				"}");
+		CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+		requestor.allowAllRequiredProposals();
+		String str = this.workingCopies[0].getSource();
+		String completeBehind = "day.h";
+		int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+		this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+		assertResults(
+				"hashCode[METHOD_REF]{hashCode, Ljava.lang.Object;, ()I, hashCode, null, 90}",
+						requestor.getResults());
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java
index e5d2894..0fb4f79 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java
@@ -120,10 +120,11 @@
 	assertTrue(JavaCore.compareJavaVersions("9", "1.8") > 0);
 	assertTrue(JavaCore.compareJavaVersions("9.0.1", "9.1.2") == 0);
 	assertTrue(JavaCore.compareJavaVersions("9", "9.1.2") == 0);
+	assertTrue(JavaCore.compareJavaVersions("12", "11") > 0);
+	assertTrue(JavaCore.compareJavaVersions("12", "1.5") > 0);
 	String latest = JavaCore.latestSupportedJavaVersion();
 	String latestPlus = "" + (Integer.parseInt(latest) + 1);
 	assertTrue(JavaCore.compareJavaVersions(latest, latestPlus) == 0);
-	
 }
 }
 
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs12Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs12Tests.java
new file mode 100644
index 0000000..c1fced3
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs12Tests.java
@@ -0,0 +1,626 @@
+/*******************************************************************************
+ * Copyright (c) 2019 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.model;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.WorkingCopyOwner;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.ReferenceMatch;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.TypeReferenceMatch;
+
+import junit.framework.Test;
+
+public class JavaSearchBugs12Tests extends AbstractJavaSearchTests {
+
+	static {
+//	 org.eclipse.jdt.internal.core.search.BasicSearchEngine.VERBOSE = true;
+//		TESTS_NUMBERS = new int[] { 19 };
+//		TESTS_RANGE = new int[] { 1, -1 };
+//		TESTS_NAMES = new String[] {"testBug542559_001"};
+}
+
+public JavaSearchBugs12Tests(String name) {
+	super(name);
+	this.endChar = "";
+}
+public static Test suite() {
+	return buildModelTestSuite(JavaSearchBugs12Tests.class, BYTECODE_DECLARATION_ORDER);
+}
+class TestCollector extends JavaSearchResultCollector {
+	public void acceptSearchMatch(SearchMatch searchMatch) throws CoreException {
+		super.acceptSearchMatch(searchMatch);
+	}
+}
+class ReferenceCollector extends JavaSearchResultCollector {
+	protected void writeLine() throws CoreException {
+		super.writeLine();
+		ReferenceMatch refMatch = (ReferenceMatch) this.match;
+		IJavaElement localElement = refMatch.getLocalElement();
+		if (localElement != null) {
+			this.line.append("+[");
+			if (localElement.getElementType() == IJavaElement.ANNOTATION) {
+				this.line.append('@');
+				this.line.append(localElement.getElementName());
+				this.line.append(" on ");
+				this.line.append(localElement.getParent().getElementName());
+			} else {
+				this.line.append(localElement.getElementName());
+			}
+			this.line.append(']');
+		}
+	}
+
+}
+class TypeReferenceCollector extends ReferenceCollector {
+	protected void writeLine() throws CoreException {
+		super.writeLine();
+		TypeReferenceMatch typeRefMatch = (TypeReferenceMatch) this.match;
+		IJavaElement[] others = typeRefMatch.getOtherElements();
+		int length = others==null ? 0 : others.length;
+		if (length > 0) {
+			this.line.append("+[");
+			for (int i=0; i<length; i++) {
+				IJavaElement other = others[i];
+				if (i>0) this.line.append(',');
+				if (other.getElementType() == IJavaElement.ANNOTATION) {
+					this.line.append('@');
+					this.line.append(other.getElementName());
+					this.line.append(" on ");
+					this.line.append(other.getParent().getElementName());
+				} else {
+					this.line.append(other.getElementName());
+				}
+			}
+			this.line.append(']');
+		}
+	}
+}
+
+IJavaSearchScope getJavaSearchScope() {
+	return SearchEngine.createJavaSearchScope(new IJavaProject[] {getJavaProject("JavaSearchBugs")});
+}
+IJavaSearchScope getJavaSearchScopeBugs(String packageName, boolean addSubpackages) throws JavaModelException {
+	if (packageName == null) return getJavaSearchScope();
+	return getJavaSearchPackageScope("JavaSearchBugs", packageName, addSubpackages);
+}
+public ICompilationUnit getWorkingCopy(String path, String source) throws JavaModelException {
+	if (this.wcOwner == null) {
+		this.wcOwner = new WorkingCopyOwner() {};
+	}
+	return getWorkingCopy(path, source, this.wcOwner);
+}
+@Override
+public void setUpSuite() throws Exception {
+	super.setUpSuite();
+	JAVA_PROJECT = setUpJavaProject("JavaSearchBugs", "12");
+}
+public void tearDownSuite() throws Exception {
+	deleteProject("JavaSearchBugs");
+	super.tearDownSuite();
+}
+protected void setUp () throws Exception {
+	super.setUp();
+	this.resultCollector = new TestCollector();
+	this.resultCollector.showAccuracy(true);
+}
+
+public void testBug542559_001() throws CoreException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
+			"public class X {\n" +
+			"	int switch_expr_field = 10;\n" +
+			"	int twice(int i) {\n" +
+			"		int tw = switch (i) {\n" +
+			"			case 0 -> switch_expr_field * 0;\n" +
+			"			case 1 -> 2;\n" +
+			"			default -> 3;\n" +
+			"		};\n" +
+			"		return tw;\n" +
+			"	}\n" +
+			"	public static void main(String... args) {\n" +
+			"		System.out.print(new X().twice(3));\n" +
+			"	}\n" +
+			"}\n"
+			);
+	IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
+	String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+	try {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		search("switch_expr_field", FIELD, REFERENCES);
+		assertSearchResults("src/X.java int X.twice(int) [switch_expr_field] EXACT_MATCH");
+	} finally {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+	}
+}
+public void testBug542559_002() throws CoreException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
+			"public class X {\n" +
+			"	int switch_expr_field = 10;\n" +
+			"	int twice(int i) {\n" +
+			"		int tw = switch (i) {\n" +
+			"			case 0 -> switch_expr_field * 0;\n" +
+			"			case 1 -> { break switch_expr_field; }\n" +
+			"			default -> 3;\n" +
+			"		};\n" +
+			"		return tw;\n" +
+			"	}\n" +
+			"	public static void main(String... args) {\n" +
+			"		System.out.print(new X().twice(3));\n" +
+			"	}\n" +
+			"}\n"
+			);
+	IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
+	String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+	try {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		search("switch_expr_field", FIELD, REFERENCES);
+		assertSearchResults(
+				"src/X.java int X.twice(int) [switch_expr_field] EXACT_MATCH\n" +
+				"src/X.java int X.twice(int) [switch_expr_field] EXACT_MATCH"
+		);
+	} finally {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+	}
+}
+public void testBug542559_003() throws CoreException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
+			"public class X {\n" +
+			"        int switch_expr_field = 10; \n" +
+			"        int twice(int i) throws Exception {      \n" +
+			"                int tw = switch (i) {   \n" +
+			"                        case 0 -> { break switch_expr_field; }  \n" +
+			"                        case 4 -> throw new MyException();  \n" +
+			"                        default -> 3;           \n" +
+			"                };      \n" +
+			"                return tw;              \n" +
+			"        }               \n" +
+			"        public static void main(String[] args) {\n" +
+			"                try {\n" +
+			"                                       System.out.print(new X().twice(3));\n" +
+			"                               } catch (Exception e) {\n" +
+			"                                       // TODO Auto-generated catch block\n" +
+			"                                       e.printStackTrace();\n" +
+			"                               }\n" +
+			"        }               \n" +
+			"}\n" +
+			"class MyException extends Exception {\n" +
+			"       private static final long serialVersionUID = 3461899582505930474L;\n" +
+			"       \n" +
+			"}\n"
+			);
+	IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
+	String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+	try {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		IType type = this.workingCopies[0].getType("MyException");
+		search(type, REFERENCES);
+		assertSearchResults(
+				"src/X.java int X.twice(int) [MyException] EXACT_MATCH"
+		);
+	} finally {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+	}
+}
+/*
+ * java search reference for an integer in default block of switch expression
+ */
+public void testBug542559_004() throws CoreException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
+			"public class X {\n" +
+			"	int switch_expr_field = 10;\n" +
+			"	int twice(int i) {\n" +
+			"		int tw = switch (i) {\n" +
+			"			case 0 -> switch_expr_field * 0;\n" +
+			"			case 1 -> 2;\n" +
+			"			default ->{ \n" +
+			"			switch_expr_field*9; \n" +
+			"		}};\n" +
+			"		return tw;\n" +
+			"	}\n" +
+			"	public static void main(String... args) {\n" +
+			"		System.out.print(new X().twice(3));\n" +
+			"	}\n" +
+			"}\n"
+			);
+	IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
+	String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+	try {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		search("switch_expr_field", FIELD, REFERENCES);
+		assertSearchResults(
+				"src/X.java int X.twice(int) [switch_expr_field] EXACT_MATCH\n" +
+				"src/X.java int X.twice(int) [switch_expr_field] EXACT_MATCH"
+		);
+	} finally {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+	}
+}
+
+/*
+ * java search reference for an integer in default of switch expression
+ */
+public void testBug542559_005() throws CoreException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
+			"public class X {\n" +
+			"	int switch_expr_field = 10;\n" +
+			"	int twice(int i) {\n" +
+			"		int tw = switch (i) {\n" +
+			"			case 0 -> switch_expr_field * 0;\n" +
+			"			case 1 -> 2;\n" +
+			"			default -> switch_expr_field*9;\n" +
+			"		};\n" +
+			"		return tw;\n" +
+			"	}\n" +
+			"	public static void main(String... args) {\n" +
+			"		System.out.print(new X().twice(3));\n" +
+			"	}\n" +
+			"}\n"
+			);
+	IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
+	String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+	try {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		search("switch_expr_field", FIELD, REFERENCES);
+		assertSearchResults(
+				"src/X.java int X.twice(int) [switch_expr_field] EXACT_MATCH\n" +
+				"src/X.java int X.twice(int) [switch_expr_field] EXACT_MATCH"
+		);
+	} finally {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+	}
+}
+
+/*
+ * java search reference for simple multi constant case statement for enum
+ */
+public void testBug542559_006() throws CoreException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
+			"public class X {\n" +
+					"enum Day { SATURDAY, SUNDAY, MONDAY;}\n" +
+					"public static void bar(Day day) {\n" +
+					"		switch (day) {\n" +
+					"		case SATURDAY, SUNDAY: \n" +
+					"			System.out.println(Day.SUNDAY);\n" +
+					"			break;\n" +
+					"		case MONDAY : System.out.println(Day.MONDAY);\n" +
+					"					break;\n" +
+					"		}\n" +
+					"	}" +
+					"	public static void main(String[] args) {\n" +
+					"		bar(Day.SATURDAY);\n" +
+					"	}\n"
+					+
+					"}\n"
+			);
+	IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
+	String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+	try {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		search("SATURDAY", FIELD, REFERENCES);
+		assertSearchResults(
+				"src/X.java void X.bar(Day) [SATURDAY] EXACT_MATCH\n"+
+				"src/X.java void X.main(String[]) [SATURDAY] EXACT_MATCH"
+		);
+	} finally {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+	}
+}
+/*
+ * java search reference for simple multi constant case statement for enum, 2nd case
+ */
+public void testBug542559_007() throws CoreException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
+			"public class X {\n" +
+					"enum Day { SATURDAY, SUNDAY, MONDAY;}\n" +
+					"public static void bar(Day day) {\n" +
+					"		switch (day) {\n" +
+					"		case SATURDAY, SUNDAY: \n" +
+					"			System.out.println(Day.SUNDAY);\n" +
+					"			break;\n" +
+					"		case MONDAY : System.out.println(Day.MONDAY);\n" +
+					"					break;\n" +
+					"		}\n" +
+					"	}" +
+					"	public static void main(String[] args) {\n" +
+					"		bar(Day.SATURDAY);\n" +
+					"	}\n"
+					+
+					"}\n"
+			);
+	IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
+	String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+	try {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		search("SUNDAY", FIELD, REFERENCES);
+		assertSearchResults(
+				"src/X.java void X.bar(Day) [SUNDAY] EXACT_MATCH\n"+
+				"src/X.java void X.bar(Day) [SUNDAY] EXACT_MATCH"
+		);
+	} finally {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+	}
+}
+
+/*
+ * java search reference for class file reference in switch expression
+ */
+public void testBug542559_008() throws CoreException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X2.java",
+			"public class X2 {\n" +
+			"   String s = new String();        \n" +
+			"	int switch_expr_field = 10;\n" +
+			"	int twice(int i) {\n" +
+			"		int tw = switch (i) {\n" +
+			"			case 0 -> switch_expr_field * 0;\n" +
+			"			case 1 -> 2;\n" +
+			"			default -> new X2().toString().length();\n" +
+			"		};\n" +
+			"		return tw;\n" +
+			"	}\n" +
+			"	public static void main(String... args) {\n" +
+			"		System.out.print(new X2().twice(3));\n" +
+			"	}\n" +
+			"}\n"
+			);
+	IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
+	String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+	try {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		search("X2", CLASS, REFERENCES);
+		assertSearchResults(
+		"src/X2.java int X2.twice(int) [X2] EXACT_MATCH\n"+
+		"src/X2.java void X2.main(String ...) [X2] EXACT_MATCH");
+	} finally {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+	}
+}
+
+/*
+ * java search reference for class file reference in case and default blocks
+ */
+public void testBug542559_009() throws CoreException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
+			"public class X {\n" +
+					"	Integer abcd\n" +
+					"	public static int foo(int i) {\n" +
+					"		final int k;\n" +
+					"\n" +
+					"		int it = switch (i) { \n" +
+					"		case 1  ->   {\n" +
+					"			k = 1;\n" +
+					"			abcd.toString();\n" +
+					"			break k ;\n" +
+					"		}\n" +
+					"		case 2  ->   {\n" +
+					"			abcd.toString();\n" +
+					"			break k ;\n" +
+					"		}\n" +
+					"		default -> {\n" +
+					"			k = 3;\n" +
+					"			abcd.toString();\n" +
+					"			break k;\n" +
+					"		}\n" +
+					"		};\n" +
+					"		return k;\n" +
+					"	}\n" +
+					"\n" +
+					"	public boolean bar() {\n" +
+					"		return true;\n" +
+					"	}\n" +
+					"	public static void main(String[] args) {\n" +
+					"		System.out.println(foo(3));\n" +
+					"	}\n" +
+					"}\n"
+			);
+	IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
+	String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+	try {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		search("abcd", FIELD, REFERENCES);
+		assertSearchResults(
+				"src/X.java int X.foo(int) [abcd] EXACT_MATCH\n" +
+				"src/X.java int X.foo(int) [abcd] EXACT_MATCH\n" +
+				"src/X.java int X.foo(int) [abcd] EXACT_MATCH"
+		);
+	} finally {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+	}
+}
+
+/*
+ * java search reference for string constant in switch expression and switch statement
+ */
+public void testBug542559_0010() throws CoreException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
+			"public class X {\n" +
+					"	static final String MONDAY = \"MONDAY\";\n" +
+					"	static final String TUESDAY = \"TUESDAY\";\n" +
+					"	static final String WEDNESDAY = \"WEDNESDAY\";\n" +
+					"	static final String THURSDAY = \"THURSDAY\";\n" +
+					"	static final String FRIDAY = \"FRIDAY\";\n" +
+					"	static final String SATURDAY = \"SATURDAY\";\n" +
+					"	static final String SUNDAY = \"SUNDAY\"; \n" +
+					"	@SuppressWarnings(\"preview\")\n" +
+					"	public static void main(String[] args) {\n" +
+					"		String day = \"MONDAY\";\n" +
+					"		switch (day) {\n" +
+					"		    case MONDAY, FRIDAY, SUNDAY  -> System.out.println(6);\n" +
+					"		    case TUESDAY           		 -> System.out.println(7);\n" +
+					"		    case THURSDAY, SATURDAY     -> System.out.println(8);\n" +
+					"		    case WEDNESDAY              -> System.out.println(9);\n" +
+					"		}\n" +
+					"		int k = switch (day) {\n" +
+					"	    case SATURDAY  -> throw new NullPointerException();\n" +
+					"	    case TUESDAY -> 1;\n" +
+					"	    case WEDNESDAY -> {break 10;}\n" +
+					"	    default      -> {\n" +
+					"	        int g = day.h();\n" +
+					"	        int result = f(g);\n" +
+					"	        break result;\n" +
+					"	    }};\n" +
+					"	}\n" +
+					"	static int f(int k) {\n" +
+					"		return k*k;\n" +
+					"	}\n" +
+					"}\n"
+			);
+	IJavaProject javaProject = this.workingCopies[0].getJavaProject(); //assuming single project for all working copies
+	String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+	try {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		search("SATURDAY", FIELD, REFERENCES);
+		assertSearchResults(
+				"src/X.java void X.main(String[]) [SATURDAY] EXACT_MATCH\n" +
+				"src/X.java void X.main(String[]) [SATURDAY] EXACT_MATCH"
+		);
+	} finally {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+	}
+}
+/*
+ * java search a javatype reference from another java project if that is in switch expression
+ */
+public void testBug542559_0011() throws CoreException {
+	try {
+
+		IJavaProject project1 = createJavaProject("JavaSearchBugs12", new String[] {"src"}, new String[] {"JCL12_LIB"}, "bin", "12");
+		project1.open(null);
+		createFolder("/JavaSearchBugs12/src/pack1");
+		createFile("/JavaSearchBugs12/src/pack1/X11.java",
+				"package pack1;\n" +
+				"public class X11 { \n" +
+				"	static final String MONDAY = \"MONDAY\";\n" +
+				"	static final String TUESDAY = \"TUESDAY\";\n" +
+				"	static final String WEDNESDAY = \"WEDNESDAY\";\n" +
+				"	static final String THURSDAY = \"THURSDAY\";\n" +
+				"	static final String FRIDAY = \"FRIDAY\";\n" +
+				"	static final String SATURDAY = \"SATURDAY\";\n" +
+				"	static final String SUNDAY = \"SUNDAY\"; \n" +
+				"	@SuppressWarnings(\"preview\")\n" +
+				"	public static void main(String[] args) {\n" +
+				"		String day = \"MONDAY\";\n" +
+				"		switch (day) {\n" +
+				"		    case MONDAY, FRIDAY, SUNDAY  -> System.out.println(6);\n" +
+				"		    case TUESDAY           		 -> System.out.println(7);\n" +
+				"		    case THURSDAY, SATURDAY     -> System.out.println(8);\n" +
+				"		    case WEDNESDAY              -> System.out.println(9);\n" +
+				"		}\n" +
+				"		int k = switch (day) {\n" +
+				"	    case SATURDAY  -> throw new NullPointerException();\n" +
+				"	    case TUESDAY -> 1;\n" +
+				"	    case WEDNESDAY -> {break 10;}\n" +
+				"	    default      -> {\n" +
+				"	        pack2.X22.a2=99;\n" +
+				"	        int result = f(g);\n" +
+				"	        break result;\n" +
+				"	    }};\n" +
+				"	}\n" +
+				"	static int f(int k) {\n" +
+				"		return k*k;\n" +
+				"	}\n" +
+				 "}\n");
+
+		IJavaProject project2 = createJavaProject("second", new String[] {"src"},new String[] {"JCL12_LIB"}, "bin", "12");
+		project2.open(null);
+		createFolder("/second/src/pack2");
+		createFile("/second/src/pack2/X22.java",
+				"package pack2;\n" +
+				"public class X22 {public static int a2=9;}\n");
+		addClasspathEntry(project1, JavaCore.newProjectEntry(project2.getPath()));
+		project1.close(); // sync
+		project2.close();
+		project2.open(null);
+		project1.open(null);
+		IPackageFragment pkg = getPackageFragment("second", "src", "pack2");
+
+		IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaProject[]
+				{getJavaProject("JavaSearchBugs12")});
+
+		search(
+			pkg,
+			ALL_OCCURRENCES,
+			scope,
+			this.resultCollector);
+		String exp = "src/pack1/X11.java void pack1.X11.main(String[]) [pack2] EXACT_MATCH\n"
+		+"src/pack2 pack2 EXACT_MATCH";
+		assertSearchResults(
+			exp,
+			this.resultCollector);
+
+	}
+	finally {
+		deleteProject("JavaSearchBugs12");
+		deleteProject("second");
+	}
+
+}
+/*
+ * java search a method reference in switch expression
+ */
+public void testBug542559_0012() throws CoreException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/X.java",
+			"import java.util.function.Supplier;\n" +
+			"interface I0 { void i(); }\n" +
+			"interface I1 extends I0 {}\n" +
+			"interface I2 extends I0 {}\n" +
+			"public class X {\n" +
+			"	I1 n1() { return null; }\n" +
+			"	<I extends I2> I n2() { return null; }\n" +
+			"	<M> M m(Supplier<M> m) { return m.get(); }\n" +
+			"	void test(int i, boolean b) {\n" +
+			"		m(switch (i) {\n" +
+			"			case 1 -> this::n1;\n" +
+			"			default -> this::n2;\n" +
+			"		}).i(); \n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		try {\n" +
+			"			new X().test(1, true);\n" +
+			"		} catch (NullPointerException e) {\n" +
+			"			System.out.println(\"NPE as expected\");\n" +
+			"		}\n" +
+			"	}\n" +
+			"}\n"
+			);
+	IJavaProject javaProject = this.workingCopies[0].getJavaProject();//assuming single project for all working copies
+	String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true);
+	try {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
+		search("n1", METHOD, REFERENCES);
+		assertSearchResults("src/X.java void X.test(int, boolean) [n1] EXACT_MATCH");
+	} finally {
+		javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old);
+	}
+}
+
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java
index 8e5d3b4..39cde45 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
index ddc65ad..2a4edf1 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
@@ -60,8 +60,8 @@
 	}
 
 	static {
-//		 TESTS_NAMES = new String[] { "testBug522330" };
-	}
+//		 TESTS_NAMES = new String[] { "testReleaseOption8" };
+	} 
 	private String sourceWorkspacePath = null;
 	protected ProblemRequestor problemRequestor;
 	public static Test suite() {
@@ -4963,10 +4963,10 @@
 			getWorkingCopy("/Test/src/X.java", src, true);
 			assertProblems("should have not problems",
 					"----------\n" + 
-					"1. WARNING in /Test/src/X.java (at line 1)\n" + 
+					"1. ERROR in /Test/src/X.java (at line 1)\n" + 
 					"	import java.*;\n" + 
 					"	       ^^^^\n" + 
-					"The import java is never used\n" + 
+					"The package java is not accessible\n" + 
 					"----------\n",
 					this.problemRequestor);
 		} finally {
@@ -6184,6 +6184,7 @@
 	}
 
 	public void testBug526054() throws Exception {
+		if (!isJRE9) return;
 		ClasspathJrt.resetCaches();
 		try {
 			// jdk.rmic is not be visible to code in an unnamed module, but using requires we can see the module.
@@ -6807,6 +6808,7 @@
 		}
 	}
 	public void testBug527569c() throws CoreException {
+		if (!isJRE9) return;
 		IJavaProject p1 = createJava9Project("Bug527569", "1.7");
 		Map<String, String> options = new HashMap<>();
 		// Make sure the new options map doesn't reset.
@@ -6856,6 +6858,7 @@
 		}
 	}
 	public void testBug527569e() throws CoreException {
+		if (!isJRE9 || isJRE12) return;
 		IJavaProject p1 = createJava9Project("Bug527569", "1.8");
 		Map<String, String> options = new HashMap<>();
 		// Make sure the new options map doesn't reset.
@@ -7650,39 +7653,39 @@
 		}
 	}
 	public void testBug543195() throws CoreException {
-		IJavaProject pj1 = createJava9Project("p1");
-		IJavaProject pj2 = createJava9Project("p2");
+		IJavaProject pj1 = createJava9Project("pj1");
+		IJavaProject pj2 = createJava9Project("pj2");
 		IJavaProject ptest = createJava9Project("ptest");
 		try {
 			addModularProjectEntry(pj2, pj1);
 			addModularProjectEntry(ptest, pj2);
 
-			createFolder("p1/src/p");
-			createFile("p1/src/p/Missing.java",
+			createFolder("pj1/src/p");
+			createFile("pj1/src/p/Missing.java",
 					"package p;\n" +
 					"public class Missing {\n" +
 					"	public void miss() {}\n" +
 					"}\n");
-			createFile("p1/src/module-info.java",
-					"module p1 {\n" +
+			createFile("pj1/src/module-info.java",
+					"module pj1 {\n" +
 					"	exports p;\n" +
 					"}\n");
 
-			createFolder("p2/src/q");
-			createFile("p2/src/q/API.java",
+			createFolder("pj2/src/q");
+			createFile("pj2/src/q/API.java",
 					"package q;\n" +
 					"public class API extends p.Missing {}\n");
-			createFile("p2/src/q/API2.java",
+			createFile("pj2/src/q/API2.java",
 					"package q;\n" +
 					"public class API2 extends API {}\n");
-			createFile("p2/src/module-info.java",
-					"module p2 {\n" +
-					"	requires p1;\n" +
+			createFile("pj2/src/module-info.java",
+					"module pj2 {\n" +
+					"	requires pj1;\n" +
 					"	exports q;\n" +
 					"}\n");
 			getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
 
-			deleteFile("p1/bin/p/Missing.class");
+			deleteFile("pj1/bin/p/Missing.class");
 			pj1.getProject().close(null);
 
 			createFolder("ptest/src/p/r");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests12.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests12.java
new file mode 100644
index 0000000..6caa190
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests12.java
@@ -0,0 +1,608 @@
+/*******************************************************************************
+ * Copyright (c) 2019 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jdt.core.tests.model;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.WorkingCopyOwner;
+
+import junit.framework.Test;
+
+public class ResolveTests12 extends AbstractJavaModelTests {
+	ICompilationUnit wc = null;
+
+static {
+//	 TESTS_NAMES = new String[] { "test018" };
+	// TESTS_NUMBERS = new int[] { 124 };
+	// TESTS_RANGE = new int[] { 16, -1 };
+}
+public static Test suite() {
+	return buildModelTestSuite(ResolveTests12.class);
+}
+public ResolveTests12(String name) {
+	super(name);
+}
+public ICompilationUnit getWorkingCopy(String path, String source) throws JavaModelException {
+	return super.getWorkingCopy(path, source, this.wcOwner);
+}
+public void setUpSuite() throws Exception {
+	super.setUpSuite();
+	setUpJavaProject("Resolve", "12", false);
+	waitUntilIndexesReady();
+}
+protected void setUp() throws Exception {
+	super.setUp();
+	this.wcOwner = new WorkingCopyOwner(){};
+}
+public void tearDownSuite() throws Exception {
+	deleteProject("Resolve");
+	super.tearDownSuite();
+}
+
+protected void tearDown() throws Exception {
+	if (this.wc != null) {
+		this.wc.discardWorkingCopy();
+	}
+	super.tearDown();
+}
+/*
+ * Multi constant case statement with ':', selection node is the string constant
+ */
+public void test001() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"static final String ONE=\"One\", TWO = \"Two\", THREE=\"Three\";\n" +
+	"  public static void foo(String num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE:\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"}\n");
+
+	String str = this.wc.getSource();
+	String selection = "ONE";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"ONE [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with ':', selection node is the first enum constant
+ */
+public void test002() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"  public static void foo(Num num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE:\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "ONE";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"ONE [in Num [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with ':', selection node is the second string constant
+ */
+public void test003() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"static final String ONE=\"One\", TWO = \"Two\", THREE=\"Three\";\n" +
+	"  public static void foo(String num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE:\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "TWO";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"TWO [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with ':', selection node is the second enum constant
+ */
+public void test004() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"  public static void foo(Num num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE:\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "TWO";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"TWO [in Num [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection node is the string constant
+ */
+public void test005() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"static final String ONE=\"One\", TWO = \"Two\", THREE=\"Three\";\n" +
+	"  public static void foo(String num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE ->\n" +
+	"		 System.out.println(num);\n" +
+	"    }" +
+	"  }\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "ONE";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"ONE [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection node is the first enum constant
+ */
+public void test006() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"  public static void foo(Num num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE ->\n" +
+	"		 System.out.println(num);\n" +
+	"		 break; // illegal, but should be ignored and shouldn't matter\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "ONE";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"ONE [in Num [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection node is the second string constant
+ */
+public void test007() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"static final String ONE=\"One\", TWO = \"Two\", THREE=\"Three\";\n" +
+	"  public static void foo(String num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE ->\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "TWO";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"TWO [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection node is the second enum constant
+ */
+public void test008() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"  public static void foo(Num num) {\n" +
+	" 	 switch (num) {\n" +
+	"	   case ONE, TWO, THREE ->\n" +
+	"		 System.out.println(num);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "TWO";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"TWO [in Num [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection is a reference in the case block
+ * which same as the switch's expression
+ */
+public void test009() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"  public static void foo(Num num_) {\n" +
+	" 	 switch (num_) {\n" +
+	"	   case ONE, TWO, THREE ->\n" +
+	"		 System.out.println(num_);\n" +
+	"		 break;\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "num_";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"num_ [in foo(Num) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection is a reference in the case block
+ * which is referencing a local variable defined in the case block
+ */
+public void test010() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"  public static void foo(Num num_) {\n" +
+	" 	 switch (num_) {\n" +
+	"	   case ONE, TWO, THREE -> {\n" +
+	"		 int i_j = 0;" +
+	"		 System.out.println(i_j);\n" +
+	"		 break;" +
+	"		 }\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "i_j";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"i_j [in foo(Num) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type enum in switch expression
+ */
+public void test011() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"  public static void foo(Num num_) {\n" +
+	" 	 switch (num_) {\n" +
+	"	   case ONE, TWO, THREE -> {\n" +
+	"		 break;" +
+	"		 }\n" +
+	"    }" +
+	"  }\n" +
+	"	enum Num { ONE, TWO, THREE;}\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "num_";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"num_ [in foo(Num) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type int in switch expression
+ */
+public void test012() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"  public static void foo(int num_) {\n" +
+	" 	 switch (num_ + 1) {\n" +
+	"	   case 1, 2, 3 -> {\n" +
+	"		 break;" +
+	"		 }\n" +
+	"    }" +
+	"  }\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "num_";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"num_ [in foo(int) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type int in switch expression
+ */
+public void test013() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"  public static void foo(int num_) {\n" +
+	" 	 int i = switch (num_) {\n" +
+	"	   case 1, 2, 3 -> (num_ + 1);\n" +
+	"      default -> 0;\n" + 
+	"    }" +
+	"  }\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "num_";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"num_ [in foo(int) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type int in switch expression
+ */
+public void test014() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"  public static void foo(int num_) {\n" +
+	" 	 int i = switch (num_) {\n" +
+	"	   case 1, 2, 3 -> 0;\n" +
+	"      default -> (num_ + 1);\n" + 
+	"    }" +
+	"  }\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "num_";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"num_ [in foo(int) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type int in switch expression
+ */
+public void test015() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" +
+	"  public static void foo(int num_) {\n" +
+	" 	 int i = switch (num_) {\n" +
+	"	   case 1, 2, 3 -> 0;\n" +
+	"      default -> (num_ + 1);\n" + 
+	"    }" +
+	"  }\n" +
+	"}\n");
+	String str = this.wc.getSource();
+	String selection = "num_";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"num_ [in foo(int) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+/*
+ * Multi constant case statement with '->', selection is a referenced name of type int in switch expression
+ */
+public void test016() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" + 
+			"	public void bar(int s) {\n" + 
+			"		int i_j = switch (s) {\n" + 
+			"			case 1, 2, 3 -> (s+1);\n" +
+			"			default -> i_j;\n" + 
+			"		};\n" + 
+			"	}\n" + 
+			"}\n");
+	String str = this.wc.getSource();
+	String selection = "i_j";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"i_j [in bar(int) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+public void test017() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java","public class X {\n" + 
+			"	public void bar(int s) {\n" + 
+			"		int i_j = switch (s) {\n" + 
+			"			case 1, 2, 3 -> (s+1);\n" +
+			"			default -> (1+i_j);\n" + 
+			"		};\n" + 
+			"	}\n" + 
+			"}\n");
+	String str = this.wc.getSource();
+	String selection = "i_j";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"i_j [in bar(int) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+public void test018() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java",
+			"import java.util.function.*;\n" +
+			"interface IN0 {} \n" + 
+			"interface IN1 extends IN0 {} \n" + 
+			"interface IN2 extends IN0 {}\n" + 
+			"public class X {\n" + 
+			"	 IN1 n_1() { return new IN1() {}; } \n" + 
+			"	IN2 n_2() { return null; } \n" + 
+			"	<M> void m( Supplier< M> m2) { } \n" + 
+			"	void testSw(int i) { \n" + 
+			"		m(switch(i) { \n" + 
+			"			case 1 -> this::n_1; \n" + 
+			"			default -> this::n_2; }); \n" + 
+			"	}\n" + 
+			"}\n");
+	String str = this.wc.getSource();
+	String selection = "n_1";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"n_1() [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]",
+		elements
+	);
+}
+public void test019() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java",
+			"import java.util.function.*;\n" + 
+			"interface IN0 {} \n" + 
+			"interface IN1 extends IN0 {} \n" + 
+			"interface IN2 extends IN0 {}\n" + 
+			"public class X {\n" + 
+			"	 IN1 n_1() { return new IN1() {}; } \n" + 
+			"	IN2 n_2() { return null; } \n" + 
+			"	<M> void m( Supplier< M> m2) { } \n" + 
+			"	void testSw(int i) { \n" + 
+			"		m(switch(i) { \n" + 
+			"			case 2 -> () -> n_1(); \n" + 
+			"			default -> this::n_2; }); \n" + 
+			"	}\n" + 
+			"}\n");
+	String str = this.wc.getSource();
+	String selection = "n_1";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"n_1() [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]",
+		elements
+	);
+}
+public void test020() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java",
+			"import java.util.function.*;\n" + 
+			"interface IN0 {} \n" + 
+			"interface IN1 extends IN0 {} \n" + 
+			"interface IN2 extends IN0 {}\n" + 
+			"public class X {\n" + 
+			"	 IN1 n_1() { return new IN1() {}; } \n" + 
+			"	IN2 n_2() { return null; } \n" + 
+			"	<M> void m( Supplier< M> m2) { } \n" + 
+			"	void testSw(int i) { \n" + 
+			"		m(switch(i) { \n" + 
+			"			default -> this::n_2; }); \n" + 
+			"	}\n" + 
+			"}\n");
+	String str = this.wc.getSource();
+	String selection = "n_2";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"n_2() [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]",
+		elements
+	);
+}
+public void test021() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java",
+			"import java.util.function.*;\n" + 
+			"interface IN0 {} \n" + 
+			"interface IN1 extends IN0 {} \n" + 
+			"interface IN2 extends IN0 {}\n" + 
+			"public class X {\n" + 
+			"	 IN1 n_1(int ijk) { return new IN1() {}; } \n" + 
+			"	IN2 n_2() { return null; } \n" + 
+			"	<M> void m( Supplier< M> m2) { } \n" + 
+			"	void testSw(int ijk) { \n" + 
+			"		m(switch(ijk) { \n" + 
+			"			default -> () -> n_1(ijk); }); \n" + 
+			"	}\n" + 
+			"}\n");
+	String str = this.wc.getSource();
+	String selection = "n_1";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"n_1(int) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]",
+		elements
+	);
+}
+public void test022() throws JavaModelException {
+	this.wc = getWorkingCopy("/Resolve/src/X.java",
+			"import java.util.function.*;\n" + 
+			"interface IN0 {} \n" + 
+			"interface IN1 extends IN0 {} \n" + 
+			"interface IN2 extends IN0 {}\n" + 
+			"public class X {\n" + 
+			"	 IN1 n_1(int ijk) { return new IN1() {}; } \n" + 
+			"	IN2 n_2() { return null; } \n" + 
+			"	<M> void m( Supplier< M> m2) { } \n" + 
+			"	void testSw(int ijk) { \n" + 
+			"		m(switch(ijk) { \n" + 
+			"			default -> () -> n_1(ijk); }); \n" + 
+			"	}\n" + 
+			"}\n");
+	String str = this.wc.getSource();
+	String selection = "ijk";
+	int start = str.lastIndexOf(selection);
+	int length = selection.length();
+	IJavaElement[] elements = this.wc.codeSelect(start, length);
+	assertElementsEqual(
+		"Unexpected elements",
+		"ijk [in testSw(int) [in X [in [Working copy] X.java [in <default> [in src [in Resolve]]]]]]",
+		elements
+	);
+}
+}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunCompletionModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunCompletionModelTests.java
index dc7e1ac..348ad9c 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunCompletionModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunCompletionModelTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -41,6 +41,7 @@
 			COMPLETION_SUITES.add(CompletionTests9.class);
 			COMPLETION_SUITES.add(CompletionTests10.class);
 			COMPLETION_SUITES.add(CompletionTests11.class);
+			COMPLETION_SUITES.add(CompletionTests12.class);
 			COMPLETION_SUITES.add(CompletionContextTests.class);
 			COMPLETION_SUITES.add(CompletionContextTests_1_5.class);
 			COMPLETION_SUITES.add(CompletionWithMissingTypesTests.class);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingStatementsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingStatementsTest.java
index 433b855..bd6a6e6 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingStatementsTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingStatementsTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -3558,10 +3558,10 @@
 		buf.append("    }\n");
 		buf.append("}\n");
 		assertEqualString(preview, buf.toString());
-
 	}
 
 
+	@SuppressWarnings("deprecation")
 	public void testSwitchStatement() throws Exception {
 		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
 		StringBuffer buf= new StringBuffer();
@@ -3606,12 +3606,19 @@
 			assertTrue("Number of statements not 0", statements.size() == 0);
 
 			SwitchCase caseStatement1= ast.newSwitchCase();
-			caseStatement1.setExpression(ast.newNumberLiteral("1"));
+			if (this.apiLevel < AST.JLS12) {
+				caseStatement1.setExpression(ast.newNumberLiteral("1"));
+			}
+			else {
+				caseStatement1.expressions().add(ast.newNumberLiteral("1"));
+			}
 
 			Statement statement1= ast.newReturnStatement();
 
 			SwitchCase caseStatement2= ast.newSwitchCase(); // default
-			caseStatement2.setExpression(null);
+			if (this.apiLevel < AST.JLS12) {
+				caseStatement2.setExpression(null);
+			}
 
 			ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
 			listRewrite.insertLast(caseStatement1, null);
@@ -3634,14 +3641,25 @@
 			// change case statement
 			SwitchCase caseStatement= (SwitchCase) statements.get(3);
 			Expression newCaseExpression= ast.newNumberLiteral("10");
-			rewrite.replace(caseStatement.getExpression(), newCaseExpression, null);
+			if (this.apiLevel < AST.JLS12) {
+				rewrite.replace(caseStatement.getExpression(), newCaseExpression, null);
+			} else {
+				List expressions = caseStatement.expressions();
+				ListRewrite listRewrite= rewrite.getListRewrite(caseStatement, SwitchCase.EXPRESSIONS2_PROPERTY);
+				listRewrite.replace((Expression)expressions.get(0), newCaseExpression, null);
+			}
 
 			ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
 
 			{
 				// insert case statement
 				SwitchCase caseStatement2= ast.newSwitchCase();
-				caseStatement2.setExpression(ast.newNumberLiteral("11"));
+				if (this.apiLevel < AST.JLS12) {
+					caseStatement2.setExpression(ast.newNumberLiteral("11"));
+				}
+				else {
+					caseStatement2.expressions().add(ast.newNumberLiteral("11"));
+				}
 				listRewrite.insertFirst(caseStatement2, null);
 
 				// insert statement
@@ -3652,7 +3670,12 @@
 			{
 				// insert case statement
 				SwitchCase caseStatement2= ast.newSwitchCase();
-				caseStatement2.setExpression(ast.newNumberLiteral("12"));
+				if (this.apiLevel < AST.JLS12) {
+					caseStatement2.setExpression(ast.newNumberLiteral("12"));
+				}
+				else {
+					caseStatement2.expressions().add(ast.newNumberLiteral("12"));
+				}
 				listRewrite.insertLast(caseStatement2, null);
 
 				// insert statement
@@ -3691,6 +3714,7 @@
 
 	}
 	
+	@SuppressWarnings("deprecation")
 	public void testSwitchStatement2() throws Exception {
 		String previousValue = null;
 		try {
@@ -3741,12 +3765,19 @@
 				assertTrue("Number of statements not 0", statements.size() == 0);
 	
 				SwitchCase caseStatement1= ast.newSwitchCase();
-				caseStatement1.setExpression(ast.newNumberLiteral("1"));
+				if (this.apiLevel < AST.JLS12) {
+					caseStatement1.setExpression(ast.newNumberLiteral("1"));
+				}
+				else {
+					caseStatement1.expressions().add(ast.newNumberLiteral("1"));
+				}
 	
 				Statement statement1= ast.newReturnStatement();
 	
 				SwitchCase caseStatement2= ast.newSwitchCase(); // default
-				caseStatement2.setExpression(null);
+				if (this.apiLevel < AST.JLS12) {
+					caseStatement2.setExpression(null);
+				}
 	
 				ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
 				listRewrite.insertLast(caseStatement1, null);
@@ -3769,14 +3800,26 @@
 				// change case statement
 				SwitchCase caseStatement= (SwitchCase) statements.get(3);
 				Expression newCaseExpression= ast.newNumberLiteral("10");
-				rewrite.replace(caseStatement.getExpression(), newCaseExpression, null);
+				if (this.apiLevel < AST.JLS12) {
+					rewrite.replace(caseStatement.getExpression(), newCaseExpression, null);
+				} else {
+					List expressions = caseStatement.expressions();
+					ListRewrite listRewrite2= rewrite.getListRewrite(caseStatement, SwitchCase.EXPRESSIONS2_PROPERTY);
+					listRewrite2.replace((Expression)expressions.get(0), newCaseExpression, null);
+				}
 	
 				ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
 	
 				{
 					// insert case statement
 					SwitchCase caseStatement2= ast.newSwitchCase();
-					caseStatement2.setExpression(ast.newNumberLiteral("11"));
+					if (this.apiLevel < AST.JLS12) {
+						caseStatement2.setExpression(ast.newNumberLiteral("11"));
+					}
+					else {
+						caseStatement2.expressions().add(ast.newNumberLiteral("11"));
+						
+					}
 					listRewrite.insertFirst(caseStatement2, null);
 	
 					// insert statement
@@ -3787,7 +3830,12 @@
 				{
 					// insert case statement
 					SwitchCase caseStatement2= ast.newSwitchCase();
-					caseStatement2.setExpression(ast.newNumberLiteral("12"));
+					if (this.apiLevel < AST.JLS12) {
+						caseStatement2.setExpression(ast.newNumberLiteral("12"));
+					}
+					else {
+						caseStatement2.expressions().add(ast.newNumberLiteral("12"));
+					}
 					listRewrite.insertLast(caseStatement2, null);
 	
 					// insert statement
@@ -4050,6 +4098,7 @@
 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=246627
 	 * Replace a statement preceded by an unchanged statement)
 	 */
+	@SuppressWarnings("deprecation")
 	public void testSwitchStatement7() throws Exception {
 		String previousValue = null;
 		try {
@@ -4092,7 +4141,12 @@
 				ExpressionStatement assignment = (ExpressionStatement)statements.get(1); // i= 1;:
 				
 				SwitchCase switchCase = ast.newSwitchCase();
-				switchCase.setExpression(ast.newNumberLiteral("2"));
+				if (this.apiLevel < AST.JLS12) {
+					switchCase.setExpression(ast.newNumberLiteral("2"));
+				}
+				else {
+					switchCase.expressions().add(ast.newNumberLiteral("2"));
+				}
 				
 				ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
 				listRewrite.replace(assignment, switchCase, null);
@@ -4192,6 +4246,7 @@
 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=246627
 	 * Remove a statement followed by an inserted statement)
 	 */
+	@SuppressWarnings("deprecation")
 	public void testSwitchStatement9() throws Exception {
 		String previousValue = null;
 		try {
@@ -4234,7 +4289,12 @@
 				ExpressionStatement assignment = (ExpressionStatement)statements.get(1); // i= 1;
 				
 				SwitchCase switchCase = ast.newSwitchCase();
-				switchCase.setExpression(ast.newNumberLiteral("2"));
+				if (this.apiLevel < AST.JLS12) {
+					switchCase.setExpression(ast.newNumberLiteral("2"));
+				}
+				else {
+					switchCase.expressions().add(ast.newNumberLiteral("2"));
+				}
 				
 				ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
 				listRewrite.remove(assignment, null);
@@ -4513,6 +4573,151 @@
 			}
 		}
 	}
+	@SuppressWarnings("deprecation")
+	public void testSwitchStatement_Bug543720() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		String s	=
+				"package test1;\n"+
+				"public class X {\n"+
+				"	static int foo(int i) {\n"+
+				"		int tw = 0;\n"+
+				"		switch (i) {\n"+
+				"			case 1 : {\n"+
+				" 				int z = 100;\n"+
+				" 				break;\n"+
+				"			}\n"+
+				"			default : {\n"+
+				"				break;\n"+
+				"			}\n"+
+				"		}\n"+
+				"		return tw;\n"+
+				"	}\n"+
+				"	public static void main(String[] args) {\n"+
+				"		System.out.print(foo(1));\n"+
+				"	}\n"+
+				"}\n";
+		StringBuffer buf = new StringBuffer(s);
+		ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		AST ast= astRoot.getAST();
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "X");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		{ // insert statements, replace expression
+			SwitchStatement switchStmt = (SwitchStatement) blockStatements.get(1);
+
+			SwitchCase caseStatement1= ast.newSwitchCase();
+			if (this.apiLevel < AST.JLS12) {
+				caseStatement1.setExpression(ast.newNumberLiteral("100"));
+			} else {
+				caseStatement1.expressions().add(ast.newNumberLiteral("100"));
+			}
+
+			BreakStatement breakStatement = ast.newBreakStatement();
+			Block block1 = ast.newBlock();
+			block1.statements().add(breakStatement);
+
+			SwitchCase defaultCase = (SwitchCase) switchStmt.statements().get(2);
+			ListRewrite listRewrite= rewrite.getListRewrite(switchStmt, SwitchStatement.STATEMENTS_PROPERTY);
+			listRewrite.insertBefore(caseStatement1, defaultCase, null);
+			listRewrite.insertBefore(block1, defaultCase, null);
+		}
+
+
+		String preview= evaluateRewrite(cu, rewrite);
+
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class X {\n");
+		buf.append("	static int foo(int i) {\n");
+		buf.append("		int tw = 0;\n");
+		buf.append("		switch (i) {\n");
+		buf.append("			case 1 : {\n");
+		buf.append(" 				int z = 100;\n");
+		buf.append(" 				break;\n");
+		buf.append("			}\n");
+		buf.append("			case 100:\n");
+		buf.append("                {\n");
+		buf.append("                    break;\n");
+		buf.append("                }\n");
+		buf.append("            default : {\n");
+		buf.append("				break;\n");
+		buf.append("			}\n");
+		buf.append("		}\n");
+		buf.append("		return tw;\n");
+		buf.append("	}\n");
+		buf.append("	public static void main(String[] args) {\n");
+		buf.append("		System.out.print(foo(1));\n");
+		buf.append("	}\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	}
+
+	// complete removal of statements under switch statement.
+	public void testSwitchStatement_Bug543720_complete_removal() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		String s	=
+				"package test1;\n"+
+				"public class X {\n"+
+				"	static int foo(int i) {\n"+
+				"		int tw = 0;\n"+
+				"		switch (i) {\n"+
+				"			case 1 : {\n"+
+				" 				int z = 100;\n"+
+				" 				break;\n"+
+				"			}\n"+
+				"			default : {\n"+
+				"				break;\n"+
+				"			}\n"+
+				"		}\n"+
+				"		return tw;\n"+
+				"	}\n"+
+				"	public static void main(String[] args) {\n"+
+				"		System.out.print(foo(1));\n"+
+				"	}\n"+
+				"}\n";
+		StringBuffer buf = new StringBuffer(s);
+		ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "X");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		{ // insert statements, replace expression
+			SwitchStatement switchStmt = (SwitchStatement) blockStatements.get(1);
+
+			List statements= switchStmt.statements();
+			for (int i = 0, l = statements.size(); i < l; ++i)
+				rewrite.remove((ASTNode) statements.get(i), null);
+		}
+
+		String preview= evaluateRewrite(cu, rewrite);
+
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class X {\n");
+		buf.append("	static int foo(int i) {\n");
+		buf.append("		int tw = 0;\n");
+		buf.append("		switch (i) {\n");
+		buf.append("		}\n");
+		buf.append("		return tw;\n");
+		buf.append("	}\n");
+		buf.append("	public static void main(String[] args) {\n");
+		buf.append("		System.out.print(foo(1));\n");
+		buf.append("	}\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	}
 
 	public void testSynchronizedStatement() throws Exception {
 		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java
new file mode 100644
index 0000000..1303ab2
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingSwitchExpressionsTest.java
@@ -0,0 +1,848 @@
+/*******************************************************************************
+ * Copyright (c) 2019 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.rewrite.describing;
+
+import java.util.List;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.Block;
+import org.eclipse.jdt.core.dom.BreakStatement;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.ExpressionStatement;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.Statement;
+import org.eclipse.jdt.core.dom.StringLiteral;
+import org.eclipse.jdt.core.dom.SwitchCase;
+import org.eclipse.jdt.core.dom.SwitchExpression;
+import org.eclipse.jdt.core.dom.SwitchStatement;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+
+import junit.framework.Test;
+
+public class ASTRewritingSwitchExpressionsTest extends ASTRewritingTest {
+
+
+	public ASTRewritingSwitchExpressionsTest(String name) {
+		super(name, 12);
+	}
+
+	public ASTRewritingSwitchExpressionsTest(String name, int apiLevel) {
+		super(name, apiLevel);
+	}
+
+	public static Test suite() {
+		return createSuite(ASTRewritingSwitchExpressionsTest.class);
+	}
+
+	@SuppressWarnings("rawtypes")
+	public void testSwitchExpressions_since_12() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class E {\n");
+		buf.append("    public void foo(int i) {\n");
+		buf.append("        switch (i) {\n");
+		buf.append("        }\n");
+		buf.append("        switch (i) {\n");
+		buf.append("            case 1, 2->\n");
+		buf.append("                i= 1;\n");
+		buf.append("            case 3->\n");
+		buf.append("                i= 3;\n");
+		buf.append("            default->\n");
+		buf.append("                i= 4;\n");
+		buf.append("        }\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		AST ast= astRoot.getAST();
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "E");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		assertTrue("Number of statements not 2", blockStatements.size() == 2);
+		{ // insert statements, replace expression
+			SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
+
+			ASTNode expression= switchStatement.getExpression();
+			SimpleName newExpression= ast.newSimpleName("x");
+			rewrite.replace(expression, newExpression, null);
+
+			List statements= switchStatement.statements();
+			assertTrue("Number of statements not 0", statements.size() == 0);
+
+			SwitchCase caseStatement1= ast.newSwitchCase();
+			caseStatement1.setSwitchLabeledRule(true);
+			caseStatement1.expressions().add(ast.newNumberLiteral("1"));
+			caseStatement1.expressions().add(ast.newNumberLiteral("2"));
+			
+
+			Statement statement1= ast.newReturnStatement();
+
+			SwitchCase caseStatement2= ast.newSwitchCase(); // default
+			caseStatement2.setSwitchLabeledRule(true);
+
+
+			ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
+			listRewrite.insertAt(caseStatement1, 0, null);
+			listRewrite.insertLast(statement1, null);
+			listRewrite.insertLast(caseStatement2, null);
+		}
+
+		{ // insert, remove, replace statements, change case statements
+			SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(1);
+
+			List statements= switchStatement.statements();
+			assertTrue("Number of statements not 6", statements.size() == 6);
+
+			// remove statements
+
+			rewrite.remove((ASTNode) statements.get(0), null);
+			rewrite.remove((ASTNode) statements.get(1), null);
+
+			// change case statement
+			SwitchCase caseStatement= (SwitchCase) statements.get(2);
+			ListRewrite listRewrite= rewrite.getListRewrite(caseStatement, SwitchCase.EXPRESSIONS2_PROPERTY);
+
+			{
+				listRewrite.insertFirst(ast.newNumberLiteral("10"), null);
+				listRewrite.insertLast(ast.newNumberLiteral("12"), null);
+
+			}
+
+		}
+
+		String preview= evaluateRewrite(cu, rewrite);
+
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class E {\n");
+		buf.append("    public void foo(int i) {\n");
+		buf.append("        switch (x) {\n");
+		buf.append("            case 1, 2->\n");
+		buf.append("                return;\n");
+		buf.append("            default->\n");
+		buf.append("        }\n");
+		buf.append("        switch (i) {\n");
+		buf.append("            case 10, 3, 12->\n");
+		buf.append("                i= 3;\n");
+		buf.append("            default->\n");
+		buf.append("                i= 4;\n");
+		buf.append("        }\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	}
+	@SuppressWarnings("rawtypes")
+	public void testSwitchExpressions_02_since_12() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class E {\n");
+		buf.append("    public void foo(int i) {\n");
+		buf.append("        switch (i) {\n");
+		buf.append("            case 1, 2->\n");
+		buf.append("                i= 1;\n");
+		buf.append("            case 3->\n");
+		buf.append("                i= 3;\n");
+		buf.append("            default->\n");
+		buf.append("                i= 4;\n");
+		buf.append("        }\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		AST ast= astRoot.getAST();
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "E");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		{ // insert statements, replace expression
+			SwitchStatement switchStatement= (SwitchStatement) blockStatements.get(0);
+
+			SwitchCase caseStatement1= ast.newSwitchCase();
+			caseStatement1.setSwitchLabeledRule(true);
+			caseStatement1.expressions().add(ast.newNumberLiteral("1024"));
+
+			BreakStatement breakStatement = ast.newBreakStatement();
+			breakStatement.setExpression(ast.newNumberLiteral("2048"));
+			ListRewrite listRewrite= rewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
+
+			SwitchCase defaultCase = (SwitchCase) switchStatement.statements().get(4);
+			listRewrite.insertBefore(caseStatement1, defaultCase, null);
+			listRewrite.insertBefore(breakStatement, defaultCase, null);
+		}
+
+		String preview= evaluateRewrite(cu, rewrite);
+
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class E {\n");
+		buf.append("    public void foo(int i) {\n");
+		buf.append("        switch (i) {\n");
+		buf.append("            case 1, 2->\n");
+		buf.append("                i= 1;\n");
+		buf.append("            case 3->\n");
+		buf.append("                i= 3;\n");
+		buf.append("            case 1024->\n");
+		buf.append("                break 2048;\n");
+		buf.append("            default->\n");
+		buf.append("                i= 4;\n");
+		buf.append("        }\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	}
+
+	@SuppressWarnings("rawtypes")
+	public void testSwitchExpressions_03_since_12() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		String s	=
+				"package test1;\n"+
+				"public class X {\n"+
+				"	static int foo(int i) {\n"+
+				"		int tw = \n"+
+				"		switch (i) {\n"+
+				"			case 1 -> {\n"+
+				" 				int z = 100;\n"+
+				" 				break z;\n"+
+				"			}\n"+
+				"			default -> {\n"+
+				"				break 12;\n"+
+				"			}\n"+
+				"		};\n"+
+				"		return tw;\n"+
+				"	}\n"+
+				"	public static void main(String[] args) {\n"+
+				"		System.out.print(foo(1));\n"+
+				"	}\n"+
+				"}\n";
+		StringBuffer buf = new StringBuffer(s);
+		ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		AST ast= astRoot.getAST();
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "X");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		{ // insert statements, replace expression
+			VariableDeclarationStatement stmt = (VariableDeclarationStatement) blockStatements.get(0);
+			SwitchExpression switchExpression= (SwitchExpression) ((VariableDeclarationFragment) stmt.fragments().get(0)).getInitializer();
+
+			SwitchCase caseStatement1= ast.newSwitchCase();
+			caseStatement1.setSwitchLabeledRule(true);
+			caseStatement1.expressions().add(ast.newNumberLiteral("100"));
+			caseStatement1.expressions().add(ast.newNumberLiteral("200"));
+
+			SwitchCase caseStatement2= ast.newSwitchCase(); // default
+			caseStatement2.setSwitchLabeledRule(true);
+
+			BreakStatement breakStatement = ast.newBreakStatement();
+			breakStatement.setExpression(ast.newNumberLiteral("2048"));
+			Block block1 = ast.newBlock();
+			block1.statements().add(breakStatement);
+
+			SwitchCase defaultCase = (SwitchCase) switchExpression.statements().get(2);
+			ListRewrite listRewrite= rewrite.getListRewrite(switchExpression, SwitchExpression.STATEMENTS_PROPERTY);
+			listRewrite.insertBefore(caseStatement1, defaultCase, null);
+			listRewrite.insertBefore(block1, defaultCase, null);
+		}
+
+
+		String preview= evaluateRewrite(cu, rewrite);
+
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class X {\n");
+		buf.append("	static int foo(int i) {\n");
+		buf.append("		int tw = \n");
+		buf.append("		switch (i) {\n");
+		buf.append("			case 1 -> {\n");
+		buf.append(" 				int z = 100;\n");
+		buf.append(" 				break z;\n");
+		buf.append("			}\n");
+		buf.append("			case 100, 200->\n");
+		buf.append("                {\n");
+		buf.append("                    break 2048;\n");
+		buf.append("                }\n");
+		buf.append("            default -> {\n");
+		buf.append("				break 12;\n");
+		buf.append("			}\n");
+		buf.append("		};\n");
+		buf.append("		return tw;\n");
+		buf.append("	}\n");
+		buf.append("	public static void main(String[] args) {\n");
+		buf.append("		System.out.print(foo(1));\n");
+		buf.append("	}\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	}
+
+	@SuppressWarnings("rawtypes")
+	public void testSwitchStatement_Bug543720_since_12() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		String s	=
+				"package test1;\n"+
+				"public class X {\n"+
+				"	static int foo(int i) {\n"+
+				"		int tw = 0;\n"+
+				"		switch (i) {\n"+
+				"			case 1 : {\n"+
+				" 				int z = 100;\n"+
+				" 				break;\n"+
+				"			}\n"+
+				"			default : {\n"+
+				"				break;\n"+
+				"			}\n"+
+				"		}\n"+
+				"		return tw;\n"+
+				"	}\n"+
+				"	public static void main(String[] args) {\n"+
+				"		System.out.print(foo(1));\n"+
+				"	}\n"+
+				"}\n";
+		StringBuffer buf = new StringBuffer(s);
+		ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		AST ast= astRoot.getAST();
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "X");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		{ // insert statements, replace expression
+			SwitchStatement switchStmt = (SwitchStatement) blockStatements.get(1);
+
+			SwitchCase caseStatement1= ast.newSwitchCase();
+			caseStatement1.expressions().add(ast.newNumberLiteral("100"));
+
+			BreakStatement breakStatement = ast.newBreakStatement();
+			Block block1 = ast.newBlock();
+			block1.statements().add(breakStatement);
+
+			SwitchCase defaultCase = (SwitchCase) switchStmt.statements().get(2);
+			ListRewrite listRewrite= rewrite.getListRewrite(switchStmt, SwitchStatement.STATEMENTS_PROPERTY);
+			listRewrite.insertBefore(caseStatement1, defaultCase, null);
+			listRewrite.insertBefore(block1, defaultCase, null);
+		}
+
+
+		String preview= evaluateRewrite(cu, rewrite);
+
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class X {\n");
+		buf.append("	static int foo(int i) {\n");
+		buf.append("		int tw = 0;\n");
+		buf.append("		switch (i) {\n");
+		buf.append("			case 1 : {\n");
+		buf.append(" 				int z = 100;\n");
+		buf.append(" 				break;\n");
+		buf.append("			}\n");
+		buf.append("			case 100:\n");
+		buf.append("                {\n");
+		buf.append("                    break;\n");
+		buf.append("                }\n");
+		buf.append("            default : {\n");
+		buf.append("				break;\n");
+		buf.append("			}\n");
+		buf.append("		}\n");
+		buf.append("		return tw;\n");
+		buf.append("	}\n");
+		buf.append("	public static void main(String[] args) {\n");
+		buf.append("		System.out.print(foo(1));\n");
+		buf.append("	}\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	}
+	@SuppressWarnings("rawtypes")
+	public void testSwitchExpressions_04_since_12() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		String s	= "package test1;\n"+
+				"public class X {\n"+
+				"	static int foo(int i) {\n"+
+				"		int tw =\n"+
+				"		switch (i) {\n"+
+				"			case 1 -> \n"+
+				"			 {\n"+
+				" 				int z = 100;\n"+
+				" 				break z;\n"+
+				"			}\n"+
+				"			default -> {\n"+
+				"				break 12;\n"+
+				"			}\n"+
+				"		};\n"+
+				"		return tw;\n"+
+				"	}\n"+
+				"	public static void main(String[] args) {\n"+
+				"		System.out.print(foo(1));\n"+
+				"	}\n"+
+				"}\n";
+		StringBuffer buf = new StringBuffer(s);
+		ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		AST ast= astRoot.getAST();
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "X");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		{ // insert statements, replace expression
+			VariableDeclarationStatement stmt = (VariableDeclarationStatement) blockStatements.get(0);
+			SwitchExpression switchExpression= (SwitchExpression) ((VariableDeclarationFragment) stmt.fragments().get(0)).getInitializer();
+
+			ASTNode expression= switchExpression.getExpression();
+			SimpleName newExpression= ast.newSimpleName("x");
+			rewrite.replace(expression, newExpression, null);
+
+			List statements= switchExpression.statements();
+
+			// remove statements
+			rewrite.remove((ASTNode) statements.get(0), null);
+			rewrite.remove((ASTNode) statements.get(1), null);
+		}
+		String preview= evaluateRewrite(cu, rewrite);
+
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class X {\n");
+		buf.append("	static int foo(int i) {\n");
+		buf.append("		int tw =\n");
+		buf.append("		switch (x) {\n");
+		buf.append("			default -> {\n");
+		buf.append("				break 12;\n");
+		buf.append("			}\n");
+		buf.append("		};\n");
+		buf.append("		return tw;\n");
+		buf.append("	}\n");
+		buf.append("	public static void main(String[] args) {\n");
+		buf.append("		System.out.print(foo(1));\n");
+		buf.append("	}\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	}
+	//Note: complete removal of statements under switch statements now added in ASTRSTest and hence not repeated here.
+
+	// replacing colon by ->
+	@SuppressWarnings("rawtypes")
+	public void testSwitchStatement_Bug543720_05_since_12() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		String s	=
+				"package test1;\n"+
+				"public class X {\n"+
+				"	static int foo(int i) {\n"+
+				"		int tw = 0;\n"+
+				"		switch (i) {\n"+
+				"			case 1 : {\n"+
+				" 				int z = 100;\n"+
+				" 				break;\n"+
+				"			}\n"+
+				"			case 2 : {\n"+
+				" 				break;\n"+
+				"			}\n"+
+				"			default : {\n"+
+				"				break;\n"+
+				"			}\n"+
+				"		}\n"+
+				"		return tw;\n"+
+				"	}\n"+
+				"	public static void main(String[] args) {\n"+
+				"		System.out.print(foo(1));\n"+
+				"	}\n"+
+				"}\n";
+		StringBuffer buf = new StringBuffer(s);
+		ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "X");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		{ // set switch labeled rule
+			SwitchStatement switchStmt = (SwitchStatement) blockStatements.get(1);
+			for (int i = 0, l = switchStmt.statements().size(); i < l; ++i) {
+				Statement stmt = (Statement) switchStmt.statements().get(i);
+				if (stmt instanceof SwitchCase) {
+					SwitchCase switchCase = (SwitchCase) stmt;
+					assertTrue("Switch case has arrow", switchCase.isSwitchLabeledRule() == false);
+					rewrite.set(switchCase, SwitchCase.SWITCH_LABELED_RULE_PROPERTY, Boolean.TRUE, null);
+				}
+			}
+		}
+
+		String preview= evaluateRewrite(cu, rewrite);
+
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class X {\n");
+		buf.append("	static int foo(int i) {\n");
+		buf.append("		int tw = 0;\n");
+		buf.append("		switch (i) {\n");
+		buf.append("			case 1 -> {\n");
+		buf.append(" 				int z = 100;\n");
+		buf.append(" 				break;\n");
+		buf.append("			}\n");
+		buf.append("			case 2 -> {\n");
+		buf.append(" 				break;\n");
+		buf.append("			}\n");
+		buf.append("			default -> {\n");
+		buf.append("				break;\n");
+		buf.append("			}\n");
+		buf.append("		}\n");
+		buf.append("		return tw;\n");
+		buf.append("	}\n");
+		buf.append("	public static void main(String[] args) {\n");
+		buf.append("		System.out.print(foo(1));\n");
+		buf.append("	}\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	}
+
+	// replacing colon by ->
+	@SuppressWarnings("rawtypes")
+	public void testSwitchStatement_Bug543720_06_since_12() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		String s	=
+				"package test1;\n"+
+				"public class X {\n"+
+				"	static int foo(int i) {\n"+
+				"		int tw = 0;\n"+
+				"		switch (i) {\n"+
+				"			case 1 -> {\n"+
+				" 				int z = 100;\n"+
+				" 				break;\n"+
+				"			}\n"+
+				"			case 2 -> {\n"+
+				" 				break;\n"+
+				"			}\n"+
+				"			default -> {\n"+
+				"				break;\n"+
+				"			}\n"+
+				"		}\n"+
+				"		return tw;\n"+
+				"	}\n"+
+				"	public static void main(String[] args) {\n"+
+				"		System.out.print(foo(1));\n"+
+				"	}\n"+
+				"}\n";
+		StringBuffer buf = new StringBuffer(s);
+		ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "X");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		{ // set switch labeled rule
+			SwitchStatement switchStmt = (SwitchStatement) blockStatements.get(1);
+			for (int i = 0, l = switchStmt.statements().size(); i < l; ++i) {
+				Statement stmt = (Statement) switchStmt.statements().get(i);
+				if (stmt instanceof SwitchCase) {
+					SwitchCase switchCase = (SwitchCase) stmt;
+					assertTrue("Switch case has colon", switchCase.isSwitchLabeledRule() == true);
+					rewrite.set(switchCase, SwitchCase.SWITCH_LABELED_RULE_PROPERTY, Boolean.FALSE, null);
+				}
+			}
+		}
+
+		String preview= evaluateRewrite(cu, rewrite);
+
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class X {\n");
+		buf.append("	static int foo(int i) {\n");
+		buf.append("		int tw = 0;\n");
+		buf.append("		switch (i) {\n");
+		buf.append("			case 1 : {\n");
+		buf.append(" 				int z = 100;\n");
+		buf.append(" 				break;\n");
+		buf.append("			}\n");
+		buf.append("			case 2 : {\n");
+		buf.append(" 				break;\n");
+		buf.append("			}\n");
+		buf.append("			default : {\n");
+		buf.append("				break;\n");
+		buf.append("			}\n");
+		buf.append("		}\n");
+		buf.append("		return tw;\n");
+		buf.append("	}\n");
+		buf.append("	public static void main(String[] args) {\n");
+		buf.append("		System.out.print(foo(1));\n");
+		buf.append("	}\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	}
+	// replacing colon by ->
+	@SuppressWarnings("rawtypes")
+	public void testSwitchExpression_Bug543720_07_since_12() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		String s	=
+				"package test1;\n"+
+				"public class X {\n"+
+				"	static int foo(int i) {\n"+
+				"		int tw =\n"+
+				"		switch (i) {\n"+
+				"			case 1 : {\n"+
+				" 				int z = 100;\n"+
+				" 				break;\n"+
+				"			}\n"+
+				"			case 2 : {\n"+
+				" 				break;\n"+
+				"			}\n"+
+				"			default : {\n"+
+				"				break;\n"+
+				"			}\n"+
+				"		};\n"+
+				"		return tw;\n"+
+				"	}\n"+
+				"	public static void main(String[] args) {\n"+
+				"		System.out.print(foo(1));\n"+
+				"	}\n"+
+				"}\n";
+		StringBuffer buf = new StringBuffer(s);
+		ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "X");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		{
+			VariableDeclarationStatement stmt = (VariableDeclarationStatement) blockStatements.get(0);
+			SwitchExpression switchExpression= (SwitchExpression) ((VariableDeclarationFragment) stmt.fragments().get(0)).getInitializer();
+			for (int i = 0, l = switchExpression.statements().size(); i < l; ++i) {
+				Statement stmt1 = (Statement) switchExpression.statements().get(i);
+				if (stmt1 instanceof SwitchCase) {
+					SwitchCase switchCase = (SwitchCase) stmt1;
+					assertTrue("Switch case has arrow", switchCase.isSwitchLabeledRule() == false);
+					rewrite.set(switchCase, SwitchCase.SWITCH_LABELED_RULE_PROPERTY, Boolean.TRUE, null);
+				}
+			}
+		}
+
+		String preview= evaluateRewrite(cu, rewrite);
+
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class X {\n");
+		buf.append("	static int foo(int i) {\n");
+		buf.append("		int tw =\n");
+		buf.append("		switch (i) {\n");
+		buf.append("			case 1 -> {\n");
+		buf.append(" 				int z = 100;\n");
+		buf.append(" 				break;\n");
+		buf.append("			}\n");
+		buf.append("			case 2 -> {\n");
+		buf.append(" 				break;\n");
+		buf.append("			}\n");
+		buf.append("			default -> {\n");
+		buf.append("				break;\n");
+		buf.append("			}\n");
+		buf.append("		};\n");
+		buf.append("		return tw;\n");
+		buf.append("	}\n");
+		buf.append("	public static void main(String[] args) {\n");
+		buf.append("		System.out.print(foo(1));\n");
+		buf.append("	}\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	}
+
+	// replacing colon by ->
+	@SuppressWarnings("rawtypes")
+	public void testSwitchExpression_Bug543720_08_since_12() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		String s	=
+				"package test1;\n"+
+				"public class X {\n"+
+				"	static int foo(int i) {\n"+
+				"		int tw =\n"+
+				"		switch (i) {\n"+
+				"			case 1 -> {\n"+
+				" 				int z = 100;\n"+
+				" 				break;\n"+
+				"			}\n"+
+				"			case 2 -> {\n"+
+				" 				break;\n"+
+				"			}\n"+
+				"			default -> {\n"+
+				"				break;\n"+
+				"			}\n"+
+				"		};\n"+
+				"		return tw;\n"+
+				"	}\n"+
+				"	public static void main(String[] args) {\n"+
+				"		System.out.print(foo(1));\n"+
+				"	}\n"+
+				"}\n";
+		StringBuffer buf = new StringBuffer(s);
+		ICompilationUnit cu= pack1.createCompilationUnit("X.java", buf.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "X");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		{
+			VariableDeclarationStatement stmt = (VariableDeclarationStatement) blockStatements.get(0);
+			SwitchExpression switchExpression= (SwitchExpression) ((VariableDeclarationFragment) stmt.fragments().get(0)).getInitializer();
+			for (int i = 0, l = switchExpression.statements().size(); i < l; ++i) {
+				Statement stmt1 = (Statement) switchExpression.statements().get(i);
+				if (stmt1 instanceof SwitchCase) {
+					SwitchCase switchCase = (SwitchCase) stmt1;
+					assertTrue("Switch case has colon", switchCase.isSwitchLabeledRule() == true);
+					rewrite.set(switchCase, SwitchCase.SWITCH_LABELED_RULE_PROPERTY, Boolean.FALSE, null);
+				}
+			}
+		}
+
+		String preview= evaluateRewrite(cu, rewrite);
+
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class X {\n");
+		buf.append("	static int foo(int i) {\n");
+		buf.append("		int tw =\n");
+		buf.append("		switch (i) {\n");
+		buf.append("			case 1 : {\n");
+		buf.append(" 				int z = 100;\n");
+		buf.append(" 				break;\n");
+		buf.append("			}\n");
+		buf.append("			case 2 : {\n");
+		buf.append(" 				break;\n");
+		buf.append("			}\n");
+		buf.append("			default : {\n");
+		buf.append("				break;\n");
+		buf.append("			}\n");
+		buf.append("		};\n");
+		buf.append("		return tw;\n");
+		buf.append("	}\n");
+		buf.append("	public static void main(String[] args) {\n");
+		buf.append("		System.out.print(foo(1));\n");
+		buf.append("	}\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	}
+	@SuppressWarnings("rawtypes")
+	public void testSwitchExpressions_05_since_12() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		StringBuilder builder= new StringBuilder();
+		builder.append("package test1;\n");
+		builder.append("public class X {\n");
+		builder.append("    public String foo(int i) {\n" +
+				"		String ret = switch(i%2) {\n" + 
+				"		case 0 -> \"even\";\n" + 
+				"		default -> \"\";\n" + 
+				"		};\n" + 
+				"		return ret;");
+		builder.append("    }\n");
+		builder.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("X.java", builder.toString(), false, null);
+
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "X");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List blockStatements= block.statements();
+		AST ast= astRoot.getAST();
+		assertEquals("incorrect no of statements", 2, blockStatements.size());
+		{ // insert a case
+			VariableDeclarationStatement varStatement= (VariableDeclarationStatement) blockStatements.get(0);
+			List fragments = varStatement.fragments();
+			assertEquals("Incorrect no of fragments", 1, fragments.size());
+			VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
+			SwitchExpression initializer = (SwitchExpression) fragment.getInitializer();
+			List statements= initializer.statements();
+			assertEquals("incorrect Number of statements", 4, statements.size());
+
+			SwitchCase cse1 = (SwitchCase) statements.get(0);
+			rewrite.set(cse1, SwitchCase.SWITCH_LABELED_RULE_PROPERTY, Boolean.FALSE, null);
+			SwitchCase cse2 = (SwitchCase) statements.get(2);
+			rewrite.set(cse2, SwitchCase.SWITCH_LABELED_RULE_PROPERTY, Boolean.FALSE, null);
+			
+			ListRewrite listRewrite= rewrite.getListRewrite(initializer, SwitchExpression.STATEMENTS_PROPERTY);
+			SwitchCase caseStatement1= ast.newSwitchCase();
+			caseStatement1.setSwitchLabeledRule(false);
+			caseStatement1.expressions().add(ast.newNumberLiteral("1"));
+			StringLiteral literal1 = ast.newStringLiteral();
+			literal1.setLiteralValue("odd");
+			ExpressionStatement statement1 = ast.newExpressionStatement(literal1);
+			listRewrite.insertAt(caseStatement1, 2, null);
+			listRewrite.insertAt(statement1, 3, null);
+		}
+
+		// Expected output is not ideal due to formatting issue Bug 545439
+		String preview= evaluateRewrite(cu, rewrite);
+		builder= new StringBuilder();
+		builder.append("package test1;\n");
+		builder.append("public class X {\n");
+		builder.append("    public String foo(int i) {\n" +
+				"		String ret = switch(i%2) {\n" + 
+				"		case 0 : \"even\";\n" + 
+				"            case 1:\n" +
+				"                \"odd\";\n" + 
+				"		default : \"\";\n" + 
+				"		};\n" + 
+				"		return ret;");
+		builder.append("    }\n");
+		builder.append("}\n");
+		assertEqualString(preview, builder.toString());
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTest.java
index bf162e4..5437dbb 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -16,21 +16,33 @@
 import java.lang.reflect.Method;
 import java.util.List;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.IPackageFragmentRoot;
 import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.dom.*;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.BodyDeclaration;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.PrimitiveType;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
 import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
 import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
 import org.eclipse.jdt.core.tests.model.AbstractJavaModelTests;
 import org.eclipse.jface.text.Document;
 import org.eclipse.text.edits.TextEdit;
 
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
 /**
  * Tests for ASTRewrite. Subclasses must have 2 constructors that forward to
  * constructors with the same signature as this class's constructors.
@@ -70,8 +82,10 @@
 
 	/** @deprecated using deprecated code */
 	private final static int JLS10_INTERNAL = AST.JLS10;
+	
+	private final static int JLS12_INTERNAL = AST.JLS12;
 
-	private final static int[] JLS_LEVELS = { JLS2_INTERNAL, JLS3_INTERNAL, JLS4_INTERNAL, JLS8_INTERNAL, JLS9_INTERNAL, JLS10_INTERNAL };
+	private final static int[] JLS_LEVELS = { JLS2_INTERNAL, JLS3_INTERNAL, JLS4_INTERNAL, JLS8_INTERNAL, JLS9_INTERNAL, JLS10_INTERNAL, JLS12_INTERNAL };
 
 	private static final String ONLY_AST_STRING = "_only";
 	private static final String SINCE_AST_STRING = "_since";
@@ -108,26 +122,31 @@
 
 	public static Test suite() {
 		TestSuite suite= new TestSuite(ASTRewritingTest.class.getName());
-		suite.addTest(ASTRewritingExpressionsTest.suite());
-		suite.addTest(ASTRewritingInsertBoundTest.suite());
-		suite.addTest(ASTRewritingMethodDeclTest.suite());
-		suite.addTest(ASTRewritingMoveCodeTest.suite());
-		suite.addTest(ASTRewritingStatementsTest.suite());
-		suite.addTest(ASTRewritingTrackingTest.suite());
-		suite.addTest(ASTRewritingJavadocTest.suite());
-		suite.addTest(ASTRewritingTypeAnnotationsTest.suite());
-		suite.addTest(ASTRewritingTypeDeclTest.suite());
-		suite.addTest(ASTRewritingGroupNodeTest.suite());
-		suite.addTest(ASTRewritingRevertTest.suite());
-		suite.addTest(LineCommentOffsetsTest.suite());
-		suite.addTest(ASTRewritingWithStatementsRecoveryTest.suite());
-		suite.addTest(ASTRewritePropertyTest.suite());
-		suite.addTest(ASTRewritingPackageDeclTest.suite());
-		suite.addTest(ASTRewritingLambdaExpressionTest.suite());		
-		suite.addTest(ASTRewritingReferenceExpressionTest.suite());		
-		suite.addTest(SourceModifierTest.suite());
-		suite.addTest(ImportRewriteTest.suite());
-		suite.addTest(ImportRewrite18Test.suite());
+		
+		
+		  suite.addTest(ASTRewritingExpressionsTest.suite());
+		  suite.addTest(ASTRewritingInsertBoundTest.suite());
+		  suite.addTest(ASTRewritingMethodDeclTest.suite());
+		  suite.addTest(ASTRewritingMoveCodeTest.suite());
+		  suite.addTest(ASTRewritingStatementsTest.suite());
+		  suite.addTest(ASTRewritingSwitchExpressionsTest.suite());
+		
+		  suite.addTest(ASTRewritingTrackingTest.suite());
+		  suite.addTest(ASTRewritingJavadocTest.suite());
+		  suite.addTest(ASTRewritingTypeAnnotationsTest.suite());
+		  suite.addTest(ASTRewritingTypeDeclTest.suite());
+		  suite.addTest(ASTRewritingGroupNodeTest.suite());
+		  suite.addTest(ASTRewritingRevertTest.suite());
+		  suite.addTest(LineCommentOffsetsTest.suite());
+		  suite.addTest(ASTRewritingWithStatementsRecoveryTest.suite());
+		  suite.addTest(ASTRewritePropertyTest.suite());
+		  suite.addTest(ASTRewritingPackageDeclTest.suite());
+		  suite.addTest(ASTRewritingLambdaExpressionTest.suite());
+		  suite.addTest(ASTRewritingReferenceExpressionTest.suite());
+		  suite.addTest(SourceModifierTest.suite());
+		  suite.addTest(ImportRewriteTest.suite());
+		  suite.addTest(ImportRewrite18Test.suite());
+		 
 		return suite;
 	}
 
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Converter12/.classpath b/org.eclipse.jdt.core.tests.model/workspace/Converter12/.classpath
new file mode 100644
index 0000000..3522bc0
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Converter12/.classpath
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="var" path="CONVERTER_JCL18_LIB" sourcepath="CONVERTER_JCL18_SRC" rootpath="CONVERTER_JCL_SRCROOT"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Converter12/.project b/org.eclipse.jdt.core.tests.model/workspace/Converter12/.project
new file mode 100644
index 0000000..663fb8d
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Converter12/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>Converter18</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Converter12/src/X.java b/org.eclipse.jdt.core.tests.model/workspace/Converter12/src/X.java
new file mode 100644
index 0000000..5a1a888
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Converter12/src/X.java
@@ -0,0 +1,4 @@
+public class X {
+	public void foo(X this) {
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/A_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/A_out.java
new file mode 100644
index 0000000..89ab563
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/A_out.java
@@ -0,0 +1,72 @@
+
+public class C {
+
+	void foo() {
+		switch (a + b + c /* + d */
+				+ e + f) {
+			case 1 , 2 , 99999 , 5 , 6 :
+				method1();
+				break;
+			case 999 , 998 , 997 :
+			case 996 , 995 , //
+			994 :
+				method2();
+			default:
+				method3();
+		}
+
+		switch ("a" + "b" + "c" //
+				+ something) {
+			case "abc1" -> System.out.println("1");
+			case "abc2" ,
+			/* ??? */ "abc3" , "abc4" -> System.out.println("234");
+			case "abc5" , "abc6" -> {
+			}
+			case "abc7" -> {
+				System.out.println("7");
+				return;
+			}
+			default -> System.out.println("?");
+		}
+
+		int value = switch (ABC) {
+			case A :
+				break 1;
+			case B :
+				System.out.println("!!!");
+				return;
+			case BB :
+				;
+			case C , D , E , F , G :
+			case H , I , J : {
+				System.out.println("@@@");
+				break 3454366;
+			}
+			default:
+				break 6;
+		};
+
+		Object value2 = switch (a.b.c.d(e.f.g.h())) {
+			case a -> {
+				System.out.println("aaaaaaa");
+				break "";
+			}
+			case b + c , d.e , f("aaaaaaaaaaaa"//
+					+ //
+					"bbbbbbbbb"//
+			) , (33) , aaa = bbb + ccc , new int[] { 1, 2, aaa } , AAA::BBB -> (Runnable) () -> f();
+			// $$$$
+			case new Object() {
+				String toString() {
+					return "";
+				}
+			} -> ABCD;
+			case null -> {
+				return null;
+			}
+			case something -> //
+				null;
+			default -> throw new RuntimeException("unsupported");
+		};
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/B_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/B_out.java
new file mode 100644
index 0000000..30ba3b5
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/B_out.java
@@ -0,0 +1,72 @@
+
+public class C {
+
+	void foo() {
+		switch (a + b + c /* + d */
+				+ e + f ) {
+		case 1,2,99999,5,6:
+		method1();
+			break;
+		case 999,998,997:
+		case 996,995, //
+		994:
+		method2();
+		default:
+		method3();
+		}
+
+		switch ("a" + "b" + "c" //
+				+ something ) {
+		case "abc1" -> System.out.println("1");
+		case "abc2",
+		/* ??? */ "abc3","abc4" -> System.out.println("234");
+		case "abc5","abc6" -> {
+		}
+		case "abc7" -> {
+			System.out.println("7");
+			return;
+		}
+		default -> System.out.println("?");
+		}
+
+		int value = switch (ABC ) {
+		case A:
+			break 1;
+		case B:
+		System.out.println("!!!");
+		return;
+		case BB:
+		;
+		case C,D,E,F,G:
+		case H,I,J: {
+			System.out.println("@@@");
+			break 3454366;
+		}
+		default:
+			break 6;
+		};
+
+		Object value2 = switch (a.b.c.d(e.f.g.h()) ) {
+		case a -> {
+			System.out.println("aaaaaaa");
+			break "";
+		}
+		case b + c,d.e,f("aaaaaaaaaaaa"//
+				+ //
+				"bbbbbbbbb"//
+		),(33),aaa = bbb + ccc,new int[] { 1, 2, aaa },AAA::BBB -> (Runnable) () -> f();
+		// $$$$
+		case new Object() {
+			String toString() {
+				return "";
+			}
+		} -> ABCD;
+		case null -> {
+			return null;
+		}
+		case something -> //
+			null;
+		default -> throw new RuntimeException("unsupported");
+		};
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/C_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/C_out.java
new file mode 100644
index 0000000..b98e85a
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/C_out.java
@@ -0,0 +1,72 @@
+
+public class C {
+
+	void foo() {
+		switch(a + b + c /* + d */
+				+ e + f) {
+		case 1, 2, 99999, 5, 6:
+			method1();
+		break;
+		case 999, 998, 997:
+		case 996, 995, //
+		994:
+			method2();
+		default:
+			method3();
+		}
+
+		switch("a" + "b" + "c" //
+				+ something) {
+		case "abc1"-> System.out.println("1");
+		case "abc2",
+		/* ??? */ "abc3", "abc4"-> System.out.println("234");
+		case "abc5", "abc6"-> {
+		}
+		case "abc7"-> {
+			System.out.println("7");
+			return;
+		}
+		default -> System.out.println("?");
+		}
+
+		int value = switch(ABC) {
+		case A:
+		break 1;
+		case B:
+			System.out.println("!!!");
+			return;
+		case BB:
+			;
+		case C, D, E, F, G:
+		case H, I, J: {
+			System.out.println("@@@");
+			break 3454366;
+		}
+		default:
+		break 6;
+		};
+
+		Object value2 = switch(a.b.c.d(e.f.g.h())) {
+		case a-> {
+			System.out.println("aaaaaaa");
+			break "";
+		}
+		case b + c, d.e, f("aaaaaaaaaaaa"//
+				+ //
+				"bbbbbbbbb"//
+		), (33), aaa = bbb + ccc, new int[] { 1, 2, aaa }, AAA::BBB-> (Runnable) () -> f();
+		// $$$$
+		case new Object() {
+			String toString() {
+				return "";
+			}
+		}-> ABCD;
+		case null-> {
+			return null;
+		}
+		case something-> //
+		null;
+		default -> throw new RuntimeException("unsupported");
+		};
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/D_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/D_out.java
new file mode 100644
index 0000000..49e0db7
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/D_out.java
@@ -0,0 +1,76 @@
+
+public class C {
+
+	void foo() {
+		switch ( a + b + c /* + d */
+				+ e + f)
+		{
+		case 1, 2, 99999, 5, 6:
+			method1();
+			break;
+		case 999, 998, 997:
+		case 996, 995, //
+		994:
+			method2();
+		default:
+			method3();
+		}
+
+		switch ( "a" + "b" + "c" //
+				+ something)
+		{
+		case "abc1" ->System.out.println("1");
+		case "abc2",
+		/* ??? */ "abc3", "abc4" ->System.out.println("234");
+		case "abc5", "abc6" ->{
+		}
+		case "abc7" ->{
+			System.out.println("7");
+			return;
+		}
+		default -> System.out.println("?");
+		}
+
+		int value = switch ( ABC)
+		{
+		case A:
+			break 1;
+		case B:
+			System.out.println("!!!");
+			return;
+		case BB:
+			;
+		case C, D, E, F, G:
+		case H, I, J:{
+			System.out.println("@@@");
+			break 3454366;
+		}
+		default:
+			break 6;
+		};
+
+		Object value2 = switch ( a.b.c.d(e.f.g.h()))
+		{
+		case a ->{
+			System.out.println("aaaaaaa");
+			break "";
+		}
+		case b + c, d.e, f("aaaaaaaaaaaa"//
+				+ //
+				"bbbbbbbbb"//
+		), (33), aaa = bbb + ccc, new int[] { 1, 2, aaa }, AAA::BBB ->(Runnable) () -> f();
+		// $$$$
+		case new Object() {
+			String toString() {
+				return "";
+			}
+		} ->ABCD;
+		case null ->{
+			return null;
+		}
+		case something -> //
+			null;
+		default -> throw new RuntimeException("unsupported");
+		};
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/E_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/E_out.java
new file mode 100644
index 0000000..d8bbd1a
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/E_out.java
@@ -0,0 +1,80 @@
+
+public class C {
+
+	void foo() {
+		switch (
+			a + b + c /* + d */
+					+ e + f
+		) {
+		case 1, 2, 99999, 5, 6:
+			method1();
+			break;
+		case 999, 998, 997:
+		case 996, 995, //
+		994:
+			method2();
+		default :
+			method3();
+		}
+
+		switch (
+			"a" + "b" + "c" //
+					+ something
+		) {
+		case "abc1" -> System.out.println("1");
+		case "abc2",
+		/* ??? */ "abc3", "abc4" -> System.out.println("234");
+		case "abc5", "abc6" -> {
+		}
+		case "abc7" -> {
+			System.out.println("7");
+			return;
+		}
+		default-> System.out.println("?");
+		}
+
+		int value = switch (
+			ABC
+		) {
+		case A:
+			break 1;
+		case B:
+			System.out.println("!!!");
+			return;
+		case BB:
+			;
+		case C, D, E, F, G:
+		case H, I, J: {
+			System.out.println("@@@");
+			break 3454366;
+		}
+		default :
+			break 6;
+		};
+
+		Object value2 = switch (
+			a.b.c.d(e.f.g.h())
+		) {
+		case a -> {
+			System.out.println("aaaaaaa");
+			break "";
+		}
+		case b + c, d.e, f("aaaaaaaaaaaa"//
+				+ //
+				"bbbbbbbbb"//
+		), (33), aaa = bbb + ccc, new int[] { 1, 2, aaa }, AAA::BBB -> (Runnable) () -> f();
+		// $$$$
+		case new Object() {
+			String toString() {
+				return "";
+			}
+		} -> ABCD;
+		case null -> {
+			return null;
+		}
+		case something -> //
+			null;
+		default-> throw new RuntimeException("unsupported");
+		};
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/F_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/F_out.java
new file mode 100644
index 0000000..6ad72c3
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/F_out.java
@@ -0,0 +1,72 @@
+
+public class C {
+
+	void foo() {
+		switch (a + b + c /* + d */
+				+ e + f){
+		case 1, 2, 99999, 5, 6:
+			method1();
+			break;
+		case 999, 998, 997:
+		case 996, 995, //
+		994:
+			method2();
+		default:
+			method3();
+		}
+
+		switch ("a" + "b" + "c" //
+				+ something){
+		case "abc1" -> System.out.println("1");
+		case "abc2",
+		/* ??? */ "abc3", "abc4" -> System.out.println("234");
+		case "abc5", "abc6" -> {
+		}
+		case "abc7" -> {
+			System.out.println("7");
+			return;
+		}
+		default ->System.out.println("?");
+		}
+
+		int value = switch (ABC){
+		case A:
+			break 1;
+		case B:
+			System.out.println("!!!");
+			return;
+		case BB:
+			;
+		case C, D, E, F, G:
+		case H, I, J:{
+			System.out.println("@@@");
+			break 3454366;
+		}
+		default:
+			break 6;
+		};
+
+		Object value2 = switch (a.b.c.d(e.f.g.h())){
+		case a -> {
+			System.out.println("aaaaaaa");
+			break "";
+		}
+		case b + c, d.e, f("aaaaaaaaaaaa"//
+				+ //
+				"bbbbbbbbb"//
+		), (33), aaa = bbb + ccc, new int[] { 1, 2, aaa }, AAA::BBB -> (Runnable) () -> f();
+		// $$$$
+		case new Object() {
+			String toString() {
+				return "";
+			}
+		} -> ABCD;
+		case null -> {
+			return null;
+		}
+		case something -> //
+			null;
+		default ->throw new RuntimeException("unsupported");
+		};
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/G_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/G_out.java
new file mode 100644
index 0000000..aa05baa
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/G_out.java
@@ -0,0 +1,72 @@
+
+public class C {
+
+	void foo() {
+		switch (a + b + c /* + d */
+				+ e + f) {
+		case 1, 2, 99999, 5, 6:
+			method1();
+			break;
+		case 999, 998, 997:
+		case 996, 995, //
+		994:
+			method2();
+		default:
+			method3();
+		}
+
+		switch ("a" + "b" + "c" //
+				+ something) {
+		case "abc1" -> System.out.println("1");
+		case "abc2",
+		/* ??? */ "abc3", "abc4" -> System.out.println("234");
+		case "abc5", "abc6" -> {
+		}
+		case "abc7" -> {
+			System.out.println("7");
+			return;
+		}
+		default -> System.out.println("?");
+		}
+
+		int value = switch (ABC) {
+		case A:
+			break 1;
+		case B:
+			System.out.println("!!!");
+			return;
+		case BB:
+			;
+		case C, D, E, F, G:
+		case H, I, J: {
+			System.out.println("@@@");
+			break 3454366;
+		}
+		default:
+			break 6;
+		};
+
+		Object value2 = switch (a.b.c.d(e.f.g.h())) {
+		case a -> {
+			System.out.println("aaaaaaa");
+			break "";
+		}
+		case b + c, d.e, f("aaaaaaaaaaaa"//
+				+ //
+				"bbbbbbbbb"//
+		), (33), aaa = bbb + ccc, new int[] { 1, 2, aaa }, AAA::BBB -> (Runnable) () -> f();
+		// $$$$
+		case new Object() {
+			String toString() {
+				return "";
+			}
+		} -> ABCD;
+		case null -> {
+			return null;
+		}
+		case something -> //
+			null;
+		default -> throw new RuntimeException("unsupported");
+		};
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/in.java
new file mode 100644
index 0000000..7dfd080
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test543818/in.java
@@ -0,0 +1,66 @@
+
+public class C {
+
+	void foo() {
+		switch (a + b + c /* + d */
+				+ e + f) {
+		case 1,2,99999,  5,6:
+			method1();
+		break;
+		case 999, 998, 997:
+		case 996, 995, //
+		994:
+			method2();
+		default:
+			method3();
+		}
+		
+		switch ("a" + "b" + "c" //
+		+ something) {
+		case "abc1" -> System.out.println("1");
+		case "abc2",
+		/* ??? */   "abc3", "abc4" -> System.out.println("234");
+		case "abc5", "abc6" -> {}
+		case "abc7" -> {
+			System.out.println("7");
+			return;
+		}
+		default-> System.out.println("?");
+		}
+		
+		int value = switch(ABC) {
+		case A:
+			break 1;
+		case B:
+			System.out.println("!!!");
+			return;
+		case BB:;
+		case C, D, E, F, G:
+		case H, I, J: {
+			System.out.println("@@@");
+			break 3454366;
+		}
+			default: break 6;
+		};
+		
+		Object value2 = switch(a.b.c.d(e.f.g.h())) {
+		case a -> {
+			System.out.println("aaaaaaa");
+			break "";
+		}
+		case b + c, d.e, f("aaaaaaaaaaaa"//
+		+//
+		"bbbbbbbbb"//
+		), (33), aaa = bbb + ccc,
+		new int[] {1, 2, aaa}, AAA::BBB -> (Runnable)()->f();
+		// $$$$
+		case new Object() { String toString() { return "";}} -> ABCD;
+		case null -> {
+		return null;
+		}
+		case something -> //
+		null;
+		default -> throw new RuntimeException("unsupported");
+		};
+	}
+}
diff --git a/org.eclipse.jdt.core/.settings/.api_filters b/org.eclipse.jdt.core/.settings/.api_filters
new file mode 100644
index 0000000..a0ecc9a
--- /dev/null
+++ b/org.eclipse.jdt.core/.settings/.api_filters
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.jdt.core" version="2">
+    <resource path="META-INF/MANIFEST.MF">
+        <filter id="924844039">
+            <message_arguments>
+                <message_argument value="3.16.0"/>
+                <message_argument value="3.16.0"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Address this while merging 12" id="924844039">
+            <message_arguments>
+                <message_argument value="3.17.0"/>
+                <message_argument value="3.17.0"/>
+            </message_arguments>
+        </filter>
+    </resource>
+    <resource path="compiler/org/eclipse/jdt/core/compiler/CategorizedProblem.java" type="org.eclipse.jdt.core.compiler.CategorizedProblem">
+        <filter comment="To be addressed while merging 12" id="336658481">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.CategorizedProblem"/>
+                <message_argument value="CAT_COMPLIANCE"/>
+            </message_arguments>
+        </filter>
+    </resource>
+    <resource path="compiler/org/eclipse/jdt/core/compiler/IProblem.java" type="org.eclipse.jdt.core.compiler.IProblem">
+        <filter id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="IgnoreCategoriesMask"/>
+                <message_argument value="8388607"/>
+            </message_arguments>
+        </filter>
+    </resource>
+    <resource path="dom/org/eclipse/jdt/core/dom/BreakStatement.java" type="org.eclipse.jdt.core.dom.BreakStatement">
+        <filter comment="For Java 12 support." id="336658481">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.dom.BreakStatement"/>
+                <message_argument value="EXPRESSION_PROPERTY"/>
+            </message_arguments>
+        </filter>
+    </resource>
+    <resource path="dom/org/eclipse/jdt/core/dom/SwitchCase.java" type="org.eclipse.jdt.core.dom.SwitchCase">
+        <filter comment="For Java 12" id="336658481">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.dom.SwitchCase"/>
+                <message_argument value="EXPRESSIONS2_PROPERTY"/>
+            </message_arguments>
+        </filter>
+        <filter comment="For Java 12 Support - case -&gt;" id="336658481">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.dom.SwitchCase"/>
+                <message_argument value="SWITCH_LABELED_RULE_PROPERTY"/>
+            </message_arguments>
+        </filter>
+    </resource>
+    <resource path="model/org/eclipse/jdt/core/util/IClassFileReader.java" type="org.eclipse.jdt.core.util.IClassFileReader">
+        <filter comment="default method added for getting nest members" id="404000815">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.util.IClassFileReader"/>
+                <message_argument value="getNestMembersAttribute()"/>
+            </message_arguments>
+        </filter>
+    </resource>
+</component>
diff --git a/org.eclipse.jdt.core/META-INF/MANIFEST.MF b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
index 3aa1e9b..22514be 100644
--- a/org.eclipse.jdt.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.core; singleton:=true
-Bundle-Version: 3.17.0.OTDT_r273_qualifier
+Bundle-Version: 3.17.100.OTDT_r273_qualifier
 Bundle-Activator: org.eclipse.jdt.core.JavaCore
 Bundle-Vendor: %providerName
 B