update jdt.core to I20190522-1800 for 2019-06 M3
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 403270f..fc53e87 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
@@ -37,6 +37,7 @@
 import java.io.PrintWriter;
 import java.net.URL;
 import java.text.MessageFormat;
+import java.nio.file.Files;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -95,6 +96,7 @@
 import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
 import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
 import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
+import org.eclipse.jdt.internal.compiler.util.SuffixConstants;
 import org.eclipse.jdt.internal.core.search.JavaSearchParticipant;
 import org.eclipse.jdt.internal.core.search.indexing.BinaryIndexer;
 import org.eclipse.jdt.internal.core.util.Messages;
@@ -2233,6 +2235,8 @@
 						File.separator + compiler.rawVersion); // need to change output directory per javac version
 				if (shouldFlushOutputDirectory) {
 					Util.delete(javacOutputDirectory);
+				} else {
+					deleteSourceFiles(javacOutputDirectory);
 				}
 				javacOutputDirectory.mkdirs();
 				// write test files
@@ -2353,6 +2357,17 @@
 		}
 	}
 }
+private void deleteSourceFiles(File directory) {
+	try {
+		Files.walk(directory.toPath())
+			.filter(f -> f.endsWith(SuffixConstants.SUFFIX_STRING_java))
+			.map(java.nio.file.Path::toFile)
+			.filter(File::isFile)
+			.forEach(File::delete);
+	} catch (IOException e) {
+		e.printStackTrace();
+	}
+}
 private boolean errorStringMatch(String expectedErrorStringStart, String actualError) {
 	/*
 	 * From TestVerifier.checkBuffers(): 
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
index c87cea0..eeecb1c 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.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
@@ -25,8 +25,9 @@
  *								bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
  *     Ulrich Grave <ulrich.grave@gmx.de> - Contributions for
  *                              bug 386692 - Missing "unused" warning on "autowired" fields
- *     Pierre-Yves B. <pyvesdev@gmail.com> - Contribution for
+ *     Pierre-Yves B. <pyvesdev@gmail.com> - Contributions for
  *                              bug 542520 - [JUnit 5] Warning The method xxx from the type X is never used locally is shown when using MethodSource
+ *                              bug 546084 - Using Junit 5s MethodSource leads to ClassCastException
  *******************************************************************************/
 package org.eclipse.jdt.core.tests.compiler.regression;
 
@@ -12149,4 +12150,90 @@
 		"----------\n",
 		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
 }
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=546084 - Using Junit 5s MethodSource leads to
+// ClassCastException - string concatenation, i.e. BinaryExpression in @MethodSource annotation
+public void testBug546084a() throws Exception {
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.ERROR);
+	runner.testFiles =
+		new String[] {
+			JUNIT_METHODSOURCE_NAME,
+			JUNIT_METHODSOURCE_CONTENT,
+			"ExampleTest.java",
+			"import java.util.Arrays;\n" +
+			"import java.util.List;\n" +
+			"import org.junit.jupiter.params.provider.MethodSource;\n" +
+			"public class ExampleTest {\n" +
+			"\n" +
+			"	 private final String TEST_METHOD_PREFIX = \"get\";\n" +
+			"	 @MethodSource(TEST_METHOD_PREFIX + \"Integers\")\n" +
+			"	 void testIntegers(Integer integer) {}\n" +
+			"	 \n" +
+			"	 private static List<Integer> getIntegers() {\n" +
+			"		return Arrays.asList(0, 5, 1);\n" +
+			"	}\n" +
+			"}\n",
+		};
+	runner.runConformTest();
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=546084 - Using Junit 5s MethodSource leads to
+// ClassCastException - non string value, e.g. ClassLiteralAccess in @MethodSource annotation
+public void testBug546084b() throws Exception {
+	this.runNegativeTest(
+		new String[] {
+			JUNIT_METHODSOURCE_NAME,
+			JUNIT_METHODSOURCE_CONTENT,
+			"ExampleTest.java",
+			"import java.util.Arrays;\n" +
+			"import java.util.List;\n" +
+			"import org.junit.jupiter.params.provider.MethodSource;\n" +
+			"public class ExampleTest {\n" +
+			"\n" +
+			"	 @MethodSource(Object.class)\n" +
+			"	 void testIntegers(Integer integer) {}\n" +
+			"	 \n" +
+			"	 private static List<Integer> getIntegers(int i) {\n" +
+			"		return Arrays.asList(0, 5, 1);\n" +
+			"	}\n" +
+			"}\n",
+		},
+		"----------\n" +
+		"1. ERROR in ExampleTest.java (at line 6)\n" +
+		"	@MethodSource(Object.class)\n" +
+		"	              ^^^^^^^^^^^^\n" +
+		"Type mismatch: cannot convert from Class<Object> to String[]\n" +
+		"----------\n" +
+		"2. WARNING in ExampleTest.java (at line 9)\n" +
+		"	private static List<Integer> getIntegers(int i) {\n" +
+		"	                             ^^^^^^^^^^^^^^^^^^\n" +
+		"The method getIntegers(int) from the type ExampleTest is never used locally\n" +
+		"----------\n");
+}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=546084 - Using Junit 5s MethodSource leads to
+//ClassCastException - array of string values, e.g. ArrayInitializer in @MethodSource annotation
+public void testBug546084c() throws Exception {
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.ERROR);
+	runner.testFiles =
+		new String[] {
+			JUNIT_METHODSOURCE_NAME,
+			JUNIT_METHODSOURCE_CONTENT,
+			"ExampleTest.java",
+			"import java.util.Arrays;\n" +
+			"import java.util.List;\n" +
+			"import org.junit.jupiter.params.provider.MethodSource;\n" +
+			"public class ExampleTest {\n" +
+			"\n" +
+			"	 @MethodSource({ \"getIntegers\" })\n" +
+			"	 void testIntegers(Integer integer) {}\n" +
+			"	 \n" +
+			"	 private static List<Integer> getIntegers() {\n" + 
+			"		return Arrays.asList(0, 5, 1);\n" + 
+			"	}\n" +
+			"}\n",
+		};
+	runner.runConformTest();
+}
 }
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 b928a4b..a0a7e90 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
@@ -812,6 +812,7 @@
 		expectedProblemAttributes.put("MissingTypeInLambda", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
 		expectedProblemAttributes.put("MissingTypeInMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
 		expectedProblemAttributes.put("MissingValueForAnnotationMember", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+		expectedProblemAttributes.put("MissingValueFromLambda", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
 		expectedProblemAttributes.put("MultiCatchNotBelow17", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
 		expectedProblemAttributes.put("MultipleFunctionalInterfaces", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
 		expectedProblemAttributes.put("StaticInterfaceMethodNotBelow18", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
@@ -1045,6 +1046,7 @@
 		expectedProblemAttributes.put("UndefinedLabel", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
 		expectedProblemAttributes.put("UndefinedMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
 		expectedProblemAttributes.put("UndefinedModule", new ProblemAttributes(CategorizedProblem.CAT_MODULE));
+		expectedProblemAttributes.put("UndefinedModuleAddReads", new ProblemAttributes(CategorizedProblem.CAT_BUILDPATH));
 		expectedProblemAttributes.put("UndefinedName", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
 		expectedProblemAttributes.put("UndefinedType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
 		expectedProblemAttributes.put("UndefinedTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
@@ -1843,6 +1845,7 @@
 		expectedProblemAttributes.put("MissingTypeInLambda", SKIP);
 		expectedProblemAttributes.put("MissingTypeInMethod", SKIP);
 		expectedProblemAttributes.put("MissingValueForAnnotationMember", SKIP);
+		expectedProblemAttributes.put("MissingValueFromLambda", SKIP);
 		expectedProblemAttributes.put("MultiCatchNotBelow17", SKIP);
 		expectedProblemAttributes.put("MultipleFunctionalInterfaces", SKIP);
 		expectedProblemAttributes.put("StaticInterfaceMethodNotBelow18", SKIP);
@@ -2076,6 +2079,7 @@
 		expectedProblemAttributes.put("UndefinedLabel", SKIP);
 		expectedProblemAttributes.put("UndefinedMethod", SKIP);
 		expectedProblemAttributes.put("UndefinedModule", SKIP);
+		expectedProblemAttributes.put("UndefinedModuleAddReads", SKIP);
 		expectedProblemAttributes.put("UndefinedName", SKIP);
 		expectedProblemAttributes.put("UndefinedType", SKIP);
 		expectedProblemAttributes.put("UndefinedTypeVariable", SKIP);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
index 4a3a045..2becc1c 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
@@ -9628,4 +9628,282 @@
 				"----------\n";
 		runner.runNegativeTest();
 	}
+	public void testBug512156_3() {
+		runConformTest(
+			new String[] {
+				"TestFor3TypeParameters.java",
+				"import java.util.Objects;\n" + 
+				"import java.util.stream.Stream;\n" + 
+				"import java.util.stream.StreamSupport;\n" + 
+				"\n" + 
+				"/**\n" + 
+				" * For comprehension for 3 iterables. Adapted from the http://javaslang.io library to help finding JDT performance bottlenecks.\n" + 
+				" *\n" + 
+				" */\n" + 
+				"public class TestFor3TypeParameters {\n" + 
+				"\n" + 
+				"    public interface Function3<T1, T2, T3, R> {\n" + 
+				"        R apply(T1 t1, T2 t2, T3 t3);\n" + 
+				"    }    \n" + 
+				"    \n" + 
+				"    public static class For3<T1, T2, T3> {\n" + 
+				"\n" + 
+				"        private final Iterable<T1> ts1;\n" + 
+				"        private final Iterable<T2> ts2;\n" + 
+				"        private final Iterable<T3> ts3;\n" + 
+				"\n" + 
+				"        private For3(Iterable<T1> ts1, Iterable<T2> ts2, Iterable<T3> ts3) {\n" + 
+				"            this.ts1 = ts1;\n" + 
+				"            this.ts2 = ts2;\n" + 
+				"            this.ts3 = ts3;\n" + 
+				"        }\n" + 
+				"\n" + 
+				"        /**\n" + 
+				"         * Yields a result for elements of the cross product of the underlying Iterables.\n" + 
+				"         *\n" + 
+				"         * @param f\n" + 
+				"         *            a function that maps an element of the cross product to a result\n" + 
+				"         * @param <R>\n" + 
+				"         *            type of the resulting {@code Iterator} elements\n" + 
+				"         * @return an {@code Iterator} of mapped results\n" + 
+				"         */\n" + 
+				"        public <R> Stream<R> yield(\n" + 
+				"                Function3<? super T1, ? super T2, ? super T3, ? extends R> f) {\n" + 
+				"            Objects.requireNonNull(f, \"f is null\");\n" + 
+				"            return this.stream(ts1)\n" + 
+				"                .flatMap(t1 ->\n" + 
+				"                    stream(ts2).flatMap(t2 -> \n" + 
+				"                        stream(ts3).map(t3 ->\n" + 
+				"                            f.apply(t1, t2, t3)\n" + 
+				"                        )\n" + 
+				"                    )\n" + 
+				"                );\n" + 
+				"        }\n" + 
+				"\n" + 
+				"        private <T> Stream<T> stream(Iterable<T> iterable) {\n" + 
+				"            return StreamSupport.stream(iterable.spliterator(), false);\n" + 
+				"        }\n" + 
+				"\n" + 
+				"    }\n" + 
+				"}\n"
+			});
+	}
+	public void testBug512156_10() {
+		runConformTest(
+			new String[] {
+				"Test10.java",
+				"import java.util.Objects;\n" + 
+				"import java.util.stream.Stream;\n" + 
+				"import java.util.stream.StreamSupport;\n" + 
+				"\n" + 
+				"/**\n" + 
+				" * For comprehension for 10 iterables. Adapted from the http://javaslang.io library to help finding JDT performance bottlenecks.\n" + 
+				" *\n" + 
+				" */\n" + 
+				"public class Test10 {\n" + 
+				"\n" + 
+				"    public interface Function10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> {\n" + 
+				"        R apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10);\n" + 
+				"    }    \n" + 
+				"    \n" + 
+				"    public static class For10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> {\n" + 
+				"\n" + 
+				"        private final Iterable<T1> ts1;\n" + 
+				"        private final Iterable<T2> ts2;\n" + 
+				"        private final Iterable<T3> ts3;\n" + 
+				"        private final Iterable<T4> ts4;\n" + 
+				"        private final Iterable<T5> ts5;\n" + 
+				"        private final Iterable<T6> ts6;\n" + 
+				"        private final Iterable<T7> ts7;\n" + 
+				"        private final Iterable<T8> ts8;\n" + 
+				"        private final Iterable<T9> ts9;\n" + 
+				"        private final Iterable<T10> ts10;\n" + 
+				"\n" + 
+				"        private For10(Iterable<T1> ts1, Iterable<T2> ts2, Iterable<T3> ts3, Iterable<T4> ts4, Iterable<T5> ts5, Iterable<T6> ts6,\n" + 
+				"                Iterable<T7> ts7, Iterable<T8> ts8, Iterable<T9> ts9, Iterable<T10> ts10) {\n" + 
+				"            this.ts1 = ts1;\n" + 
+				"            this.ts2 = ts2;\n" + 
+				"            this.ts3 = ts3;\n" + 
+				"            this.ts4 = ts4;\n" + 
+				"            this.ts5 = ts5;\n" + 
+				"            this.ts6 = ts6;\n" + 
+				"            this.ts7 = ts7;\n" + 
+				"            this.ts8 = ts8;\n" + 
+				"            this.ts9 = ts9;\n" + 
+				"            this.ts10 = ts10;\n" + 
+				"        }\n" + 
+				"\n" + 
+				"        /**\n" + 
+				"         * Yields a result for elements of the cross product of the underlying Iterables.\n" + 
+				"         *\n" + 
+				"         * @param f\n" + 
+				"         *            a function that maps an element of the cross product to a result\n" + 
+				"         * @param <R>\n" + 
+				"         *            type of the resulting {@code Iterator} elements\n" + 
+				"         * @return an {@code Iterator} of mapped results\n" + 
+				"         */\n" + 
+				"        public <R> Stream<R> yield(\n" + 
+				"                Function10<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? extends R> f) {\n" + 
+				"            Objects.requireNonNull(f, \"f is null\");\n" + 
+				"            return this.stream(ts1)\n" + 
+				"                .flatMap(t1 ->\n" + 
+				"                    stream(ts2).flatMap(t2 -> \n" + 
+				"                        stream(ts3).flatMap(t3 -> \n" + 
+				"                            stream(ts4).flatMap(t4 -> \n" + 
+				"                                stream(ts5).flatMap(t5 -> \n" + 
+				"                                    stream(ts6).flatMap(t6 -> \n" + 
+				"                                        stream(ts7).flatMap(t7 -> \n" + 
+				"                                            stream(ts8).flatMap(t8 ->\n" + 
+				"                                            	stream(ts9).flatMap(t9 ->\n" + 
+				"                                            		stream(ts10).map(t10 -> /**/\n" + 
+				"                                                		f.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)\n" + 
+				"                                                	)\n" + 
+				"                                                )\n" + 
+				"                                            )\n" + 
+				"                                        )\n" + 
+				"                                    )\n" + 
+				"                                )\n" + 
+				"                            )\n" + 
+				"                        )\n" + 
+				"                    )\n" + 
+				"                );\n" + 
+				"        }\n" + 
+				"\n" + 
+				"        private <T> Stream<T> stream(Iterable<T> iterable) {\n" + 
+				"            return StreamSupport.stream(iterable.spliterator(), false);\n" + 
+				"        }\n" + 
+				"\n" + 
+				"    }\n" + 
+				"}\n"
+			});
+	}
+	public void testBug547061() {
+		runConformTest(
+			new String[] {
+				"test2/Problematic.java",
+				"package test2;\n" + 
+				"\n" + 
+				"import java.io.IOException;\n" + 
+				"import java.util.Collections;\n" + 
+				"import java.util.Set;\n" + 
+				"import java.util.function.Consumer;\n" + 
+				"\n" + 
+				"public class Problematic {\n" + 
+				"\n" + 
+				"	@FunctionalInterface\n" + 
+				"	private interface ThrowingConsumer<T, E extends Throwable> {\n" + 
+				"		void accept(T t) throws E;\n" + 
+				"	}\n" + 
+				"\n" + 
+				"	private class FileAsset {\n" + 
+				"		public FileAsset move(String path) throws IOException {\n" + 
+				"			System.out.println(path);\n" + 
+				"			return null;\n" + 
+				"		}\n" + 
+				"	}\n" + 
+				"\n" + 
+				"	static <T, E extends Exception> void process(Consumer<Consumer<T>> code, ThrowingConsumer<T, E> throwingConsumer)\n" + 
+				"			throws E {\n" + 
+				"		code.accept(t -> {\n" + 
+				"			try {\n" + 
+				"				throwingConsumer.accept(t);\n" + 
+				"			} catch (Exception e) {\n" + 
+				"				e.printStackTrace();\n" + 
+				"			}\n" + 
+				"		});\n" + 
+				"	}\n" + 
+				"\n" + 
+				"	public void execute(String path) throws IOException {\n" + 
+				"		Set<FileAsset> set = Collections.singleton(new FileAsset());\n" + 
+				"		process(set::forEach, (asset) -> {\n" + 
+				"			process(set::forEach, (asset2) -> {\n" + 
+				"				asset2.move(path);\n" + 
+				"			});\n" + 
+				"		});\n" + 
+				"\n" + 
+				"	}\n" + 
+				"}\n"
+			});
+	}
+	public void testBug545420() {
+		runConformTest(
+			new String[] {
+				"Main.java",
+				"public class Main {\n" + 
+				"	public static void main(String[] args) {  \n" + 
+				"		System.out.println(new Main().getDetailCellCssFactory().getReturn());\n" + 
+				"	}\n" + 
+				"\n" + 
+				"	public FIReturnType getDetailCellCssFactory() {\n" + 
+				"		\n" + 
+				"		return 	method1(()-> {\n" + 
+				"					return  () ->{\n" + 
+				"							return \"something\";\n" + 
+				"					};\n" + 
+				"			});\n" + 
+				"	}\n" + 
+				"	\n" + 
+				"	public <X> X method1(FIWithGenerics<X> init) {\n" + 
+				"		return init.init();		\n" + 
+				"	}\n" + 
+				"}\n" + 
+				"interface FIReturnType {\n" + 
+				"	String getReturn();\n" + 
+				"}\n" + 
+				"interface FIWithGenerics<X> {\n" + 
+				"	 X init();\n" + 
+				"}\n"
+			});
+	}
+	public void testBug525822() {
+		runNegativeTest(
+			new String[] {
+				"ECJTest.java",
+				"import java.util.*;\n" + 
+				"import java.util.function.*;\n" + 
+				"\n" + 
+				"public class ECJTest {\n" + 
+				"\n" + 
+				"	static {\n" + 
+				"		final List<String> list = new ArrayList<>();\n" + 
+				"		accept(list::add);\n" + 
+				"	}\n" + 
+				"\n" + 
+				"	static void accept(Consumer<String> yay) {};\n" + 
+				"	static void accept(BiConsumer<String, String> nooo) {};\n" + 
+				"}\n"
+			},
+			"----------\n" + 
+			"1. ERROR in ECJTest.java (at line 8)\n" + 
+			"	accept(list::add);\n" + 
+			"	^^^^^^\n" + 
+			"The method accept(Consumer<String>) is ambiguous for the type ECJTest\n" + 
+			"----------\n");
+	}
+	public void testBug502327() {
+		runConformTest(
+			new String[] {
+				"Bug.java",
+				"public class Bug {\n" + 
+				"\n" + 
+				"  public void execute() {\n" + 
+				"    foo(bar(new ExampleType()));\n" + 
+				"  }\n" + 
+				"\n" + 
+				"  public <VC> void foo(ClassB<VC> a) {}\n" + 
+				"\n" + 
+				"  public <T> ClassC<T> bar(T t) {\n" + 
+				"    return null;\n" + 
+				"  }\n" + 
+				"\n" + 
+				"  public class ClassC<T> extends ClassB<ClassC<T>.NestedClassC> {\n" + 
+				"    public class NestedClassC {}\n" + 
+				"  }\n" + 
+				"\n" + 
+				"  public abstract static class ClassB<VC> {}\n" + 
+				"\n" + 
+				"  public class ExampleType {}\n" + 
+				"}\n"
+			});
+	}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
index d23366f..5be3c39 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
@@ -4671,9 +4671,7 @@
 }
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=437781, [1.8][compiler] Eclipse accepts code rejected by javac because of ambiguous method reference
 public void test437781() {
-	this.runConformTest(
-		false,
-		EclipseHasABug.EclipseBug510528,
+	this.runNegativeTest(
 		new String[] {
 			"X.java",
 			"import java.util.function.Consumer;\n" +
@@ -4691,7 +4689,17 @@
 			"	}	\n" +
 			"}\n"
 		},
-		"Consumer");
+		"----------\n" + 
+		"1. ERROR in X.java (at line 5)\n" + 
+		"	new X().visit( System.out::println );\n" + 
+		"	        ^^^^^\n" + 
+		"The method visit(Function<Integer,Boolean>) is ambiguous for the type X\n" + 
+		"----------\n" + 
+		"2. ERROR in X.java (at line 5)\n" + 
+		"	new X().visit( System.out::println );\n" + 
+		"	               ^^^^^^^^^^^^^^^^^^^\n" + 
+		"The type of println(Object) from the type PrintStream is void, this is incompatible with the descriptor\'s return type: Boolean\n" + 
+		"----------\n");
 }
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=443889, [1.8][compiler] Lambdas get compiled to duplicate methods
 public void test443889() {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java
index a7309d5..7f9e4e2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java
@@ -571,8 +571,8 @@
 		"----------\n" + 
 		"1. ERROR in X.java (at line 8)\n" + 
 		"	goo((x) -> {while (FALSE) throw new Exception();});\n" + 
-		"	^^^\n" + 
-		"The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" + 
+		"	    ^^^^^^\n" + 
+		"This lambda expression must return a result of type String\n" + 
 		"----------\n");
 }
 public void test017() {
@@ -977,8 +977,8 @@
 		"----------\n" + 
 		"1. ERROR in X.java (at line 8)\n" + 
 		"	goo((x) -> {\n" + 
-		"	^^^\n" + 
-		"The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" + 
+		"	    ^^^^^^\n" + 
+		"This lambda expression must return a result of type String\n" + 
 		"----------\n");
 }
 public void test030() {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java
index 99e4545..4cf5e61 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 2018 IBM Corporation and others.
+ * Copyright (c) 2011, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -5193,6 +5193,11 @@
 				"----------\n" + 
 				"3. ERROR in X.java (at line 7)\n" + 
 				"	new X().foo(()->{});\n" + 
+				"	        ^^^\n" + 
+				"The method foo(I<Object>) in the type X is not applicable for the arguments (() -> {})\n" + 
+				"----------\n" + 
+				"4. ERROR in X.java (at line 7)\n" + 
+				"	new X().foo(()->{});\n" + 
 				"	            ^^^^\n" + 
 				"The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" + 
 				"----------\n");
@@ -5827,13 +5832,13 @@
 				"----------\n" + 
 				"1. ERROR in X.java (at line 14)\n" + 
 				"	goo((x) -> { while (FALSE) throw new Exception(); });\n" + 
-				"	^^^\n" + 
-				"The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" + 
+				"	    ^^^^^^\n" + 
+				"This lambda expression must return a result of type String\n" + 
 				"----------\n" + 
 				"2. ERROR in X.java (at line 17)\n" + 
 				"	goo((x) -> { while (POI) throw new Exception(); });\n" + 
-				"	^^^\n" + 
-				"The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" + 
+				"	    ^^^^^^\n" + 
+				"This lambda expression must return a result of type String\n" + 
 				"----------\n" + 
 				"3. ERROR in X.java (at line 19)\n" + 
 				"	goo((x) -> { if (TRUE) throw new Exception(); });\n" + 
@@ -5842,8 +5847,8 @@
 				"----------\n" + 
 				"4. ERROR in X.java (at line 22)\n" + 
 				"	goo((x) -> { while (BLANK) throw new Exception(); });\n" + 
-				"	^^^\n" + 
-				"The method goo(I) in the type X is not applicable for the arguments ((<no type> x) -> {})\n" + 
+				"	    ^^^^^^\n" + 
+				"This lambda expression must return a result of type String\n" + 
 				"----------\n");
 }
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=401939, [1.8][compiler] Incorrect shape analysis leads to method resolution failure .
@@ -7814,7 +7819,7 @@
 					"}\n"
 			},
 			"----------\n" +
-			"1. ERROR in X.java (at line 1)\n" + 
+			"1. ERROR in X.java (at line 12)\n" + 
 			"	return xyz.\n" + 
 			"	       ^^^\n" + 
 			"Type mismatch: cannot convert from Integer to String\n" + 
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 d24d2dc..93b84cc 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
@@ -10589,7 +10589,7 @@
 	Map<String, String>  customOptions = getCompilerOptions();
 	customOptions.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
 	customOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);
-	runConformTestWithLibs(
+	runConformTest(
 		new String[] {
 			"X.java",
 			"public class X {\n"+
@@ -10598,9 +10598,13 @@
 			"            break loop;\n"+
 			"        }\n"+
 			"    }\n"+
+			"    public static void main(String[] args) {\n"+
+			"        new X().f();\n"+
+			"    }\n"+
 			"}\n"
 		},
-		customOptions,
-	    "");
+	    "",
+	    customOptions,
+	    new String[] {"--enable-preview"});
 }
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java
index a3ef6e4..d7a307d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java
@@ -1584,8 +1584,9 @@
 			"X is a raw type. References to generic type X<T> should be parameterized\n" + 
 			"----------\n");
 }
-public void test4008712q() {
-	this.runConformTest(
+public void test4008712q_raw() {
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"interface I {\n" +
@@ -1610,11 +1611,59 @@
 				"		goo(new X()::foo);\n" +
 				"	}\n" +
 				"}\n",
+			};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 20)\n" + 
+			"	goo(new X()::foo);\n" + 
+			"	^^^\n" + 
+			"The method goo(I) is ambiguous for the type X<T>\n" + 
+			"----------\n" + 
+			"2. WARNING in X.java (at line 20)\n" + 
+			"	goo(new X()::foo);\n" + 
+			"	    ^^^^^^^^^^^^\n" + 
+			"Type safety: The method foo(Object) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" + 
+			"----------\n" + 
+			"3. WARNING in X.java (at line 20)\n" + 
+			"	goo(new X()::foo);\n" + 
+			"	        ^\n" + 
+			"X is a raw type. References to generic type X<T> should be parameterized\n" + 
+			"----------\n";
+	runner.javacTestOptions = JavacTestOptions.Excuse.JavacCompilesIncorrectSource;
+	runner.runNegativeTest();
+}
+public void test4008712q_diamond() {
+	this.runConformTest(
+			new String[] {
+				"X.java",
+				"interface I {\n" +
+				"	void foo(String x);\n" +
+				"}\n" +
+				"interface J {\n" +
+				"	String foo(String x);\n" +
+				"}\n" +
+				"class Y<T> {\n" +
+				"	public T foo(T x) {\n" +
+				"		 return null;\n" +
+				"	}\n" +
+				"}\n" +
+				"public class X<T> extends Y<String> {\n" +
+				"	static void goo(I i) {\n" +
+				"		System.out.println(\"foo(I)\");\n" +
+				"	}\n" +
+				"	static void goo(J j) {\n" +
+				"		System.out.println(\"foo(J)\");\n" +
+				"	}\n" +
+				"	public static void main(String[] args) { \n" +
+				"		goo(new X<>()::foo);\n" +
+				"	}\n" +
+				"}\n",
 			},
-			"foo(I)");
+			"foo(J)");
 }
 public void test4008712r() {
-	this.runConformTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"interface I {\n" +
@@ -1639,8 +1688,16 @@
 				"		goo(new X[0]::clone);\n" +
 				"	}\n" +
 				"}\n",
-			},
-			"foo(I)");
+			};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 20)\n" + 
+			"	goo(new X[0]::clone);\n" + 
+			"	^^^\n" + 
+			"The method goo(I) is ambiguous for the type X<T>\n" + 
+			"----------\n";
+	runner.javacTestOptions = JavacTestOptions.Excuse.JavacCompilesIncorrectSource;
+	runner.runNegativeTest();
 }
 public void test4008712s() {
 	this.runConformTest(
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java
index 408c28b..36470b3 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java
@@ -8614,4 +8614,121 @@
 				assertEquals("Wrong contents", expectedOutput, actualOutput);
 			}
 	}
+	public void testBug5409021() throws Exception {
+		this.runConformTest(
+				new String[] {
+					"X.java",
+					"public class X {\n" + 
+					"\n" + 
+					"	public static void main(String[] args) {\n" + 
+					"		X error = new X();\n" + 
+					"		error.reproduce(\"hello\");\n" + 
+					"		System.out.println(\"DONE\");\n" + 
+					"	}\n" + 
+					"	\n" + 
+					"	public Object reproduce(Object param) throws RuntimeException {\n" + 
+					"		Object local;\n" + 
+					"		try {\n" + 
+					"			return param; \n" + 
+					"		} \n" + 
+					"		catch (RuntimeException e) {\n" + 
+					"			return null;\n" + 
+					"		} \n" + 
+					"		finally {\n" + 
+					"			if (param != null) {\n" + 
+					"				System.out.println(\"FINALLY\");\n" + 
+					"			}\n" + 
+					"			local = null;\n" + 
+					"		}\n" + 
+					"	}\n" + 
+					"}\n" + 
+					"",
+				},
+				"FINALLY\n" + 
+				"DONE");
+
+			ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
+			byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(new File(OUTPUT_DIR + File.separator  +"X.class"));
+			String actualOutput =
+				disassembler.disassemble(
+					classFileBytes,
+					"\n",
+					ClassFileBytesDisassembler.DETAILED);
+			String expectedOutput =
+					"  // Stack: 2, Locals: 6\n" + 
+					"  public java.lang.Object reproduce(java.lang.Object param) throws java.lang.RuntimeException;\n" + 
+					"     0  aload_1 [param]\n" + 
+					"     1  astore 5\n" + 
+					"     3  aload_1 [param]\n" + 
+					"     4  ifnull 15\n" + 
+					"     7  getstatic java.lang.System.out : java.io.PrintStream [23]\n" + 
+					"    10  ldc <String \"FINALLY\"> [43]\n" + 
+					"    12  invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" + 
+					"    15  aconst_null\n" + 
+					"    16  astore_2 [local]\n" + 
+					"    17  aload 5\n" + 
+					"    19  areturn\n" + 
+					"    20  astore_3 [e]\n" + 
+					"    21  aload_1 [param]\n" + 
+					"    22  ifnull 33\n" + 
+					"    25  getstatic java.lang.System.out : java.io.PrintStream [23]\n" + 
+					"    28  ldc <String \"FINALLY\"> [43]\n" + 
+					"    30  invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" + 
+					"    33  aconst_null\n" + 
+					"    34  astore_2 [local]\n" + 
+					"    35  aconst_null\n" + 
+					"    36  areturn\n" + 
+					"    37  astore 4\n" + 
+					"    39  aload_1 [param]\n" + 
+					"    40  ifnull 51\n" + 
+					"    43  getstatic java.lang.System.out : java.io.PrintStream [23]\n" + 
+					"    46  ldc <String \"FINALLY\"> [43]\n" + 
+					"    48  invokevirtual java.io.PrintStream.println(java.lang.String) : void [31]\n" + 
+					"    51  aconst_null\n" + 
+					"    52  astore_2 [local]\n" + 
+					"    53  aload 4\n" + 
+					"    55  athrow\n" + 
+					"      Exception Table:\n" + 
+					"        [pc: 0, pc: 3] -> 20 when : java.lang.RuntimeException\n" + 
+					"        [pc: 0, pc: 3] -> 37 when : any\n" + 
+					"        [pc: 20, pc: 21] -> 37 when : any\n" + 
+					"      Line numbers:\n" + 
+					"        [pc: 0, line: 12]\n" + 
+					"        [pc: 3, line: 18]\n" + 
+					"        [pc: 7, line: 19]\n" + 
+					"        [pc: 15, line: 21]\n" + 
+					"        [pc: 17, line: 12]\n" + 
+					"        [pc: 20, line: 14]\n" + 
+					"        [pc: 21, line: 18]\n" + 
+					"        [pc: 25, line: 19]\n" + 
+					"        [pc: 33, line: 21]\n" + 
+					"        [pc: 35, line: 15]\n" + 
+					"        [pc: 37, line: 17]\n" + 
+					"        [pc: 39, line: 18]\n" + 
+					"        [pc: 43, line: 19]\n" + 
+					"        [pc: 51, line: 21]\n" + 
+					"        [pc: 53, line: 22]\n" + 
+					"      Local variable table:\n" + 
+					"        [pc: 0, pc: 56] local: this index: 0 type: X\n" + 
+					"        [pc: 0, pc: 56] local: param index: 1 type: java.lang.Object\n" + 
+					"        [pc: 17, pc: 20] local: local index: 2 type: java.lang.Object\n" + 
+					"        [pc: 35, pc: 37] local: local index: 2 type: java.lang.Object\n" + 
+					"        [pc: 53, pc: 56] local: local index: 2 type: java.lang.Object\n" + 
+					"        [pc: 21, pc: 37] local: e index: 3 type: java.lang.RuntimeException\n" + 
+					"      Stack map table: number of frames 5\n" + 
+					"        [pc: 15, full, stack: {}, locals: {X, java.lang.Object, _, _, _, java.lang.Object}]\n" + 
+					"        [pc: 20, full, stack: {java.lang.RuntimeException}, locals: {X, java.lang.Object}]\n" + 
+					"        [pc: 33, full, stack: {}, locals: {X, java.lang.Object, _, java.lang.RuntimeException}]\n" + 
+					"        [pc: 37, full, stack: {java.lang.Throwable}, locals: {X, java.lang.Object}]\n" + 
+					"        [pc: 51, full, stack: {}, locals: {X, java.lang.Object, _, _, java.lang.Throwable}]\n" + 
+					"}";
+
+			int index = actualOutput.indexOf(expectedOutput);
+			if (index == -1 || expectedOutput.length() == 0) {
+				System.out.println(Util.displayString(actualOutput, 2));
+			}
+			if (index == -1) {
+				assertEquals("Wrong contents", expectedOutput, actualOutput);
+			}
+	}
 }
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
index 66d8d68..a936514 100644
--- 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
@@ -699,10 +699,10 @@
 		};
 
 		String expectedProblemLog =
-						"----------\n" + 
-						"1. ERROR in X.java (at line 7)\n" + 
-						"	case SUNDAY : System.out.println(Day.SUNDAY);\n" + 
-						"	^^^^^^^^^^^\n" + 
+				"----------\n" + 
+						"1. ERROR in X.java (at line 4)\n" + 
+						"	case SATURDAY, SUNDAY: \n" + 
+						"	^^^^^^^^^^^^^^^^^^^^^\n" + 
 						"Duplicate case\n" + 
 						"----------\n" + 
 						"2. ERROR in X.java (at line 7)\n" + 
@@ -748,9 +748,9 @@
 						"	        ^^^\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" + 
+						"2. ERROR in X.java (at line 4)\n" + 
+						"	case SATURDAY, SUNDAY: \n" + 
+						"	^^^^^^^^^^^^^^^^^^^^^\n" +
 						"Duplicate case\n" + 
 						"----------\n" + 
 						"3. ERROR in X.java (at line 7)\n" + 
@@ -1154,8 +1154,8 @@
 		};
 		String expectedProblemLog =
 				"----------\n" + 
-				"1. ERROR in X.java (at line 8)\n" + 
-				"	case 3, 4: \n" + 
+				"1. ERROR in X.java (at line 6)\n" + 
+				"	case 1, 3: \n" + 
 				"	^^^^^^^^^\n" + 
 				"Duplicate case\n" + 
 				"----------\n" + 
@@ -1195,8 +1195,8 @@
 		};
 		String expectedProblemLog =
 				"----------\n" + 
-				"1. ERROR in X.java (at line 8)\n" + 
-				"	case \"b\", \"c\": \n" + 
+				"1. ERROR in X.java (at line 6)\n" + 
+				"	case \"a\", \"b\": \n" + 
 				"	^^^^^^^^^^^^^\n" + 
 				"Duplicate case\n" + 
 				"----------\n" + 
@@ -2437,7 +2437,7 @@
 			"1. ERROR in X.java (at line 11)\n" + 
 			"	continue;\n" + 
 			"	^^^^^^^^^\n" + 
-			"Illegal last statement in Switch expression case body - continue, return not allowed\n" + 
+			"'continue' or 'return' cannot be the last statement in a Switch expression case body\n" + 
 			"----------\n");
 	}
 	public void testBug545983_02() {
@@ -2469,7 +2469,71 @@
 			"1. ERROR in X.java (at line 11)\n" + 
 			"	return 2;\n" + 
 			"	^^^^^^^^^\n" + 
-			"Illegal last statement in Switch expression case body - continue, return not allowed\n" + 
+			"'continue' or 'return' cannot be the last statement in a Switch expression case body\n" + 
+			"----------\n");
+	}
+	public void testBug547125_01() {
+		this.runNegativeTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" + 
+				"	void foo(Day day) {\n" + 
+				"		switch (day) {\n" + 
+				"		case SATURDAY, SUNDAY, SUNDAY:\n" + 
+				"			System.out.println(\"Weekend\");\n" + 
+				"		case MONDAY:\n" + 
+				"			System.out.println(\"Weekday\");\n" +
+				"		default: \n" + 
+				"		}\n" + 
+				"	}\n" + 
+				"}\n" + 
+				"\n" + 
+				"enum Day {\n" + 
+				"	MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" + 
+				"}",
+			},
+			"----------\n" + 
+			"1. ERROR in X.java (at line 4)\n" + 
+			"	case SATURDAY, SUNDAY, SUNDAY:\n" + 
+			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+			"Duplicate case\n" + 
+			"----------\n");
+	}
+	public void testBug547125_02() {
+		this.runNegativeTest(
+			new String[] {
+				"X.java",
+				"public class X {\n" + 
+				"	void foo(Day day) {\n" + 
+				"		switch (day) {\n" + 
+				"		case SATURDAY, SUNDAY, MONDAY:\n" + 
+				"			System.out.println(\"Weekend\");\n" + 
+				"		case MONDAY, SUNDAY:\n" + 
+				"			System.out.println(\"Weekday\");\n" +
+				"		default: \n" + 
+				"		}\n" + 
+				"	}\n" + 
+				"}\n" + 
+				"\n" + 
+				"enum Day {\n" + 
+				"	MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;\n" + 
+				"}",
+			},
+			"----------\n" + 
+			"1. ERROR in X.java (at line 4)\n" + 
+			"	case SATURDAY, SUNDAY, MONDAY:\n" + 
+			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+			"Duplicate case\n" + 
+			"----------\n" + 
+			"2. ERROR in X.java (at line 6)\n" + 
+			"	case MONDAY, SUNDAY:\n" + 
+			"	^^^^^^^^^^^^^^^^^^^\n" + 
+			"Duplicate case\n" + 
+			"----------\n" + 
+			"3. ERROR in X.java (at line 6)\n" + 
+			"	case MONDAY, SUNDAY:\n" + 
+			"	^^^^^^^^^^^^^^^^^^^\n" + 
+			"Duplicate case\n" + 
 			"----------\n");
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
index d3d8222..8129449 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
@@ -50,7 +50,7 @@
 	static {
 //		TESTS_NUMBERS = new int[] { 19 };
 //		TESTS_RANGE = new int[] { 1, -1 };
-//		TESTS_NAMES = new String[] {"test0001"};
+//		TESTS_NAMES = new String[] {"testLambdaSynthetic"};
 	}
 	public static Test suite() {
 		return buildModelTestSuite(ASTConverter18Test.class);
@@ -5378,5 +5378,51 @@
 	ASTNode node = buildAST(contents, this.workingCopy, false);
 	assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
 }
+public void testLambdaSynthetic() throws JavaModelException {
+	this.workingCopy = getWorkingCopy("/Converter18/src/xyz/X.java",
+			true/* resolve */);
+	String contents = 
+			"package xyz;\n"+
+					"\n"+
+					"interface Function<T, R> {\n"+
+					"    R apply(T t);\n"+
+					" }\n"+
+					"\n"+
+					"public class X {\n"+
+					"\n"+
+					"    private int instanceField = 952;\n"+
+					"\n"+
+					"    static public void main(String[] args) throws Exception {\n"+
+					"        new X().callLambda(\"hello\");\n"+
+					"    }\n"+
+					"\n"+
+					"    void callLambda(String outerArg) throws Exception {\n"+
+					"        double outerLocal = 1.0; // Effectively final\n"+
+					"\n"+
+					"        Function<String, Integer> lambda = lambdaArg -> {\n"+
+					"            int lambdaLocal = 6;\n"+
+					"            System.out.println(instanceField);\n"+
+					"            System.out.println(outerArg);\n"+
+					"            System.out.println(outerLocal);\n"+
+					"            System.out.println(lambdaArg);\n"+
+					"            System.out.println(lambdaLocal);\n"+
+					"            return lambdaArg.length();\n"+
+					"        };\n"+
+					"        int result = lambda.apply(\"degenerate case\");\n"+
+					"        System.out.println(result);\n"+
+					"    }\n"+
+					"}\n";
+	CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy);
+	TypeDeclaration typedeclaration = (TypeDeclaration) getASTNode(cu, 1);
+	MethodDeclaration methodDeclaration = (MethodDeclaration) typedeclaration.bodyDeclarations().get(2);
+	VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) methodDeclaration.getBody().statements().get(1);
+	VariableDeclarationFragment fragment = (VariableDeclarationFragment)variableDeclarationStatement.fragments().get(0);
+	LambdaExpression lambdaExpression = (LambdaExpression) fragment.getInitializer();
+	IMethodBinding binding = lambdaExpression.resolveMethodBinding();
+	IVariableBinding[] synVars = binding.getSyntheticOuterLocals();
+	assertEquals(2, synVars.length);
+	assertEquals("val$outerArg",synVars[0].getName());
+	assertEquals("val$outerLocal",synVars[1].getName());
+}
 
 }
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 2766254..1193890 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
@@ -1354,7 +1354,9 @@
 
 			// part two, where we access a module via a 'requires' reference from the second:
 			IJavaProject project2 = createJavaProject("Second", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
-			addClasspathEntry(project2, JavaCore.newProjectEntry(project1.getPath()));
+			addClasspathEntry(project2, JavaCore.newProjectEntry(project1.getPath(), null, false,
+					new IClasspathAttribute[] { JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true") },
+					false));
 			project2.open(null);
 			createFile("/Second/src/module-info.java",
 					"module second {\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java
index 9c3dbb1..827e9f1 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java
@@ -2428,6 +2428,63 @@
 	}
 }
 
+public void test543266() throws CoreException {
+	try {
+		String source = 
+				"/**\r\n" + 
+				"	 * enum A\r\n" + 
+				"	 */\r\n" + 
+				"	public /** V1 */ enum  /** V2 */ A  /** V3 */ {\r\n" + 
+				"		/** A */\r\n" + 
+				"		a /**/, /**/ //\r\n" + 
+				"		/** B */\r\n" + 
+				"		b,\r\n" + 
+				"		/** C */\r\n" + 
+				"		/*\r\n" + 
+				"		 * \r\n" + 
+				"		 */\r\n" + 
+				"		/** Real C */\r\n" + 
+				"		c\r\n" + 
+				"	}";
+		createFile("/P/src/X.java", source);
+		final ICompilationUnit compilationUnit = getCompilationUnit("/P/src/X.java");
+		
+		IType type = compilationUnit.getType("A");
+		final ISourceRange javadocRangeClass = type.getJavadocRange();
+		final int startClass = javadocRangeClass.getOffset();
+		final int endClass = javadocRangeClass.getLength() + startClass - 1;
+		String javadocSourceClass = source.substring(startClass, endClass);
+		assertTrue("Wrong javadoc", javadocSourceClass.indexOf("enum A") != -1);
+
+		IJavaElement[] children = type.getChildren();
+		for(IJavaElement child : children) {
+			final ISourceRange javadocRange = ((IMember) child).getJavadocRange();
+			final String elementName = child.getElementName();
+			
+			if("a".equals(elementName)) {
+				final int start = javadocRange.getOffset();
+				final int end = javadocRange.getLength() + start - 1;
+				String javadocSource = source.substring(start, end);
+				assertTrue("Wrong javadoc", javadocSource.indexOf("A") != -1);
+			}
+			else if("b".equals(elementName)) {
+				final int start = javadocRange.getOffset();
+				final int end = javadocRange.getLength() + start - 1;
+				String javadocSource = source.substring(start, end);
+				assertTrue("Wrong javadoc", javadocSource.indexOf("B") != -1);
+			}
+			else if("c".equals(elementName)) {
+				final int start = javadocRange.getOffset();
+				final int end = javadocRange.getLength() + start - 1;
+				String javadocSource = source.substring(start, end);
+				assertTrue("Wrong javadoc", javadocSource.indexOf("Real C") != -1);
+			}
+		}
+	} finally {
+		deleteFile("/P/src/X.java");
+	}
+}
+
 public void testApplyEdit() throws CoreException {
 	try {
 		String source =
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java
index 94486de..51b9379 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java
@@ -13,10 +13,17 @@
  *******************************************************************************/
 package org.eclipse.jdt.core.tests.model;
 
+import static org.eclipse.jdt.core.search.IJavaSearchScope.APPLICATION_LIBRARIES;
+import static org.eclipse.jdt.core.search.IJavaSearchScope.REFERENCED_PROJECTS;
+import static org.eclipse.jdt.core.search.IJavaSearchScope.SOURCES;
+import static org.eclipse.jdt.core.search.IJavaSearchScope.SYSTEM_LIBRARIES;
+
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IJavaElement;
@@ -37,6 +44,10 @@
 import org.eclipse.jdt.core.search.SearchParticipant;
 import org.eclipse.jdt.core.search.SearchPattern;
 import org.eclipse.jdt.core.search.TypeReferenceMatch;
+import org.eclipse.jdt.internal.core.JavaElement;
+import org.eclipse.jdt.internal.core.LocalVariable;
+import org.eclipse.jdt.internal.core.TypeParameter;
+import org.eclipse.jdt.internal.core.search.BasicSearchEngine;
 import org.eclipse.jdt.internal.core.search.indexing.IIndexConstants;
 
 import junit.framework.Test;
@@ -4628,5 +4639,104 @@
 	}
 }
 
+public void testBug547051_modular() throws Exception {
+	try {
+		IJavaProject project = createJava9Project("P");
+		IType type = project.findType("java.util.Collection");
+		IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(project, type, Boolean.TRUE, Boolean.TRUE, null);
+		BasicSearchEngine engine = new BasicSearchEngine();
+		char[] packageName = null;
+		char[] typeName = null;
+		AtomicBoolean r = new AtomicBoolean(false);
+		engine.searchAllTypeNames(packageName, SearchPattern.R_PATTERN_MATCH,
+				typeName, SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CAMELCASE_MATCH,
+				TYPE, scope,
+				(modifiers, packageName1, simpleTypeName, enclosingTypeNames, path, access) -> r.set(true),
+				IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, new NullProgressMonitor());
+		assertTrue("Type search has no matches for subtypes of " + type, r.get());
+	}
+	finally {
+		deleteProject("P");
+	}
+}
+
+public void testBug547051_modular2() throws Exception {
+	if (!isJRE9) {
+		return;
+	}
+	try {
+		IJavaProject project = createJava9Project("P");
+		IType type = project.findType("java.util.Collection");
+		IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(project, type, Boolean.TRUE, Boolean.TRUE, null);
+		BasicSearchEngine engine = new BasicSearchEngine();
+		char[] packageName = null;
+		char[] typeName = "HashSe".toCharArray();
+		AtomicBoolean r = new AtomicBoolean(false);
+		engine.searchAllTypeNames(packageName, SearchPattern.R_PATTERN_MATCH,
+				typeName, SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CAMELCASE_MATCH,
+				TYPE, scope,
+				(modifiers, packageName1, simpleTypeName, enclosingTypeNames, path, access) -> r.set(true),
+				IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, new NullProgressMonitor());
+		assertTrue("Type search has no matches for subtypes of " + type, r.get());
+	}
+	finally {
+		deleteProject("P");
+	}
+}
+public void testBug547051_modular3() throws Exception {
+	if(!isJRE9) {
+		return;
+	}
+	try {
+		IJavaProject project = createJava9Project("P");
+		IType type = project.findType("java.util.Collection");
+		IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(project, type, Boolean.TRUE, Boolean.TRUE, null);
+		BasicSearchEngine engine = new BasicSearchEngine();
+		char[] packageName = "java.util".toCharArray();
+		char[] typeName = "HashSet".toCharArray();
+		AtomicBoolean r = new AtomicBoolean(false);
+		engine.searchAllTypeNames(packageName, SearchPattern.R_PATTERN_MATCH,
+				typeName, SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CAMELCASE_MATCH,
+				TYPE, scope,
+				(modifiers, packageName1, simpleTypeName, enclosingTypeNames, path, access) -> r.set(true),
+				IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, new NullProgressMonitor());
+		assertTrue("Type search has no matches for subtypes of " + type, r.get());
+	}
+	finally {
+		deleteProject("P");
+	}
+}
+
+public void testBug547095_local_variables_search_modular() throws Exception {
+	try {
+		IJavaProject project = createJava9Project("P");
+		IType type = project.findType("java.util.Collection");
+		IMethod method = type.getMethod("equals", new String[] {"Ljava.lang.Object;" });
+		LocalVariable lv = new LocalVariable(((JavaElement)method), "o", 0, 0, 0, 0, "QObject;", null, 0, true);
+		SearchPattern pattern = SearchPattern.createPattern(lv, REFERENCES, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH);
+		IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, SYSTEM_LIBRARIES | APPLICATION_LIBRARIES | REFERENCED_PROJECTS | SOURCES);
+		search(pattern, scope, this.resultCollector);
+		// should not throw an error
+	}
+	finally {
+		deleteProject("P");
+	}
+}
+
+public void testBug547095_type_patter_search_modular() throws Exception {
+	try {
+		IJavaProject project = createJava9Project("P");
+		IType type = project.findType("java.util.Collection");
+		TypeParameter tp = new TypeParameter(((JavaElement)type), "E");
+		SearchPattern pattern = SearchPattern.createPattern(tp, REFERENCES, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH);
+		IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, SYSTEM_LIBRARIES | APPLICATION_LIBRARIES | REFERENCED_PROJECTS | SOURCES);
+		search(pattern, scope, this.resultCollector);
+		// should not throw an error
+	}
+	finally {
+		deleteProject("P");
+	}
+}
+
 // Add more tests here
 }
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java
index 2a232c7..f35deb4 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java
@@ -14,13 +14,17 @@
  *******************************************************************************/
 package org.eclipse.jdt.core.tests.model;
 
+import static org.eclipse.jdt.core.search.IJavaSearchScope.APPLICATION_LIBRARIES;
+import static org.eclipse.jdt.core.search.IJavaSearchScope.REFERENCED_PROJECTS;
+import static org.eclipse.jdt.core.search.IJavaSearchScope.SOURCES;
+import static org.eclipse.jdt.core.search.IJavaSearchScope.SYSTEM_LIBRARIES;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-
-import junit.framework.Test;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
@@ -33,6 +37,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.content.IContentType;
@@ -75,8 +80,11 @@
 import org.eclipse.jdt.core.tests.util.Util;
 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
 import org.eclipse.jdt.internal.core.ClassFile;
+import org.eclipse.jdt.internal.core.JavaElement;
 import org.eclipse.jdt.internal.core.JavaModelManager;
+import org.eclipse.jdt.internal.core.LocalVariable;
 import org.eclipse.jdt.internal.core.SourceMethod;
+import org.eclipse.jdt.internal.core.TypeParameter;
 import org.eclipse.jdt.internal.core.index.DiskIndex;
 import org.eclipse.jdt.internal.core.index.Index;
 import org.eclipse.jdt.internal.core.search.AbstractSearchScope;
@@ -91,6 +99,8 @@
 import org.eclipse.jdt.internal.core.search.matching.TypeDeclarationPattern;
 import org.eclipse.jdt.internal.core.search.matching.TypeReferencePattern;
 
+import junit.framework.Test;
+
 /**
  * Non-regression tests for bugs fixed in Java Search engine.
  */
@@ -15146,5 +15156,104 @@
 			"src/pack1/X.java void pack1.X.foo(Y) [foo] EXACT_MATCH"
 	);
 }
+public void testBug547051_nonModular() throws Exception {
+	try {
+		IJavaProject project = createJavaProject("P");
+		setUpProjectCompliance(project, "1.8", true);
+		IType type = project.findType("java.util.Collection");
+        IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(project, type, Boolean.TRUE, Boolean.TRUE, null);
+        BasicSearchEngine engine = new BasicSearchEngine();
+        char[] packageName = null;
+        char[] typeName = null;
+        AtomicBoolean r = new AtomicBoolean(false);
+        engine.searchAllTypeNames(packageName, SearchPattern.R_PATTERN_MATCH,
+        		typeName, SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CAMELCASE_MATCH,
+        		TYPE, scope,
+        		(modifiers, packageName1, simpleTypeName, enclosingTypeNames, path, access) -> r.set(true),
+        		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, new NullProgressMonitor());
 
+        assertTrue("Type search has no matches for subtypes of " + type, r.get());
+	}
+	finally {
+		deleteProject("P");
+	}
+}
+
+public void testBug547051_nonModular2() throws Exception {
+	try {
+		IJavaProject project = createJavaProject("P");
+		setUpProjectCompliance(project, "1.8", true);
+		IType type = project.findType("java.util.Collection");
+        IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(project, type, Boolean.TRUE, Boolean.TRUE, null);
+        BasicSearchEngine engine = new BasicSearchEngine();
+        char[] packageName = null;
+        char[] typeName = "HashSe".toCharArray();
+        AtomicBoolean r = new AtomicBoolean(false);
+        engine.searchAllTypeNames(packageName, SearchPattern.R_PATTERN_MATCH,
+        		typeName, SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CAMELCASE_MATCH,
+        		TYPE, scope,
+        		(modifiers, packageName1, simpleTypeName, enclosingTypeNames, path, access) -> r.set(true),
+        		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, new NullProgressMonitor());
+
+        assertTrue("Type search has no matches for subtypes of " + type, r.get());
+	}
+	finally {
+		deleteProject("P");
+	}
+}
+public void testBug547051_nonModular3() throws Exception {
+	try {
+		IJavaProject project = createJavaProject("P");
+		setUpProjectCompliance(project, "1.8", true);
+		IType type = project.findType("java.util.Collection");
+		IJavaSearchScope scope = SearchEngine.createStrictHierarchyScope(project, type, Boolean.TRUE, Boolean.TRUE, null);
+		BasicSearchEngine engine = new BasicSearchEngine();
+		char[] packageName = "java.util".toCharArray();
+		char[] typeName = "HashSet".toCharArray();
+		AtomicBoolean r = new AtomicBoolean(false);
+		engine.searchAllTypeNames(packageName, SearchPattern.R_PATTERN_MATCH,
+				typeName, SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CAMELCASE_MATCH,
+				TYPE, scope,
+				(modifiers, packageName1, simpleTypeName, enclosingTypeNames, path, access) -> r.set(true),
+				IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, new NullProgressMonitor());
+		assertTrue("Type search has no matches for subtypes of " + type, r.get());
+	}
+	finally {
+		deleteProject("P");
+	}
+}
+
+
+public void testBug547095_local_variables_search_non_modular() throws Exception {
+	try {
+		IJavaProject project = createJavaProject("P");
+		setUpProjectCompliance(project, "1.8", true);
+		IType type = project.findType("java.util.Collection");
+		IMethod method = type.getMethod("equals", new String[] {"Ljava.lang.Object;" });
+		LocalVariable lv = new LocalVariable(((JavaElement)method), "o", 0, 0, 0, 0, "QObject;", null, 0, true);
+		SearchPattern pattern = SearchPattern.createPattern(lv, REFERENCES, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH);
+		IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, SYSTEM_LIBRARIES | APPLICATION_LIBRARIES | REFERENCED_PROJECTS | SOURCES);
+		search(pattern, scope, this.resultCollector);
+		// should not throw an error
+	}
+	finally {
+		deleteProject("P");
+	}
+}
+
+public void testBug547095_type_pattern_search_non_modular() throws Exception {
+	try {
+		IJavaProject project = createJavaProject("P");
+		setUpProjectCompliance(project, "1.8", true);
+		IType type = project.findType("java.util.Collection");
+		TypeParameter tp = new TypeParameter(((JavaElement)type), "E");
+		SearchPattern pattern = SearchPattern.createPattern(tp, REFERENCES, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH);
+		IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, SYSTEM_LIBRARIES | APPLICATION_LIBRARIES | REFERENCED_PROJECTS | SOURCES);
+		search(pattern, scope, this.resultCollector);
+		// should not throw an error
+	}
+	finally {
+		deleteProject("P");
+	}
+}
 }
\ No newline at end of file
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 967662f..5b8459f 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
@@ -28,6 +28,7 @@
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IWorkspaceDescription;
 import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
@@ -3316,6 +3317,71 @@
 			deleteProject("com.greetings");
 		}
 	}
+
+	// test that the compilation of a class using same package defined in the java.util module
+	// works if a special option is given
+	public void test_no_conflicting_packages_for_debugger_global() throws CoreException {
+		Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
+		try {
+			Hashtable<String, String> newOptions=new Hashtable<>(javaCoreOptions);
+			newOptions.put(CompilerOptions.OPTION_JdtDebugCompileMode, JavaCore.ENABLED);
+			JavaCore.setOptions(newOptions);
+			String[] sources = new String[] {
+					"src/java/util/Map___.java",
+					"package java.util;\n" +
+					"abstract class Map___ implements java.util.Map {\n" +
+					"  Map___() {\n" +
+					"    super();\n" +
+					"  }\n" +
+					"  Object[] ___run() throws Throwable {\n" +
+					"    return entrySet().toArray();\n" +
+					"  }\n" +
+					"}"
+			};
+			IClasspathEntry dep = JavaCore.newContainerEntry(new Path(JavaCore.MODULE_PATH_CONTAINER_ID));
+			IJavaProject p1= setupModuleProject("debugger_project", sources, new IClasspathEntry[]{dep});
+			p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+			assertNoErrors();
+
+			assertNull("Option should not be stored", JavaCore.getOption(CompilerOptions.OPTION_JdtDebugCompileMode));
+		} finally {
+			deleteProject("debugger_project");
+			JavaCore.setOptions(javaCoreOptions);
+		}
+	}
+
+	// test that the special OPTION_JdtDebugCompileMode cannot be persisted on a project
+	public void test_no_conflicting_packages_for_debugger_project() throws CoreException {
+		try {
+			String[] sources = new String[] {
+					"src/java/util/Map___.java",
+					"package java.util;\n" +
+					"abstract class Map___ implements java.util.Map {\n" +
+					"  Map___() {\n" +
+					"    super();\n" +
+					"  }\n" +
+					"  Object[] ___run() throws Throwable {\n" +
+					"    return entrySet().toArray();\n" +
+					"  }\n" +
+					"}"
+			};
+			IClasspathEntry dep = JavaCore.newContainerEntry(new Path(JavaCore.MODULE_PATH_CONTAINER_ID));
+			IJavaProject p1= setupModuleProject("debugger_project", sources, new IClasspathEntry[]{dep});
+			p1.setOption(CompilerOptions.OPTION_JdtDebugCompileMode, JavaCore.ENABLED);
+			assertNull("Option should not be stored", p1.getOption(CompilerOptions.OPTION_JdtDebugCompileMode, false));
+			p1.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+			IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+			sortMarkers(markers);
+			assertMarkers("Unexpected markers", 
+					"The package java.util conflicts with a package accessible from another module: java.base\n" +
+					"The package java.util is accessible from more than one module: <unnamed>, java.base\n" +
+					"The method entrySet() is undefined for the type Map___",
+					markers);
+		} finally {
+			deleteProject("debugger_project");
+		}
+	}
+
 	// test that a package declared in a module conflicts with an accessible package
 	// of the same name declared in another required module
 	public void test_conflicting_packages_declaredvsaccessible() throws CoreException {
@@ -8490,6 +8556,154 @@
 				Util.flushDirectoryContent(outputDir);
 		}
 	}
+	public void testBug547114a() throws CoreException, IOException {
+		String outputDirectory = Util.getOutputDirectory();
+		String jarPath = outputDirectory + File.separator + "lib.jar";
+		try {
+			// focus project has no module-info, to trigger path where LE#knownPackages is not empty when processing add-reads
+			String[] sources = new String[] {
+					"src/org/astro/World.java",
+					"package org.astro;\n" +
+					"import p.C;\n" +
+					"public class World {\n" +
+					"	C f;\n" +
+					"}\n"
+			};
+			IJavaProject p = setupModuleProject("org.astro", sources);
+
+			Util.createJar(new String[] {
+					"/lib/src/module-info.java",
+					"module lib {\n" +
+					"	exports p;\n" +
+					"}\n",
+					"/lib/src/p/C.java",
+					"package p;\n" +
+					"public class C {}\n",
+				},
+				jarPath,
+				"9");
+			addClasspathEntry(p, JavaCore.newLibraryEntry(new Path(jarPath), null, null, null,
+					new IClasspathAttribute[] {
+						JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+						JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_READS, "lib=missing.module") // problematic directive on jar-dependency
+					},
+					false));
+
+			p.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
+			waitForAutoBuild();
+			
+			IMarker[] markers = p.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+			// 1. marker is on the project, second on the "current" CU: World.java.
+			assertMarkers("Unexpected markers",
+					"The project was not built since its build path has a problem: missing.module cannot be resolved to a module, it is referenced from an add-reads directive. Fix the build path then try building this project\n" + 
+					"missing.module cannot be resolved to a module, it is referenced from an add-reads directive",
+					markers);
+		} finally {
+			deleteProject("org.astro");
+			deleteFile(jarPath);
+		}
+	}
+	public void testBug547114b() throws CoreException, IOException {
+		try {
+			IJavaProject p = setupModuleProject("org.astro", new String[] {
+					"src/module-info.java",
+					"module org.astro {\n" +
+					"	requires lib;\n" +
+					"}\n",
+					"src/org/astro/World.java",
+					"package org.astro;\n" +
+					"import p.C;\n" +
+					"public class World {\n" +
+					"	C f;\n" +
+					"}\n"
+			});
+			
+			IJavaProject lib = setupModuleProject("lib", new String[] {
+					"src/module-info.java",
+					"module lib {\n" +
+					"	exports p;\n" +
+					"}\n",
+					"src/p/C.java",
+					"package p;\n" +
+					"public class C {}\n",
+			});
+			addClasspathEntry(p, JavaCore.newProjectEntry(lib.getPath(), null, false,
+					new IClasspathAttribute[] {
+						JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+						JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_READS, "lib=missing.module") // problematic directive on project dependency
+					},
+					false));
+
+			ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+			waitForAutoBuild();
+
+			IMarker[] markers = p.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+			// 1. marker is on the project, second on the "current" CU: World.java.
+			assertMarkers("Unexpected markers",
+					"The project was not built since its build path has a problem: missing.module cannot be resolved to a module, it is referenced from an add-reads directive. Fix the build path then try building this project\n" + 
+					"missing.module cannot be resolved to a module, it is referenced from an add-reads directive",
+					markers);
+		} finally {
+			deleteProject("org.astro");
+			deleteProject("lib");
+		}
+	}
+	public void testBug547479() throws CoreException {
+		int max = org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE;
+
+		IJavaProject prjA = createJava9Project("A");
+		IJavaProject prjB = createJava9Project("B");
+		try {
+			createFile("A/src/module-info.java",
+				"module A {\n" + 
+				"}\n");
+
+			addModularProjectEntry(prjB, prjA);
+			// prepare files to be compiled in two batches à 2 files:
+			org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE = 2;
+			// ---1---
+			createFolder("B/src/b");
+			createFile("B/src/b/Class1.java",
+				"package b;\n" + 
+				"import java.sql.Connection;\n" + 
+				"public class Class1 {\n" + 
+				"	Connection connection;\n" + 
+				"}\n");
+			createFile("B/src/b/Class2.java",
+				"package b;\n" + 
+				"import java.sql.Connection;\n" + 
+				"public class Class2 {\n" + 
+				"	Connection connection;\n" + 
+				"}\n");
+			// ---2---
+			createFile("B/src/module-info.java",
+				"module B {\n" + 
+				"	requires java.sql;\n" + 
+				"	requires A;\n" + 
+				"}\n");
+			String bPath = "B/src/b/Class3.java";
+			String bSource =
+				"package b;\n" + // <= this triggered createPackage in an inconsistent state
+				"import java.sql.Connection;\n" + 
+				"public class Class3 {\n" + 
+				"	Connection connection;\n" + 
+				"}\n";
+			createFile(bPath, bSource);
+			getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+			assertNoErrors();
+
+			this.problemRequestor.initialize(bSource.toCharArray());
+			getCompilationUnit(bPath).getWorkingCopy(this.wcOwner, null);
+			assertProblems("unexpected problems",
+					"----------\n" + 
+					"----------\n",
+					this.problemRequestor);
+		} finally {
+			org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE = max;
+			deleteProject(prjA);
+			deleteProject(prjB);
+		}
+	}
 	protected void assertNoErrors() throws CoreException {
 		for (IProject p : getWorkspace().getRoot().getProjects()) {
 			int maxSeverity = p.findMaxProblemSeverity(null, true, IResource.DEPTH_INFINITE);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
index ea489c1..2a2db52 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
@@ -805,4 +805,50 @@
 			Util.flushDirectoryContent(outputDir);
 	}
 }
+public void testBug544306() throws Exception {
+	if (!isJRE9)
+		return;
+	IJavaProject p1 = createJava9Project("p1");
+	IJavaProject p2 = createJava9Project("p2");
+	try {
+		createFolder("p1/src/p1");
+		createFile("p1/src/p1/P1.java",
+				"package p1;\n" + 
+				"public class P1 {\n" + 
+				"}\n");
+		createFile("p1/src/module-info.java",
+				"module p1 {\n" + 
+				"	exports p1;\n" + 
+				"}\n");
+
+		IClasspathAttribute[] testAttrs = { JavaCore.newClasspathAttribute("test", "true") };
+		addClasspathEntry(p2, JavaCore.newProjectEntry(p1.getPath(), null, false, testAttrs, false));
+		addClasspathEntry(p2, JavaCore.newSourceEntry(new Path("/p2/src-test"), null, null, new Path("/p2/bin-test"), testAttrs));
+		createFolder("p2/src/p2");
+		createFolder("p2/src-test/p2");
+
+		createFile("p2/src/module-info.java",
+				"module p2 {\n" + 
+				"}\n");
+		String testSource = "package p2;\n" +
+		"import p1.P1;\n" +
+		"class Test extends P1{ }";
+		
+		createFile("p2/src-test/p2/Test.java", testSource);
+		waitForAutoBuild();
+		IMarker[] markers = p1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+		assertMarkers("Unexpected markers",
+				"",  markers);
+		
+		this.workingCopy.discardWorkingCopy();
+		this.workingCopy = getCompilationUnit("p2/src-test/p2/Test.java").getWorkingCopy(this.wcOwner, null);
+		this.problemRequestor.initialize(testSource.toCharArray());
+		this.workingCopy.reconcile(AST_INTERNAL_JLS11, true, this.wcOwner, null);
+		assertProblems("Expecting no problems", "----------\n" + "----------\n", this.problemRequestor);
+		this.workingCopy.discardWorkingCopy();
+	} finally {
+		deleteProject(p1);
+		deleteProject(p2);
+	}
+}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java
index e11b4ba..2c36c3a 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SubstringCompletionTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2015, 2016 Gábor Kövesdán and others.
+ * Copyright (c) 2015, 2019 Gábor Kövesdán and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -942,11 +942,11 @@
 			"lastIndexOf[METHOD_REF]{lastIndexOf(), Ljava.lang.String;, (Ljava.lang.String;)I, lastIndexOf, (arg0), "+ (relevance + R_SUBSTRING) +"}\n" +
 			"lastIndexOf[METHOD_REF]{lastIndexOf(), Ljava.lang.String;, (Ljava.lang.String;I)I, lastIndexOf, (arg0, arg1), "+ (relevance + R_SUBSTRING) +"}\n" +
 			"replaceFirst[METHOD_REF]{replaceFirst(), Ljava.lang.String;, (Ljava.lang.String;Ljava.lang.String;)Ljava.lang.String;, replaceFirst, (arg0, arg1), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
-			"startsWith[METHOD_REF]{startsWith(), Ljava.lang.String;, (Ljava.lang.String;)Z, startsWith, (arg0), "+ (relevance + R_CASE) +"}\n" +
-			"startsWith[METHOD_REF]{startsWith(), Ljava.lang.String;, (Ljava.lang.String;I)Z, startsWith, (arg0, arg1), "+ (relevance + R_CASE) +"}\n" +
 			"substring[METHOD_REF]{substring(), Ljava.lang.String;, (I)Ljava.lang.String;, substring, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
 			"substring[METHOD_REF]{substring(), Ljava.lang.String;, (II)Ljava.lang.String;, substring, (arg0, arg1), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
-			"toString[METHOD_REF]{toString(), Ljava.lang.String;, ()Ljava.lang.String;, toString, null, "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}",
+			"toString[METHOD_REF]{toString(), Ljava.lang.String;, ()Ljava.lang.String;, toString, null, "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE)  +"}\n" +
+			"startsWith[METHOD_REF]{startsWith(), Ljava.lang.String;, (Ljava.lang.String;)Z, startsWith, (arg0), "+ (relevance + R_CASE) +"}\n" +
+			"startsWith[METHOD_REF]{startsWith(), Ljava.lang.String;, (Ljava.lang.String;I)Z, startsWith, (arg0, arg1), "+ (relevance + R_CASE) +"}",
 			requestor.getResults());
 }
 public void testBug488441_4() throws JavaModelException {
@@ -999,7 +999,6 @@
 	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
 	int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_NON_INHERITED;
 	assertResults(
-			"asList[METHOD_REF]{asList(), Ljava.util.Arrays;, <T:Ljava.lang.Object;>([TT;)Ljava.util.List<TT;>;, asList, (arg0), "+ (relevance + R_CASE) +"}\n" +
 			"deepHashCode[METHOD_REF]{deepHashCode(), Ljava.util.Arrays;, ([Ljava.lang.Object;)I, deepHashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
 			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([B)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
 			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([C)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
@@ -1009,7 +1008,8 @@
 			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([J)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
 			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([Ljava.lang.Object;)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
 			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([S)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
-			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([Z)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}",
+			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([Z)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE)+"}\n" +
+			"asList[METHOD_REF]{asList(), Ljava.util.Arrays;, <T:Ljava.lang.Object;>([TT;)Ljava.util.List<TT;>;, asList, (arg0), "+ (relevance + R_CASE)  +"}",
 			requestor.getResults());
 }
 public void testBug488441_6() throws JavaModelException {
@@ -1099,7 +1099,6 @@
 
 	int relevance = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_NON_INHERITED;
 	assertResults(
-			"asList[METHOD_REF]{asList(), Ljava.util.Arrays;, <T:Ljava.lang.Object;>([TT;)Ljava.util.List<TT;>;, asList, (arg0), "+ (relevance + R_CASE) +"}\n" +
 			"deepHashCode[METHOD_REF]{deepHashCode(), Ljava.util.Arrays;, ([Ljava.lang.Object;)I, deepHashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
 			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([B)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
 			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([C)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
@@ -1109,7 +1108,8 @@
 			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([J)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
 			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([Ljava.lang.Object;)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
 			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([S)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}\n" +
-			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([Z)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE) +"}",
+			"hashCode[METHOD_REF]{hashCode(), Ljava.util.Arrays;, ([Z)I, hashCode, (arg0), "+ (relevance + R_SUBSTRING + R_EXACT_EXPECTED_TYPE)+"}\n" +
+			"asList[METHOD_REF]{asList(), Ljava.util.Arrays;, <T:Ljava.lang.Object;>([TT;)Ljava.util.List<TT;>;, asList, (arg0), "+ (relevance + R_CASE)  +"}",
 			requestor.getResults());
 }
 }
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java
index 8f09be8..c968294 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.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
@@ -47,7 +47,7 @@
 	int R_NAME_FIRST_SUFFIX = 4;
 	int R_NAME_SUFFIX = 3;
 	int R_NAME_LESS_NEW_CHARACTERS = 15;
-	int R_SUBSTRING = -20;
+	int R_SUBSTRING = -21;
 	int R_METHOD_OVERIDE = 3;
 	int R_NON_RESTRICTED = 3;
 	int R_TRUE_OR_FALSE = 1;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
index 037091c..118dc77 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
@@ -1881,6 +1881,10 @@
 	/** @since 3.10 */
 	int IllegalTypeArgumentsInRawConstructorReference = TypeRelated + 1003;
 
+	// more on lambdas:
+	/** @since 3.18 */
+	int MissingValueFromLambda = Internal + 1004;
+
 	// default methods:
 	/** @since 3.10 */
 	int IllegalModifierForInterfaceMethod18 = MethodRelated + 1050;
@@ -1956,6 +1960,8 @@
 	int InvalidServiceImplType = ModuleRelated + 1317;
 	/** @since 3.14 */
 	int IllegalModifierForModule = ModuleRelated + 1318;
+	/** @since 3.18 */
+	int UndefinedModuleAddReads = ModuleRelated + 1319;
 
 	/** @since 3.14 */
 	int DuplicateResource = Internal + 1251;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
index e82b497..3281562 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
@@ -50,6 +50,7 @@
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.ast;
 
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -729,11 +730,13 @@
 	 * @param method the method produced by lookup (possibly involving type inference).
 	 * @param argumentTypes the argument types as collected from first resolving the invocation arguments and as used for the method lookup.
 	 * @param scope scope for resolution.
+	 * @return either the original method or a problem method
 	 */
-	public static void resolvePolyExpressionArguments(Invocation invocation, MethodBinding method, TypeBinding[] argumentTypes, BlockScope scope) {
+	public static MethodBinding resolvePolyExpressionArguments(Invocation invocation, MethodBinding method, TypeBinding[] argumentTypes, BlockScope scope) {
 		MethodBinding candidateMethod = method.isValidBinding() ? method : method instanceof ProblemMethodBinding ? ((ProblemMethodBinding) method).closestMatch : null;
 		if (candidateMethod == null)
-			return;
+			return method;
+		ProblemMethodBinding problemMethod = null;
 		boolean variableArity = candidateMethod.isVarargs();
 		final TypeBinding[] parameters = candidateMethod.parameters;
 		Expression[] arguments = invocation.arguments();
@@ -756,8 +759,20 @@
 					boolean skipKosherCheck = method.problemId() == ProblemReasons.Ambiguous;
 					updatedArgumentType = lambda.resolveType(scope, skipKosherCheck);
 					// additional checks, because LE.resolveType may return a valid binding even in the presence of structural errors
-					if (!lambda.isCompatibleWith(parameterType, scope) || lambda.hasErrors())
+					if (lambda.hasErrors() || lambda.hasDescripterProblem) {
 						continue;
+					}
+					if (!lambda.isCompatibleWith(parameterType, scope)) {
+						if (method.isValidBinding() && problemMethod == null) {
+							TypeBinding[] originalArguments = Arrays.copyOf(argumentTypes, argumentTypes.length);
+							if (lambda.reportShapeError(parameterType, scope)) {
+								problemMethod = new ProblemMethodBinding(candidateMethod, method.selector, originalArguments, ProblemReasons.ErrorAlreadyReported);
+							} else {
+								problemMethod = new ProblemMethodBinding(candidateMethod, method.selector, originalArguments, ProblemReasons.NotFound);
+							}
+						}
+						continue;
+					}
 					// avoid that preliminary local type bindings escape beyond this point:
 					lambda.updateLocalTypesInMethod(candidateMethod);
 				} else {
@@ -775,6 +790,9 @@
 			if (ic18 != null)
 				ic18.flushBoundOutbox(); // overload resolution is done, now perform the push of bounds from inner to outer
 		}
+		if (problemMethod != null)
+			return problemMethod;
+		return method;
 	}
 
 	public static void resolveAnnotations(BlockScope scope, Annotation[] sourceAnnotations, Binding recipient) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
index 6a49c0e..dcf3a2a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
@@ -578,7 +578,7 @@
 				return this.resolvedType = null;
 			}
 		}
-		resolvePolyExpressionArguments(this, this.binding, this.argumentTypes, scope);
+		this.binding = resolvePolyExpressionArguments(this, this.binding, this.argumentTypes, scope);
 	} else {
 //{ObjectTeams: may need to instantiate parameters of constructor
     	AnchorMapping anchorMapping = AnchorMapping.setupNewMapping(null, this.arguments, scope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
index 625cb97..ec81052 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2017 IBM Corporation and others.
+ * Copyright (c) 2013, 2019 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -67,6 +67,7 @@
 	public boolean shouldCaptureInstance = false; // Whether the expression needs access to instance data of enclosing type
 	protected static IErrorHandlingPolicy silentErrorHandlingPolicy = DefaultErrorHandlingPolicies.ignoreAllProblems();
 	private boolean hasReportedSamProblem = false;
+	public boolean hasDescripterProblem;
 	public boolean isSerializable;
 	public int ordinal;
 
@@ -303,6 +304,7 @@
 			status = false;
 		if (!inspector.visible(this.expectedType))
 			status = false;
+		this.hasDescripterProblem |= !status;
 		return status;
 	}
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java
index ddfe5b3..05ae291 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java
@@ -20,6 +20,7 @@
 
 import org.eclipse.jdt.internal.compiler.ASTVisitor;
 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
 import org.eclipse.jdt.internal.compiler.lookup.*;
 
 /**
@@ -91,7 +92,11 @@
 					declaringMods.add(incarnation.enclosingModule);
 			}
 			if (!declaringMods.isEmpty()) {
-				scope.problemReporter().conflictingPackagesFromOtherModules(this, declaringMods);
+				CompilerOptions compilerOptions = scope.compilerOptions();
+				boolean inJdtDebugCompileMode = compilerOptions.enableJdtDebugCompileMode;
+				if (!inJdtDebugCompileMode) {
+					scope.problemReporter().conflictingPackagesFromOtherModules(this, declaringMods);
+				}
 			}
 		}
 	}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
index 4a3db18..ad3013d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
@@ -874,44 +874,61 @@
 		}
 		return true;
 	}
-	
+
+	private enum CompatibilityResult { COMPATIBLE, INCOMPATIBLE, REPORTED }
+
+	public boolean reportShapeError(TypeBinding targetType, Scope skope) {
+		return internalIsCompatibleWith(targetType, skope, true) == CompatibilityResult.REPORTED;
+	}
+
 	@Override
 	public boolean isCompatibleWith(TypeBinding targetType, final Scope skope) {
+		return internalIsCompatibleWith(targetType, skope, false) == CompatibilityResult.COMPATIBLE;
+	}
+	CompatibilityResult internalIsCompatibleWith(TypeBinding targetType, Scope skope, boolean reportShapeProblem) {
 		
 		if (!super.isPertinentToApplicability(targetType, null))
-			return true;
+			return CompatibilityResult.COMPATIBLE;
 		
 		LambdaExpression copy = null;
 		try {
 			copy = cachedResolvedCopy(targetType, argumentsTypeElided(), false, null); // if argument types are elided, we don't care for result expressions against *this* target, any valid target is OK.
 		} catch (CopyFailureException cfe) {
 			if (this.assistNode)
-				return true; // can't type check result expressions, just say yes.
-			return !isPertinentToApplicability(targetType, null); // don't expect to hit this ever.
+				return CompatibilityResult.COMPATIBLE; // can't type check result expressions, just say yes.
+			return isPertinentToApplicability(targetType, null) ? CompatibilityResult.INCOMPATIBLE : CompatibilityResult.COMPATIBLE; // don't expect to hit this ever.
 		}
 		if (copy == null)
-			return false;
+			return CompatibilityResult.INCOMPATIBLE;
 		
 		// copy here is potentially compatible with the target type and has its shape fully computed: i.e value/void compatibility is determined and result expressions have been gathered.
 		targetType = findGroundTargetType(this.enclosingScope, targetType, targetType, argumentsTypeElided());
 		MethodBinding sam = targetType.getSingleAbstractMethod(this.enclosingScope, true);
 		if (sam == null || sam.problemId() == ProblemReasons.NoSuchSingleAbstractMethod) {
-			return false;
+			return CompatibilityResult.INCOMPATIBLE;
 		}
 		if (sam.returnType.id == TypeIds.T_void) {
-			if (!copy.voidCompatible)
-				return false;
+			if (!copy.voidCompatible) {
+				return CompatibilityResult.INCOMPATIBLE;
+			}
 		} else {
-			if (!copy.valueCompatible)
-				return false;
+			if (!copy.valueCompatible) {
+				if (reportShapeProblem) {
+					skope.problemReporter().missingValueFromLambda(this, sam.returnType);
+					return CompatibilityResult.REPORTED;
+				}
+				return CompatibilityResult.INCOMPATIBLE;
+			}
 		}
+		if (reportShapeProblem)
+			return CompatibilityResult.COMPATIBLE; // enough seen
 
 		if (!isPertinentToApplicability(targetType, null))
-			return true;
+			return CompatibilityResult.COMPATIBLE;
 
 		// catch up on one check deferred via skipKosherCheck=true (only if pertinent for applicability)
 		if (!kosherDescriptor(this.enclosingScope, sam, false))
-			return false;
+			return CompatibilityResult.INCOMPATIBLE;
 
 		Expression [] returnExpressions = copy.resultExpressions;
 		for (int i = 0, length = returnExpressions.length; i < length; i++) {
@@ -919,10 +936,10 @@
 					&& this.enclosingScope.parameterCompatibilityLevel(returnExpressions[i].resolvedType, sam.returnType) == Scope.NOT_COMPATIBLE) {
 				if (!returnExpressions[i].isConstantValueOfTypeAssignableToType(returnExpressions[i].resolvedType, sam.returnType))
 					if (sam.returnType.id != TypeIds.T_void || this.body instanceof Block)
-						return false;
+						return CompatibilityResult.INCOMPATIBLE;
 			}
 		}
-		return true;
+		return CompatibilityResult.COMPATIBLE;
 	}
 	
 	class CopyFailureException extends RuntimeException {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
index d266ab8..06d7389 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
@@ -75,7 +75,6 @@
 import java.util.HashMap;
 
 import org.eclipse.jdt.core.compiler.CharOperation;
-import org.eclipse.jdt.core.compiler.IProblem;
 import org.eclipse.jdt.internal.compiler.ASTVisitor;
 import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.WrapperKind;
 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
@@ -900,8 +899,7 @@
 	  }
   // orig:
 		if (this.actualReceiverType instanceof InferenceVariable) {
-			scope.referenceContext().tagAsHavingIgnoredMandatoryErrors(IProblem.UndefinedMethod);
-			return null; // not yet ready for resolving
+				return null; // not yet ready for resolving
 		}
   /*
 		this.receiverIsType = this.receiver instanceof NameReference && (((NameReference) this.receiver).bits & Binding.TYPE) != 0;
@@ -1410,7 +1408,7 @@
 		    return new PolyTypeBinding(this);
 	    }
 	}
-	resolvePolyExpressionArguments(this, this.binding, this.argumentTypes, scope);
+	this.binding = resolvePolyExpressionArguments(this, this.binding, this.argumentTypes, scope);
 	return this.binding.returnType;
 }
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java
index b757305..6cb430b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java
@@ -29,6 +29,7 @@
 import org.eclipse.jdt.internal.compiler.ClassFile;
 import org.eclipse.jdt.internal.compiler.CompilationResult;
 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
 import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
 import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
 import org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;
@@ -332,8 +333,13 @@
 	{
 		for (PackageBinding pack : requiredModule.getExports()) {
 			Set<ModuleBinding> mods = pack2mods.get(String.valueOf(pack.readableName()));
-			if (mods != null && mods.size() > 1)
-				skope.problemReporter().conflictingPackagesFromModules(pack, mods, requiresStat.sourceStart, requiresStat.sourceEnd);
+			if (mods != null && mods.size() > 1) {
+				CompilerOptions compilerOptions = skope.compilerOptions();
+				boolean inJdtDebugCompileMode = compilerOptions.enableJdtDebugCompileMode;
+				if (!inJdtDebugCompileMode) {
+					skope.problemReporter().conflictingPackagesFromModules(pack, mods, requiresStat.sourceStart, requiresStat.sourceEnd);
+				}
+			}
 		}
 	}
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
index 18bd58b..8a4270f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
@@ -752,7 +752,7 @@
 					}
 				}
 			}
-			resolvePolyExpressionArguments(this, this.binding, this.argumentTypes, scope);
+			this.binding = resolvePolyExpressionArguments(this, this.binding, this.argumentTypes, scope);
 		} else {
 //{ObjectTeams: setup context for constructor lookup:
 			if (receiverType instanceof ReferenceBinding) // funny thing: receiver could be array..
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
index dceebcf..d3d2ae8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
@@ -19,6 +19,7 @@
 
 import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.internal.compiler.ASTVisitor;
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
 import org.eclipse.jdt.internal.compiler.lookup.*;
 import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
 import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
@@ -199,10 +200,14 @@
 	    if (packageBinding != null) {
 	    	PackageBinding uniquePackage = packageBinding.getVisibleFor(scope.module(), false);
 	    	if (uniquePackage instanceof SplitPackageBinding) {
-	    		SplitPackageBinding splitPackage = (SplitPackageBinding) uniquePackage;
-    			scope.problemReporter().conflictingPackagesFromModules(splitPackage, scope.module(), this.sourceStart, (int)this.sourcePositions[typeStart-1]);
-    			this.resolvedType = new ProblemReferenceBinding(this.tokens, null, ProblemReasons.Ambiguous);
-    			return null;
+	    		CompilerOptions compilerOptions = scope.compilerOptions();
+	    		boolean inJdtDebugCompileMode = compilerOptions.enableJdtDebugCompileMode;
+	    		if (!inJdtDebugCompileMode) {
+	    			SplitPackageBinding splitPackage = (SplitPackageBinding) uniquePackage;
+	    			scope.problemReporter().conflictingPackagesFromModules(splitPackage, scope.module(), this.sourceStart, (int)this.sourcePositions[typeStart-1]);
+	    			this.resolvedType = new ProblemReferenceBinding(this.tokens, null, ProblemReasons.Ambiguous);
+	    			return null;
+	    		}
 	    	}
 	    }
 	    rejectAnnotationsOnPackageQualifiers(scope, packageBinding);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
index cb8df7f..a0cf2cf 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
@@ -545,7 +545,6 @@
  */
 protected MethodBinding findConstructorBinding(BlockScope scope, Invocation site, ReferenceBinding receiverType, TypeBinding[] argumentTypes) {
 	MethodBinding ctorBinding = scope.getConstructor(receiverType, argumentTypes, site);
-	resolvePolyExpressionArguments(site, ctorBinding, argumentTypes, scope);
-	return ctorBinding;
+	return resolvePolyExpressionArguments(site, ctorBinding, argumentTypes, scope);
 }
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
index b3203a4..f32a048 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
@@ -691,8 +691,10 @@
 					this.constMapping = new int[this.nConstants];
 				}
 				int counter = 0;
+				int caseCounter = 0;
 				for (int i = 0; i < length; i++) {
 					Constant[] constantsList;
+					int[] caseIndex = new int[this.nConstants];
 					final Statement statement = this.statements[i];
 					if (!(statement instanceof CaseStatement))  {
 						statement.resolve(this.scope);
@@ -707,26 +709,26 @@
 								//----check for duplicate case statement------------
 								for (int j = 0; j < counter; j++) {
 									if (this.constants[j] == key) {
-										reportDuplicateCase((CaseStatement) statement, this.cases[j], length);
+										reportDuplicateCase((CaseStatement) statement, this.cases[caseIndex[j]], length);
 									}
 								}
 								this.constants[counter] = key;
-								this.constMapping[counter] = counter;
-								counter++;
 							} else {
 								String key = con.stringValue();
 								//----check for duplicate case statement------------
 								for (int j = 0; j < counter; j++) {
 									if (this.stringConstants[j].equals(key)) {
-										reportDuplicateCase((CaseStatement) statement, this.cases[j], length);
+										reportDuplicateCase((CaseStatement) statement, this.cases[caseIndex[j]], length);
 									}
 								}
 								this.stringConstants[counter] = key;
-								this.constMapping[counter] = counter;
-								counter++;
 							}
+							this.constMapping[counter] = counter;
+							caseIndex[counter] = caseCounter;
+							counter++;
 						}
 					}
+					caseCounter++;
 				}
 				if (length != counter) { // resize constants array
 					if (!isStringSwitch) {
@@ -810,10 +812,12 @@
 	private void reportDuplicateCase(final CaseStatement duplicate, final CaseStatement original, int length) {
 		if (this.duplicateCaseStatements == null) {
 			this.scope.problemReporter().duplicateCase(original);
-			this.scope.problemReporter().duplicateCase(duplicate);
+			if (duplicate != original) 
+				this.scope.problemReporter().duplicateCase(duplicate);
 			this.duplicateCaseStatements = new CaseStatement[length];
 			this.duplicateCaseStatements[this.duplicateCaseStatementsCounter++] = original;
-			this.duplicateCaseStatements[this.duplicateCaseStatementsCounter++] = duplicate;
+			if (duplicate != original) 
+				this.duplicateCaseStatements[this.duplicateCaseStatementsCounter++] = duplicate;
 		} else {
 			boolean found = false;
 			searchReportedDuplicate: for (int k = 2; k < this.duplicateCaseStatementsCounter; k++) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
index 6ad811c..45c33bb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.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
@@ -20,8 +20,9 @@
  *								Bug 424727 - [compiler][null] NullPointerException in nullAnnotationUnsupportedLocation(ProblemReporter.java:5708)
  *								Bug 457210 - [1.8][compiler][null] Wrong Nullness errors given on full build build but not on incremental build?
  *     Keigo Imai - Contribution for  bug 388903 - Cannot extend inner class as an anonymous class when it extends the outer class
-  *    Pierre-Yves B. <pyvesdev@gmail.com> - Contribution for
+  *    Pierre-Yves B. <pyvesdev@gmail.com> - Contributions for
  *                              Bug 542520 - [JUnit 5] Warning The method xxx from the type X is never used locally is shown when using MethodSource
+ *                              Bug 546084 - Using Junit 5s MethodSource leads to ClassCastException
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.ast;
 
@@ -1423,25 +1424,42 @@
 private SimpleSetOfCharArray getJUnitMethodSourceValues() {
 	SimpleSetOfCharArray junitMethodSourceValues = new SimpleSetOfCharArray();
 	for (AbstractMethodDeclaration methodDeclaration : this.methods) {
-		junitMethodSourceValues.add(getJUnitMethodSourceValue(methodDeclaration));
+		if (methodDeclaration.annotations != null) {
+			for (Annotation annotation : methodDeclaration.annotations) {
+				if (annotation.resolvedType != null && annotation.resolvedType.id == TypeIds.T_OrgJunitJupiterParamsProviderMethodSource) {
+					addJUnitMethodSourceValues(junitMethodSourceValues, annotation, methodDeclaration.selector);
+				}
+			}
+		}
 	}
 	return junitMethodSourceValues;
 }
 
-private char[] getJUnitMethodSourceValue(AbstractMethodDeclaration methodDeclaration) {
-	if (methodDeclaration.annotations != null) {
-		for (Annotation annotation : methodDeclaration.annotations) {
-			if (annotation.resolvedType != null && annotation.resolvedType.id == TypeIds.T_OrgJunitJupiterParamsProviderMethodSource) {
-				for (MemberValuePair memberValuePair : annotation.memberValuePairs()) {
-					if (CharOperation.equals(memberValuePair.name, TypeConstants.VALUE)) {
-						return ((StringLiteral) memberValuePair.value).source;
-					}
+private void addJUnitMethodSourceValues(SimpleSetOfCharArray junitMethodSourceValues, Annotation annotation, char[] methodName) {
+	for (MemberValuePair memberValuePair : annotation.memberValuePairs()) {
+		if (CharOperation.equals(memberValuePair.name, TypeConstants.VALUE)) {
+			Expression value = memberValuePair.value;
+			if (value instanceof ArrayInitializer) { // e.g. @MethodSource({ "someMethod" })
+				ArrayInitializer arrayInitializer = (ArrayInitializer) value;
+				for (Expression arrayValue : arrayInitializer.expressions) {
+					junitMethodSourceValues.add(getValueAsChars(arrayValue));
 				}
-				// value member not specified (i.e. marker annotation): JUnit 5 defaults to the test method's name
-				return methodDeclaration.selector;
+			} else {
+				junitMethodSourceValues.add(getValueAsChars(value));
 			}
+			return;
 		}
 	}
+	// value member not specified (i.e. marker annotation): JUnit 5 defaults to the test method's name
+	junitMethodSourceValues.add(methodName);
+}
+
+private char[] getValueAsChars(Expression value) {
+	if (value instanceof StringLiteral) { // e.g. "someMethod"
+		return ((StringLiteral) value).source;
+	} else if (value.constant instanceof StringConstant) { // e.g. SOME_CONSTANT + "value"
+		return ((StringConstant) value.constant).stringValue().toCharArray();
+	}
 	return CharOperation.NO_CHAR;
 }
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java
index f49b793..8d0fffe 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java
@@ -159,31 +159,13 @@
 @Override
 public void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {
 	// Required to fix 1PR0XVS: LFRE:WINNT - Compiler: variable table for method appears incorrect
-	loop: for (int i = 0; i < this.visibleLocalsCount; i++) {
+	for (int i = 0; i < this.visibleLocalsCount; i++) {
 		LocalVariableBinding localBinding = this.visibleLocals[i];
 		if (localBinding != null) {
 			// Check if the local is definitely assigned
 			boolean isDefinitelyAssigned = isDefinitelyAssigned(scope, initStateIndex, localBinding);
 			if (!isDefinitelyAssigned) {
-				if (this.stateIndexes != null) {
-					for (int j = 0, max = this.stateIndexesCounter; j < max; j++) {
-						if (isDefinitelyAssigned(scope, this.stateIndexes[j], localBinding)) {
-							if ((localBinding.initializationCount == 0) || (localBinding.initializationPCs[((localBinding.initializationCount - 1) << 1) + 1] != -1)) {
-								/* There are two cases:
-								 * 1) there is no initialization interval opened ==> add an opened interval
-								 * 2) there is already some initialization intervals but the last one is closed ==> add an opened interval
-								 * An opened interval means that the value at localBinding.initializationPCs[localBinding.initializationCount - 1][1]
-								 * is equals to -1.
-								 * initializationPCs is a collection of pairs of int:
-								 * 	first value is the startPC and second value is the endPC. -1 one for the last value means that the interval
-								 * 	is not closed yet.
-								 */
-								localBinding.recordInitializationStartPC(this.position);
-							}
-							continue loop;
-						}
-					}
-				}
+				continue;
 			} else {
 				if ((localBinding.initializationCount == 0) || (localBinding.initializationPCs[((localBinding.initializationCount - 1) << 1) + 1] != -1)) {
 					/* There are two cases:
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
index b46f57a..1ae7cf9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
@@ -294,6 +294,9 @@
 	public static final String OPTION_EnablePreviews = "org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures"; //$NON-NLS-1$
 	public static final String OPTION_ReportPreviewFeatures = "org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures"; //$NON-NLS-1$
 
+	// Internally used option to allow debug framework compile evaluation snippets in context of modules, see bug 543604
+	public static final String OPTION_JdtDebugCompileMode = "org.eclipse.jdt.internal.debug.compile.mode"; //$NON-NLS-1$
+
 	/**
 	 * Possible values for configurable options
 	 */
@@ -655,6 +658,9 @@
 	/** Master flag to enabled/disable all preview features */
 	public boolean enablePreviewFeatures;
 
+	/** Enable a less restrictive compile mode for JDT debug. */
+	public boolean enableJdtDebugCompileMode;
+
 	// keep in sync with warningTokenToIrritant and warningTokenFromIrritant
 	public final static String[] warningTokens = {
 		"all", //$NON-NLS-1$
@@ -1919,6 +1925,8 @@
 
 		this.complainOnUninternedIdentityComparison = false;
 		this.enablePreviewFeatures = false;
+
+		this.enableJdtDebugCompileMode = false;
 	}
 
 	public void set(Map<String, String> optionsMap) {
@@ -2496,6 +2504,14 @@
 		}
 		if ((optionValue = optionsMap.get(OPTION_ReportPreviewFeatures)) != null) 
 			updateSeverity(PreviewFeatureUsed, optionValue);
+
+		if ((optionValue = optionsMap.get(OPTION_JdtDebugCompileMode)) != null) {
+			if (ENABLED.equals(optionValue)) {
+				this.enableJdtDebugCompileMode = true;
+			} else if (DISABLED.equals(optionValue)) {
+				this.enableJdtDebugCompileMode = false;
+			}
+		}
 	}
 
 	private String[] stringToNameList(String optionValue) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
index 1ff0bb5..d51f79a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
@@ -660,7 +660,10 @@
 	this.tempImports = new ImportBinding[numberOfImports];
 	this.tempImports[0] = getDefaultImports()[0];
 	this.importPtr = 1;
-	
+
+	CompilerOptions compilerOptions = compilerOptions();
+	boolean inJdtDebugCompileMode = compilerOptions.enableJdtDebugCompileMode;
+
 	// keep static imports with normal imports until there is a reason to split them up
 	// on demand imports continue to be packages & types. need to check on demand type imports for fields/methods
 	// single imports change from being just types to types or fields
@@ -686,7 +689,7 @@
 			}
 			if (importBinding instanceof PackageBinding) {
 				PackageBinding uniquePackage = ((PackageBinding)importBinding).getVisibleFor(module(), false);
-				if (uniquePackage instanceof SplitPackageBinding) {
+				if (uniquePackage instanceof SplitPackageBinding && !inJdtDebugCompileMode) {
 					SplitPackageBinding splitPackage = (SplitPackageBinding) uniquePackage;
 					problemReporter().conflictingPackagesFromModules(splitPackage, module(), importReference.sourceStart, importReference.sourceEnd);
 					continue nextImport;
@@ -699,7 +702,7 @@
 			recordImportBinding(new ImportBinding(compoundName, true, importBinding, importReference));
 		} else {
 			Binding importBinding = findSingleImport(compoundName, Binding.TYPE | Binding.FIELD | Binding.METHOD, importReference.isStatic());
-			if (importBinding instanceof SplitPackageBinding) {
+			if (importBinding instanceof SplitPackageBinding && !inJdtDebugCompileMode) {
 				SplitPackageBinding splitPackage = (SplitPackageBinding) importBinding;
 				int sourceEnd = (int)(importReference.sourcePositions[splitPackage.compoundName.length-1] & 0xFFFF);
 				problemReporter().conflictingPackagesFromModules((SplitPackageBinding) importBinding, module(), importReference.sourceStart, sourceEnd);
@@ -748,7 +751,7 @@
 					importedPackage = (PackageBinding) findImport(importedPackage.compoundName, false, true);
 					if (importedPackage != null)
 						importedPackage = importedPackage.getVisibleFor(module(), true);
-					if (importedPackage instanceof SplitPackageBinding) {
+					if (importedPackage instanceof SplitPackageBinding && !inJdtDebugCompileMode) {
 						SplitPackageBinding splitPackage = (SplitPackageBinding) importedPackage;
 						int sourceEnd = (int) importReference.sourcePositions[splitPackage.compoundName.length-1];
 						problemReporter().conflictingPackagesFromModules(splitPackage, module(), importReference.sourceStart, sourceEnd);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
index 0ae4780..c47c724 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
@@ -104,6 +104,7 @@
 				SuspendedInferenceRecord prevInvocation = inferenceContext.enterPolyInvocation(invocation, invocation.arguments());
 
 				// Invocation Applicability Inference: 18.5.1 & Invocation Type Inference: 18.5.2
+				InferenceContext18 innerCtx = null;
 				try {
 					Expression[] arguments = invocation.arguments();
 					TypeBinding[] argumentTypes = arguments == null ? Binding.NO_PARAMETERS : new TypeBinding[arguments.length];
@@ -111,7 +112,7 @@
 						argumentTypes[i] = arguments[i].resolvedType;
 					if (previousMethod instanceof ParameterizedGenericMethodBinding) {
 						// find the previous inner inference context to see what inference kind this invocation needs:
-						InferenceContext18 innerCtx = invocation.getInferenceContext((ParameterizedGenericMethodBinding) previousMethod);
+						innerCtx = invocation.getInferenceContext((ParameterizedGenericMethodBinding) previousMethod);
 						if (innerCtx == null) { 
 							/* No inference context -> the method was likely manufactured by Scope.findExactMethod -> assume it wasn't really poly after all.
 							   -> proceed as for non-poly expressions.
@@ -137,7 +138,7 @@
 						return FALSE;
 					return null; // already incorporated
 				} finally {
-					inferenceContext.resumeSuspendedInference(prevInvocation);
+					inferenceContext.resumeSuspendedInference(prevInvocation, innerCtx);
 				}
 			} else if (this.left instanceof ConditionalExpression) {
 				ConditionalExpression conditional = (ConditionalExpression) this.left;
@@ -156,6 +157,8 @@
 			} else if (this.left instanceof LambdaExpression) {
 				LambdaExpression lambda = (LambdaExpression) this.left;
 				BlockScope scope = lambda.enclosingScope;
+				if (this.right instanceof InferenceVariable)
+					return TRUE; // assume inner inference will handle the fine print
 				if (!this.right.isFunctionalInterface(scope))
 					return FALSE;
 				
@@ -231,7 +234,7 @@
 			try {
 				return inferenceContext.inferFunctionalInterfaceParameterization(lambda, scope, targetTypeWithWildCards);
 			} finally {
-				inferenceContext.resumeSuspendedInference(previous);
+				inferenceContext.resumeSuspendedInference(previous, null);
 			}
 		}
 	}
@@ -312,8 +315,9 @@
 				SuspendedInferenceRecord prevInvocation = inferenceContext.enterPolyInvocation(reference, reference.createPseudoExpressions(argumentTypes));
 
 				// Invocation Applicability Inference: 18.5.1 & Invocation Type Inference: 18.5.2
+				InferenceContext18 innerContext = null;
 				try {
-					InferenceContext18 innerContext = reference.getInferenceContext((ParameterizedMethodBinding) compileTimeDecl);
+					innerContext = reference.getInferenceContext((ParameterizedMethodBinding) compileTimeDecl);
 					int innerInferenceKind = determineInferenceKind(compileTimeDecl, argumentTypes, innerContext);
 					inferInvocationApplicability(inferenceContext, original, argumentTypes, original.isConstructor()/*mimic a diamond?*/, innerInferenceKind);
 					if (!inferenceContext.computeB3(reference, r, original))
@@ -322,7 +326,7 @@
 				} catch (InferenceFailureException e) {
 					return FALSE;
 				} finally {
-					inferenceContext.resumeSuspendedInference(prevInvocation);
+					inferenceContext.resumeSuspendedInference(prevInvocation, innerContext);
 				}
 			}
 			TypeBinding rPrime = compileTimeDecl.isConstructor() ? compileTimeDecl.declaringClass : compileTimeDecl.returnType.capture(inferenceContext.scope, reference.sourceStart(), reference.sourceEnd());
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
index 9005278..23338e5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
@@ -21,6 +21,7 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -160,6 +161,7 @@
 	public List<ConstraintFormula> constraintsWithUncheckedConversion;
 	public boolean usesUncheckedConversion;
 	public InferenceContext18 outerContext;
+	private Set<InferenceContext18> seenInnerContexts;
 	Scope scope;
 	LookupEnvironment environment;
 	ReferenceBinding object; // java.lang.Object
@@ -1624,18 +1626,24 @@
 		this.usesUncheckedConversion = innerCtx.usesUncheckedConversion;
 	}
 
-	public void resumeSuspendedInference(SuspendedInferenceRecord record) {
+	public void resumeSuspendedInference(SuspendedInferenceRecord record, InferenceContext18 innerContext) {
 		// merge inference variables:
+		boolean firstTime = collectInnerContext(innerContext);
 		if (this.inferenceVariables == null) { // no new ones, assume we aborted prematurely
 			this.inferenceVariables = record.inferenceVariables;
+		} else if(!firstTime) {
+			// Use a set to eliminate duplicates.
+			final Set<InferenceVariable> uniqueVariables = new LinkedHashSet<>();
+			uniqueVariables.addAll(Arrays.asList(record.inferenceVariables));
+			uniqueVariables.addAll(Arrays.asList(this.inferenceVariables));
+			this.inferenceVariables = uniqueVariables.toArray(new InferenceVariable[uniqueVariables.size()]);
 		} else {
 			int l1 = this.inferenceVariables.length;
 			int l2 = record.inferenceVariables.length;
-			// move to back, add previous to front:
 			System.arraycopy(this.inferenceVariables, 0, this.inferenceVariables=new InferenceVariable[l1+l2], l2, l1);
 			System.arraycopy(record.inferenceVariables, 0, this.inferenceVariables, 0, l2);
 		}
-
+		
 		// replace invocation site & arguments:
 		this.currentInvocation = record.site;
 		this.invocationArguments = record.invocationArguments;
@@ -1643,6 +1651,16 @@
 		this.usesUncheckedConversion = record.usesUncheckedConversion;
 	}
 
+	private boolean collectInnerContext(final InferenceContext18 innerContext) {
+		if(innerContext == null) {
+			return false;
+		}
+		if(this.seenInnerContexts == null) {
+			this.seenInnerContexts = new HashSet<>();
+		}
+		return this.seenInnerContexts.add(innerContext);
+	}
+	
 	private Substitution getResultSubstitution(final BoundSet result) {
 		return new Substitution() {
 			@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
index bf84736..0acfe58 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
@@ -1834,8 +1834,7 @@
 	this.mayTolerateMissingType = true;
 	try {
 		nullable = this.nullableAnnotation != null ? this.nullableAnnotation.getAnnotationType()
-				: getType(this.getNullableAnnotationName(), this.UnNamedModule); // FIXME(SHMOD) module for null
-																					// annotations??
+				: getType(this.getNullableAnnotationName(), this.UnNamedModule); // FIXME(SHMOD) module for null annotations??
 		nonNull = this.nonNullAnnotation != null ? this.nonNullAnnotation.getAnnotationType()
 				: getType(this.getNonNullAnnotationName(), this.UnNamedModule);
 	} finally {
@@ -2063,7 +2062,8 @@
 			}
 			packageBinding.addType(binding);
 		}
-	} else if (binding == TheNotFoundType) {
+	}
+	if (binding == TheNotFoundType) {
 		// report the missing class file first
 		if (!wasMissingType) {
 			/* Since missing types have been already been complained against while producing binaries, there is no class path 
@@ -2455,6 +2455,7 @@
 		this.root.reset();
 		return;
 	}
+	this.stepCompleted = 0;
 	this.knownModules = new HashtableOfModule();
 	this.UnNamedModule = new ModuleBinding.UnNamedModule(this);
 	this.module = this.UnNamedModule;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
index 953bceb..642fe17 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
@@ -254,7 +254,8 @@
 				this.requires[len] = requiredModule;
 			}
 		} else {
-			// TODO(SHMOD) report error
+			this.environment.problemReporter.missingModuleAddReads(requiredModuleName);
+			return;
 		}
 		// update known packages:
 		HashtableOfPackage knownPackages = this.environment.knownPackages;
@@ -308,7 +309,7 @@
 	public void addResolvedExport(PackageBinding declaredPackage, char[][] targetModules) {
 		int len = this.exportedPackages.length;
 		if (declaredPackage == null || !declaredPackage.isValidBinding()) {
-			// FIXME(SHMOD) use a problem binding? See https://bugs.eclipse.org/518794#c13
+			// TODO(SHMOD) use a problem binding (if needed by DOM clients)? See https://bugs.eclipse.org/518794#c13
 			return;
 		}
 		if (len == 0) {
@@ -324,7 +325,7 @@
 	public void addResolvedOpens(PackageBinding declaredPackage, char[][] targetModules) {
 		int len = this.openedPackages.length;
 		if (declaredPackage == null || !declaredPackage.isValidBinding()) {
-			// FIXME(SHMOD) use a problem binding? See https://bugs.eclipse.org/518794#c13
+			// TODO(SHMOD) use a problem binding (if needed by DOM clients)? See https://bugs.eclipse.org/518794#c13
 			return;
 		}
 		if (len == 0) {
@@ -426,7 +427,6 @@
 
 		Collection<ModuleBinding> allRequires = dependencyCollector().get();
 		if (allRequires.contains(this)) {
-			// TODO(SHMOD): report (when? where?)
 			return NO_MODULES; // avoid entering unbounded recursion due to cyclic requires
 		}
 		ModuleBinding javaBase = this.environment.javaBaseModule();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
index a155b22..0d3ebbb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
@@ -1105,6 +1105,10 @@
 	protected
 // SH}
 	TypeBinding substituteInferenceVariable(InferenceVariable var, TypeBinding substituteType) {
+		ReferenceBinding newEnclosing = this.enclosingType;
+		if (!isStatic() && this.enclosingType != null) {
+			newEnclosing = (ReferenceBinding) this.enclosingType.substituteInferenceVariable(var, substituteType);
+		}
 		if (this.arguments != null) {
 			TypeBinding[] newArgs = null;
 			int length = this.arguments.length;
@@ -1118,7 +1122,9 @@
 				}
 			}
 			if (newArgs != null)
-				return this.environment.createParameterizedType(this.type, newArgs, this.enclosingType);
+				return this.environment.createParameterizedType(this.type, newArgs, newEnclosing);
+		} else if (TypeBinding.notEquals(newEnclosing, this.enclosingType)) {
+			return this.environment.createParameterizedType(this.type, this.arguments, newEnclosing);
 		}
 		return this;
 	}
@@ -1203,6 +1209,9 @@
 					this.arguments[i].collectInferenceVariables(variables);
 			}
 		}
+		if (!isStatic() && this.enclosingType != null) {
+			this.enclosingType.collectInferenceVariables(variables);
+		}
 	}
 
 	/**
@@ -1833,6 +1842,8 @@
 		for (int i = 0, length = choices.length; i < length; i++) {
 			MethodBinding method = choices[i];
 			if (!method.isAbstract() || method.redeclaresPublicObjectMethod(scope)) continue; // (re)skip statics, defaults, public object methods ...
+			if (method.problemId() == ProblemReasons.ContradictoryNullAnnotations)
+				method = ((ProblemMethodBinding) method).closestMatch;
 			this.singleAbstractMethod[index] = method;
 			break;
 		}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java
index c245ca4..f9a1e35 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java
@@ -53,6 +53,7 @@
 	final int NoProperEnclosingInstance = 28;
 	final int InterfaceMethodInvocationNotBelow18 = 29;
 	final int NotAccessible = 30; // JLS 6.6.1 - module aspects
+	final int ErrorAlreadyReported = 31;
 //{ObjectTeams;
     final int NoTeamContext = 50;
     final int AnchorNotFinal = 51;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index b5abba1..7dc9404 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -5312,14 +5312,14 @@
 				TypeBinding param = parameters[lastIndex]; // is an ArrayBinding by definition
 				TypeBinding arg = arguments[lastIndex];
 				if (TypeBinding.notEquals(param, arg)) {
-					level = parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods);
+					level = parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods, method);
 					if (level == NOT_COMPATIBLE) {
 						// expect X[], is it called with X
 						param = ((ArrayBinding) param).elementsType();
 						if (tiebreakingVarargsMethods) {
 							arg = ((ArrayBinding) arg).elementsType();
 						}
-						if (parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods) == NOT_COMPATIBLE)
+						if (parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods, method) == NOT_COMPATIBLE)
 							return NOT_COMPATIBLE;
 						level = VARARGS_COMPATIBLE; // varargs support needed
 					}
@@ -5329,7 +5329,7 @@
 					TypeBinding param = ((ArrayBinding) parameters[lastIndex]).elementsType();
 					for (int i = lastIndex; i < argLength; i++) {
 						TypeBinding arg = (tiebreakingVarargsMethods && (i == (argLength - 1))) ? ((ArrayBinding)arguments[i]).elementsType() : arguments[i];
-						if (TypeBinding.notEquals(param, arg) && parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods) == NOT_COMPATIBLE)
+						if (TypeBinding.notEquals(param, arg) && parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods, method) == NOT_COMPATIBLE)
 							return NOT_COMPATIBLE;
 					}
 				}  else if (lastIndex != argLength) { // can call foo(int i, X ... x) with foo(1) but NOT foo();
@@ -5345,7 +5345,7 @@
 			TypeBinding param = parameters[i];
 			TypeBinding arg = (tiebreakingVarargsMethods && (i == (argLength - 1))) ? ((ArrayBinding)arguments[i]).elementsType() : arguments[i];
 			if (TypeBinding.notEquals(arg,param)) {
-				int newLevel = parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods);
+				int newLevel = parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods, method);
 				if (newLevel == NOT_COMPATIBLE)
 					return NOT_COMPATIBLE;
 				if (newLevel > level)
@@ -5377,12 +5377,16 @@
 		return NOT_COMPATIBLE;
 	}
 	
-	private int parameterCompatibilityLevel(TypeBinding arg, TypeBinding param, LookupEnvironment env, boolean tieBreakingVarargsMethods) {
+	private int parameterCompatibilityLevel(TypeBinding arg, TypeBinding param, LookupEnvironment env, boolean tieBreakingVarargsMethods, MethodBinding method) {
 		// only called if env.options.sourceLevel >= ClassFileConstants.JDK1_5
 		if (arg == null || param == null)
 			return NOT_COMPATIBLE;
-		if (arg.isCompatibleWith(param, this))
+		if (arg instanceof PolyTypeBinding && !((PolyTypeBinding) arg).expression.isPertinentToApplicability(param, method)) {
+			if (arg.isPotentiallyCompatibleWith(param, this))
+				return COMPATIBLE;
+		} else if (arg.isCompatibleWith(param, this)) {
 			return COMPATIBLE;
+		}
 		if (tieBreakingVarargsMethods && (this.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_7 || !CompilerOptions.tolerateIllegalAmbiguousVarargsInvocation)) {
 			/* 15.12.2.5 Choosing the Most Specific Method, ... One variable arity member method named m is more specific than
 			   another variable arity member method of the same name if either ... Only subtypes relationship should be used.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java
index 51ed3bf..db529aa 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java
@@ -57,19 +57,25 @@
 				pair.setMethodBinding(methods[0]);
 			} // else silently leave a null there
 			Object value = pair.getValue();
-			if (value instanceof UnresolvedReferenceBinding) {
-				pair.setValue(((UnresolvedReferenceBinding) value).
-						resolve(this.env, false));
-							// no parameterized types in annotation values
-			} else if (value instanceof Object[]) {
-				Object[] values = (Object[]) value;
-				for (int j = 0; j < values.length; j++) {
-					if (values[j] instanceof UnresolvedReferenceBinding) {
-						values[j] = ((UnresolvedReferenceBinding) values[j]).resolve(this.env, false);
+			boolean wasToleratingMissingTypeProcessingAnnotations = this.env.mayTolerateMissingType;
+			this.env.mayTolerateMissingType = true; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=360164
+			try {
+				if (value instanceof UnresolvedReferenceBinding) {
+					pair.setValue(((UnresolvedReferenceBinding) value).
+							resolve(this.env, false));
+								// no parameterized types in annotation values
+				} else if (value instanceof Object[]) {
+					Object[] values = (Object[]) value;
+					for (int j = 0; j < values.length; j++) {
+						if (values[j] instanceof UnresolvedReferenceBinding) {
+							values[j] = ((UnresolvedReferenceBinding) values[j]).resolve(this.env, false);
+						}
 					}
-				}
-			} // do nothing for UnresolvedAnnotationBinding-s, since their
-			  // content is only accessed through get* methods
+				} // do nothing for UnresolvedAnnotationBinding-s, since their
+				  // content is only accessed through get* methods
+			} finally {
+				this.env.mayTolerateMissingType = wasToleratingMissingTypeProcessingAnnotations;
+			}
 		}
 		this.env = null;
 	}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index ae036ed..63a81f0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -991,6 +991,7 @@
 	switch (problemID) {
 		case IProblem.IsClassPathCorrect :
 		case IProblem.CorruptedSignature :
+		case IProblem.UndefinedModuleAddReads :
 			return CategorizedProblem.CAT_BUILDPATH;
 //{ObjectTeams:
 		case IProblem.BaseImportFromSplitPackage :
@@ -1747,6 +1748,13 @@
 			lambda.sourceStart,
 			lambda.diagnosticsSourceEnd());
 }
+public void missingValueFromLambda(LambdaExpression lambda, TypeBinding returnType) {
+	this.handle(IProblem.MissingValueFromLambda, 
+			new String[] {new String(returnType.readableName())},
+			new String[] {new String(returnType.shortReadableName())},
+			lambda.sourceStart,
+			lambda.diagnosticsSourceEnd());
+}
 public void caseExpressionMustBeConstant(Expression expression) {
 	this.handle(
 		IProblem.NonConstantExpression,
@@ -4781,6 +4789,8 @@
 	int id = IProblem.UndefinedMethod; //default...
     MethodBinding shownMethod = method;
 	switch (method.problemId()) {
+		case ProblemReasons.ErrorAlreadyReported:
+			return;
 		case ProblemReasons.NoSuchMethodOnArray :
 			return; // secondary error.
 		case ProblemReasons.NotFound :
@@ -15378,6 +15388,10 @@
 		NoArgument, new String[] { CharOperation.charToString(ref.moduleName) },
 		ref.sourceStart, ref.sourceEnd);
 }
+public void missingModuleAddReads(char[] requiredModuleName) {
+	String[] args = new String[] { new String(requiredModuleName) };
+	this.handle(IProblem.UndefinedModuleAddReads, args, args, 0, 0);
+}
 public void invalidOpensStatement(OpensStatement statement, ModuleDeclaration module) {
 	this.handle(IProblem.InvalidOpensStatement,
 		NoArgument, new String[] { CharOperation.charToString(module.moduleName) },
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
index e374a38..c8657e9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
@@ -856,6 +856,8 @@
 1001 = Syntax error, modifiers and annotations are not allowed for the lambda parameter {0} as its type is elided
 1002 = Syntax error, modifiers are not allowed here
 1003 = Explicit type arguments cannot be specified in raw constructor reference expression
+# more lambda:
+1004 = This lambda expression must return a result of type {0}
 
 # Default methods:
 # variant of 359: 
@@ -911,6 +913,7 @@
 1316 = Invalid service interface {0}, must be a class, interface or annotation type
 1317 = Invalid service implementation {0}, must be a public class or interface type
 1318 = Illegal modifier for module {0}; only open is permitted
+1319 = {0} cannot be resolved to a module, it is referenced from an add-reads directive
 
 #### Java 9
 1351 = Variable resource not allowed here for source level below 9
@@ -984,7 +987,7 @@
 1609 = Switch Case Labels with '->' are allowed only at source level 12 or above
 1610 = Break of a switch expression should have a value
 1611 = A Switch expression should cover all possible values
-1612 = Illegal last statement in Switch expression case body - continue, return not allowed
+1612 = 'continue' or 'return' cannot be the last statement in a Switch expression case body
 
 ### ELABORATIONS
 ## Access restrictions
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java
index deff7d5..c29c43f 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java
@@ -24,6 +24,7 @@
 
 import org.eclipse.jdt.core.WorkingCopyOwner;
 import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.core.dom.MethodBinding.LambdaMethod;
 import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
 import org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration;
 import org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
@@ -71,6 +72,7 @@
 import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
 import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
 import org.eclipse.jdt.internal.compiler.lookup.Scope;
+import org.eclipse.jdt.internal.compiler.lookup.SyntheticArgumentBinding;
 import org.eclipse.jdt.internal.compiler.lookup.TagBits;
 import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
 import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
@@ -936,6 +938,14 @@
 		return null;
 	}
 
+	private IVariableBinding[] getSyntheticOuterLocalVariables(org.eclipse.jdt.internal.compiler.ast.LambdaExpression lambdaExpression) {
+		IVariableBinding[] syntheticOuterLocals = new IVariableBinding[lambdaExpression.outerLocalVariables.length];
+		int i  = 0;
+		for (SyntheticArgumentBinding sab : lambdaExpression.outerLocalVariables) {
+			syntheticOuterLocals[i++] = getVariableBinding(sab);
+		}
+		return syntheticOuterLocals;
+	}
 	@Override
 	synchronized IMethodBinding resolveMethod(LambdaExpression lambda) {
 		Object oldNode = this.newAstToOldAst.get(lambda);
@@ -950,6 +960,9 @@
 			if (methodBinding == null) {
 				return null;
 			}
+			if (methodBinding instanceof LambdaMethod) {
+				((LambdaMethod) methodBinding).setSyntheticOuterLocals(getSyntheticOuterLocalVariables(lambdaExpression));
+			}
 			this.bindingsToAstNodes.put(methodBinding, lambda);
 			String key = methodBinding.getKey();
 			if (key != null) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java
index ea2b6cb..34a8283 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2015 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
@@ -384,6 +384,18 @@
 	 * @since 3.1
 	 */
 	public boolean overrides(IMethodBinding method);
+	
+
+	/**
+	 * Returns a list of variable bindings representing the synthetic outer
+	 * local variables. Returns an empty array for non-lambda expressions or if 
+	 * this method does not have any synthetic parameters.
+	 * 
+	 * @return a (possibly empty) list of variable bindings for the synthetic
+	 * outer locals of this method if this is a lambda expression, else an empty array.
+	 * @since 3.18
+	 */
+	public IVariableBinding[] getSyntheticOuterLocals();
 
 //{ObjectTeams:
 	/**
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java
index 8855b5c..1866c28 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2015 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
@@ -46,6 +46,7 @@
 		Modifier.ABSTRACT | Modifier.STATIC | Modifier.FINAL | Modifier.SYNCHRONIZED | Modifier.NATIVE |
 		Modifier.STRICTFP | Modifier.DEFAULT;
 	private static final ITypeBinding[] NO_TYPE_BINDINGS = new ITypeBinding[0];
+	static final IVariableBinding[] NO_VARIABLE_BINDINGS = new IVariableBinding[0];
 	protected org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding;
 	protected BindingResolver resolver;
 	private volatile ITypeBinding[] parameterTypes;
@@ -550,6 +551,7 @@
 
 		private MethodBinding implementation;
 		private IBinding declaringMember;
+		private IVariableBinding[] syntheticOuterLocalVariables;
 
 		public LambdaMethod(DefaultBindingResolver resolver,
 							org.eclipse.jdt.internal.compiler.lookup.MethodBinding lambdaDescriptor,
@@ -606,5 +608,22 @@
 		public String toString() {
 			return super.toString().replace("public abstract ", "public ");  //$NON-NLS-1$//$NON-NLS-2$
 		}
+
+		@Override
+		public IVariableBinding[] getSyntheticOuterLocals() {
+			if (this.syntheticOuterLocalVariables != null) {
+				return this.syntheticOuterLocalVariables;
+			}
+			return NO_VARIABLE_BINDINGS;
+		}
+
+		public  void setSyntheticOuterLocals(IVariableBinding[] syntheticOuterLocalVariables) {
+			this.syntheticOuterLocalVariables = syntheticOuterLocalVariables;
+		}
 	}
-}
+
+	@Override
+	public IVariableBinding[] getSyntheticOuterLocals() {
+		return NO_VARIABLE_BINDINGS;
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
index 411639b..4e8c011 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
@@ -5804,6 +5804,8 @@
 		IndexManager manager = JavaModelManager.getIndexManager();
 		manager.deleteIndexFiles(subMonitor.split(1));
 		manager.reset();
+		// New index is disabled, see bug 544898.
+		// However we keep this call here to cleanup the possibly existing database
 		Indexer.getInstance().rebuildIndex(subMonitor.split(95));
 		updateLegacyIndex(subMonitor.split(4));
 	}
@@ -6398,6 +6400,7 @@
 		super.start(context);
 		JavaModelManager.registerDebugOptionsListener(context);
 		JavaModelManager.getJavaModelManager().startup();
-		Indexer.getInstance().rescanAll();
+		// New index is disabled, see bug 544898
+		// Indexer.getInstance().rescanAll();
 	}
 }
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/provisional/JavaModelAccess.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/provisional/JavaModelAccess.java
index 9e6ebc4..73e7644 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/provisional/JavaModelAccess.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/provisional/JavaModelAccess.java
@@ -15,8 +15,10 @@
 
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IModuleDescription;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.internal.core.JavaProject;
+import org.eclipse.jdt.internal.core.JrtPackageFragmentRoot;
 import org.eclipse.jdt.internal.core.PackageFragmentRoot;
 
 /**
@@ -61,4 +63,17 @@
 				throw new IllegalArgumentException("Illegal kind of java element: "+element.getElementType()); //$NON-NLS-1$
 		}
 	}
+
+	/**
+	 * Answer whether the given module is a system module.
+	 * <p><em>This provisional API may likely be changed into a direct method {@code IModuleDescription.isSystemModule()}.</em></p>
+	 * 
+	 * @param module the module being queried about
+	 * @return {@code true} iff the module is defined in the system library (also known as JRE).
+	 * @since 3.18
+	 */
+	public static boolean isSystemModule(IModuleDescription module) {
+		IPackageFragmentRoot pfr = (IPackageFragmentRoot) module.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
+		return pfr instanceof JrtPackageFragmentRoot;
+	}
 }
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
index cef00e7..cb679cc 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
@@ -15,14 +15,17 @@
  *******************************************************************************/
 package org.eclipse.jdt.internal.core;
 
-import java.util.*;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
 
-import org.eclipse.core.runtime.preferences.*;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
 import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
 import org.eclipse.jdt.internal.core.nd.db.ChunkCache;
-import org.eclipse.jdt.internal.core.nd.java.JavaIndex;
 
 /**
  * JavaCore eclipse preferences initializer.
@@ -116,8 +119,6 @@
 		defaultOptionsMap.put(ChunkCache.CHUNK_CACHE_SIZE_MB, Double.toString(ChunkCache.CHUNK_CACHE_SIZE_MB_DEFAULT));
 		defaultOptionsMap.put(ChunkCache.CHUNK_CACHE_SIZE_PERCENT,
 				Double.toString(ChunkCache.CHUNK_CACHE_SIZE_PERCENT_DEFAULT));
-		defaultOptionsMap.put(JavaIndex.ENABLE_NEW_JAVA_INDEX,
-				Boolean.toString(JavaIndex.ENABLE_NEW_JAVA_INDEX_DEFAULT));
 
 		// Time out for parameter names
 		defaultOptionsMap.put(JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, "50"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
index 45f3cee..2fcbf6f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
@@ -5428,8 +5428,9 @@
 					| IResourceChangeEvent.PRE_DELETE
 					| IResourceChangeEvent.PRE_CLOSE
 					| IResourceChangeEvent.PRE_REFRESH);
-
-			Indexer.getInstance().addListener(this.deltaState);
+			
+			// New index is disabled, see bug 544898
+			// Indexer.getInstance().addListener(this.deltaState);
 
 			// listen to resource changes affecting external annotations
 			ExternalAnnotationTracker.start(workspace);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java
index 8a67100..695eed1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java
@@ -364,7 +364,7 @@
 			}
 			cache.allPkgFragmentsCache = allPkgFragmentsCache;
 		}
-		return new NameLookup(cache.allPkgFragmentRootsCache, cache.allPkgFragmentsCache, workingCopies, cache.rootToResolvedEntries);
+		return new NameLookup(project, cache.allPkgFragmentRootsCache, cache.allPkgFragmentsCache, workingCopies, cache.rootToResolvedEntries);
 	}
 
 	/*
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Member.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Member.java
index 6608021..36d1011 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Member.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Member.java
@@ -329,6 +329,7 @@
 						break;
 					case ITerminalSymbols.TokenNameCOMMENT_LINE :
 					case ITerminalSymbols.TokenNameCOMMENT_BLOCK :
+					case ITerminalSymbols.TokenNameCOMMA:
 						terminal= scanner.getNextToken();
 						continue loop;
 					default :
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java
index 835d457..d360352 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java
@@ -227,11 +227,14 @@
 	public long timeSpentInSeekTypesInSourcePackage = 0;
 	public long timeSpentInSeekTypesInBinaryPackage = 0;
 
+	private JavaProject rootProject;
+
 	public NameLookup(
-			IPackageFragmentRoot[] packageFragmentRoots,
+			JavaProject rootProject, IPackageFragmentRoot[] packageFragmentRoots,
 			HashtableOfArrayToObject packageFragments,
 			ICompilationUnit[] workingCopies,
 			Map rootToResolvedEntries) {
+		this.rootProject = rootProject;
 		long start = -1;
 		if (VERBOSE) {
 			Util.verbose(" BUILDING NameLoopkup");  //$NON-NLS-1$
@@ -795,7 +798,7 @@
 					}
 				}
 				Answer answer = new Answer(type, accessRestriction, entry,
-										getModuleDescription(root, this.rootToModule, this.rootToResolvedEntries::get));
+										getModuleDescription(this.rootProject, root, this.rootToModule, this.rootToResolvedEntries::get));
 				if (!answer.ignoreIfBetter()) {
 					if (answer.isBetter(suggestedAnswer))
 						return answer;
@@ -872,10 +875,20 @@
 	}
 
 	/** Internal utility, which is able to answer explicit and automatic modules. */
-	static IModuleDescription getModuleDescription(IPackageFragmentRoot root, Map<IPackageFragmentRoot,IModuleDescription> cache, Function<IPackageFragmentRoot,IClasspathEntry> rootToEntry) {
+	static IModuleDescription getModuleDescription(JavaProject project, IPackageFragmentRoot root, Map<IPackageFragmentRoot,IModuleDescription> cache, Function<IPackageFragmentRoot,IClasspathEntry> rootToEntry) {
 		IModuleDescription module = cache.get(root);
 		if (module != null)
 			return module != NO_MODULE ? module : null;
+		if (!Objects.equals(project, root.getJavaProject())) {
+			IClasspathEntry classpathEntry2 = rootToEntry.apply(root);
+			if (classpathEntry2 instanceof ClasspathEntry) {
+				if (!((ClasspathEntry) classpathEntry2).isModular()) {
+					// not on the module path and not a local source folder
+					cache.put(root, NO_MODULE);
+					return null;
+				}
+			}
+		}
 		try {
 			if (root.getKind() == IPackageFragmentRoot.K_SOURCE)
 				module = root.getJavaProject().getModuleDescription(); // from any root in this project
@@ -903,7 +916,7 @@
 	}
 
 	public IModule getModuleDescriptionInfo(PackageFragmentRoot root) {
-		IModuleDescription desc = getModuleDescription(root, this.rootToModule, this.rootToResolvedEntries::get);
+		IModuleDescription desc = getModuleDescription(this.rootProject, root, this.rootToModule, this.rootToResolvedEntries::get);
 		if (desc != null) {
 			return getModuleDescriptionInfo(desc);
 		}
@@ -1284,7 +1297,7 @@
 					continue;
 				}
 			}
-			module = getModuleDescription(root, this.rootToModule, this.rootToResolvedEntries::get);
+			module = getModuleDescription(this.rootProject, root, this.rootToModule, this.rootToResolvedEntries::get);
 			if (module != null && prefixMatcher.matches(name, module.getElementName().toCharArray(), false)) {
 				requestor.acceptModule(module);
 			}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
index 0f7c5d7..5595856 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
@@ -993,7 +993,7 @@
 			this.rootToModule = new HashMap<>();
 		}
 		for (IPackageFragmentRoot root : roots) {
-			IModuleDescription moduleDescription = NameLookup.getModuleDescription(root, this.rootToModule, this.nameLookup.rootToResolvedEntries::get);
+			IModuleDescription moduleDescription = NameLookup.getModuleDescription(this.project, root, this.rootToModule, this.nameLookup.rootToResolvedEntries::get);
 			if (moduleDescription != null)
 				return moduleDescription;
 		}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java
index 2db1b70..77d6ded 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.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
@@ -727,11 +727,16 @@
 		// but at the start of the next problem we should reset it to the source file's resource
 		IResource resource = sourceFile.resource;
 		
-		// handle missing classfile situation
+		// handle buildpath problems (missing classfile, unresolved add-reads...)
+		String buildPathProblemMessage = null;
 		if (id == IProblem.IsClassPathCorrect) {
-			String missingClassfileName = problem.getArguments()[0];
+			buildPathProblemMessage = Messages.bind(Messages.build_incompleteClassPath, problem.getArguments()[0]);
+		} else if (id == IProblem.UndefinedModuleAddReads) {
+			buildPathProblemMessage = Messages.bind(Messages.build_errorOnModuleDirective, problem.getMessage());
+		}
+		if (buildPathProblemMessage != null) {
 			if (JavaBuilder.DEBUG)
-				System.out.println(Messages.bind(Messages.build_incompleteClassPath, missingClassfileName));
+				System.out.println(buildPathProblemMessage);
 			boolean isInvalidClasspathError = JavaCore.ERROR.equals(this.javaBuilder.javaProject.getOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, true));
 			// insert extra classpath problem, and make it the only problem for this project (optional)
 			if (isInvalidClasspathError && JavaCore.ABORT.equals(this.javaBuilder.javaProject.getOption(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, true))) {
@@ -742,7 +747,7 @@
 			marker.setAttributes(
 				new String[] {IMarker.MESSAGE, IMarker.SEVERITY, IJavaModelMarker.CATEGORY_ID, IMarker.SOURCE_ID},
 				new Object[] {
-					Messages.bind(Messages.build_incompleteClassPath, missingClassfileName),
+					buildPathProblemMessage,
 					Integer.valueOf(isInvalidClasspathError ? IMarker.SEVERITY_ERROR : IMarker.SEVERITY_WARNING),
 					Integer.valueOf(CategorizedProblem.CAT_BUILDPATH),
 					JavaBuilder.SOURCE_ID
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
index 0affc3b..1f803d5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
@@ -32,6 +32,7 @@
 import org.eclipse.core.runtime.SubMonitor;
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IModuleDescription;
 import org.eclipse.jdt.core.IPackageFragmentRoot;
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.JavaCore;
@@ -430,7 +431,15 @@
 	IPath path = root.getPath();
 	// take the OS path for external jars, and the forward slash path for internal jars
 	String rootPath = path.getDevice() == null ? path.toString() : path.toOSString();
-	String documentPath = rootPath + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + filePath;
+	IModuleDescription md = root.getModuleDescription();
+	String documentPath;
+	if(md != null) {
+		String module = md.getElementName();
+		documentPath = rootPath + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR
+				+ module + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + filePath;
+	} else {
+		documentPath = rootPath + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + filePath;
+	}
 	IBinaryType binaryType = (IBinaryType)this.binariesFromIndexMatches.get(documentPath);
 	if (binaryType != null) {
 		this.infoToHandle.put(binaryType, classFile);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java
index f1fe4d6..a75bd65 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java
@@ -111,6 +111,7 @@
 	public static String build_inconsistentClassFile;
 	public static String build_inconsistentProject;
 	public static String build_incompleteClassPath;
+	public static String build_errorOnModuleDirective;
 	public static String build_missingSourceFile;
 	public static String build_prereqProjectHasClasspathProblems;
 	public static String build_prereqProjectMustBeRebuilt;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties
index 305dbb8..ec02740 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties
@@ -103,6 +103,7 @@
 build_inconsistentClassFile = A class file was not written. The project may be inconsistent, if so try refreshing this project and building it
 build_inconsistentProject = The project was not built due to "{0}". Fix the problem, then try refreshing this project and building it since it may be inconsistent
 build_incompleteClassPath = The project was not built since its build path is incomplete. Cannot find the class file for {0}. Fix the build path then try building this project
+build_errorOnModuleDirective = The project was not built since its build path has a problem: {0}. Fix the build path then try building this project
 build_missingSourceFile = The project was not built since the source file {0} could not be read
 build_prereqProjectHasClasspathProblems = The project was not built since it depends on {0}, which has build path errors
 build_prereqProjectMustBeRebuilt = The project cannot be built until its prerequisite {0} is built. Cleaning and building all projects is recommended
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java
index 9ad7929..621e104 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java
@@ -50,10 +50,6 @@
 import org.eclipse.core.runtime.SubMonitor;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.core.runtime.jobs.JobGroup;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
-import org.eclipse.core.runtime.preferences.InstanceScope;
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IJavaElementDelta;
 import org.eclipse.jdt.core.IJavaModelStatusConstants;
@@ -73,7 +69,6 @@
 import org.eclipse.jdt.internal.core.JavaModelManager;
 import org.eclipse.jdt.internal.core.nd.IReader;
 import org.eclipse.jdt.internal.core.nd.Nd;
-import org.eclipse.jdt.internal.core.nd.db.ChunkCache;
 import org.eclipse.jdt.internal.core.nd.db.Database;
 import org.eclipse.jdt.internal.core.nd.db.IndexException;
 import org.eclipse.jdt.internal.core.nd.java.FileFingerprint;
@@ -102,18 +97,21 @@
 	public static boolean DEBUG_INSERTIONS;
 	public static boolean DEBUG_SELFTEST;
 	public static int DEBUG_LOG_SIZE_MB;
-	private static IPreferenceChangeListener listener = new IPreferenceChangeListener() {
-		@Override
-		public void preferenceChange(PreferenceChangeEvent event) {
-			if (JavaIndex.ENABLE_NEW_JAVA_INDEX.equals(event.getKey())) {
-				if (JavaIndex.isEnabled()) {
-					getInstance().rescanAll();
-				} else {
-					ChunkCache.getSharedInstance().clear();
-				}
-			}
-		}
-	};
+	
+	// New index is disabled, see bug 544898
+//	private static final String ENABLE_NEW_JAVA_INDEX = "enableNewJavaIndex"; //$NON-NLS-1$
+//	private static IPreferenceChangeListener listener = new IPreferenceChangeListener() {
+//		@Override
+//		public void preferenceChange(PreferenceChangeEvent event) {
+//			if (ENABLE_NEW_JAVA_INDEX.equals(event.getKey())) {
+//				if (JavaIndex.isEnabled()) {
+//					getInstance().rescanAll();
+//				} else {
+//					ChunkCache.getSharedInstance().clear();
+//				}
+//			}
+//		}
+//	};
 
 	// This is an arbitrary constant that is larger than the maximum number of ticks
 	// reported by SubMonitor and small enough that it won't overflow a long when multiplied by a large
@@ -166,8 +164,8 @@
 		synchronized (mutex) {
 			if (indexer == null) {
 				indexer = new Indexer(JavaIndex.getGlobalNd(), ResourcesPlugin.getWorkspace().getRoot());
-				IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID);
-				preferences.addPreferenceChangeListener(listener);
+//				IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID);
+//				preferences.addPreferenceChangeListener(listener);
 			}
 			return indexer;
 		}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaIndex.java
index 56fcec9..afef5b8 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/JavaIndex.java
@@ -22,8 +22,6 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.internal.core.JavaModelManager;
@@ -45,9 +43,6 @@
 	static final int MAX_SUPPORTED_VERSION = Nd.version(1, 49);
 	static final int MIN_SUPPORTED_VERSION = Nd.version(1, 49);
 
-	public static final String ENABLE_NEW_JAVA_INDEX = "enableNewJavaIndex"; //$NON-NLS-1$
-	public static final boolean ENABLE_NEW_JAVA_INDEX_DEFAULT = false;
-
 	// Fields for the search header
 	public static final FieldSearchIndex<NdResourceFile> FILES;
 	public static final FieldSearchIndex<NdTypeId> SIMPLE_INDEX;
@@ -223,13 +218,11 @@
 		return next.getPath();
 	}
 
+	/**
+	 * @return always return {@code false} see bug 544898. New index is disabled now. 
+	 */
 	public static boolean isEnabled() {
-		IPreferencesService preferenceService = Platform.getPreferencesService();
-		if (preferenceService == null) {
-			return true;
-		}
-		return preferenceService.getBoolean(JavaCore.PLUGIN_ID, ENABLE_NEW_JAVA_INDEX, ENABLE_NEW_JAVA_INDEX_DEFAULT,
-				null);
+		return false;
 	}
 
 	public static Nd createNd(File databaseFile, ChunkCache chunkCache) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
index cb7fde5..3046532 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
@@ -113,11 +113,23 @@
 			} else {
 				return; // unknown target
 			}
-			this.focusPath =
-				zipFileName
-					+ JAR_FILE_ENTRY_SEPARATOR
-					+ type.getFullyQualifiedName().replace('.', '/')
-					+ SUFFIX_STRING_class;
+			IModuleDescription md = root.getModuleDescription();
+			if(md != null) {
+				String module = md.getElementName();
+				this.focusPath =
+						zipFileName
+						+ JAR_FILE_ENTRY_SEPARATOR
+						+ module
+						+ JAR_FILE_ENTRY_SEPARATOR
+						+ type.getFullyQualifiedName().replace('.', '/')
+						+ SUFFIX_STRING_class;
+			} else {
+				this.focusPath =
+					zipFileName
+						+ JAR_FILE_ENTRY_SEPARATOR
+						+ type.getFullyQualifiedName().replace('.', '/')
+						+ SUFFIX_STRING_class;
+			}
 		} else {
 			this.focusPath = type.getPath().toString();
 		}
@@ -174,12 +186,24 @@
 				} else {
 					continue; // unknown target
 				}
-				String resourcePath =
-					zipFileName
+				String resourcePath;
+				IModuleDescription md = root.getModuleDescription();
+				if(md != null) {
+					String module = md.getElementName();
+					resourcePath =
+							zipFileName
+							+ JAR_FILE_ENTRY_SEPARATOR
+							+ module
+							+ JAR_FILE_ENTRY_SEPARATOR
+							+ type.getFullyQualifiedName().replace('.', '/')
+							+ SUFFIX_STRING_class;
+				} else {
+					resourcePath =
+						zipFileName
 						+ JAR_FILE_ENTRY_SEPARATOR
 						+ type.getFullyQualifiedName().replace('.', '/')
 						+ SUFFIX_STRING_class;
-
+				}
 				this.resourcePaths.add(resourcePath);
 				paths.put(jarPath, type);
 			} else {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
index 92e3aad..8d61692 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
@@ -56,8 +56,6 @@
 import org.eclipse.jdt.internal.core.index.FileIndexLocation;
 import org.eclipse.jdt.internal.core.index.Index;
 import org.eclipse.jdt.internal.core.index.IndexLocation;
-import org.eclipse.jdt.internal.core.nd.indexer.Indexer;
-import org.eclipse.jdt.internal.core.nd.java.JavaIndex;
 import org.eclipse.jdt.internal.core.search.BasicSearchEngine;
 import org.eclipse.jdt.internal.core.search.PatternSearchJob;
 import org.eclipse.jdt.internal.core.search.processing.IJob;
@@ -75,9 +73,9 @@
 	private SimpleLookupTable indexes = new SimpleLookupTable();
 
 	/**
-	 * The new indexer
+	 * The new indexer is disabled, see bug 544898
 	 */
-	private Indexer indexer = Indexer.getInstance();
+//	private Indexer indexer = Indexer.getInstance();
 
 	/* need to save ? */
 	private boolean needToSave = false;
@@ -255,7 +253,8 @@
  * Creates an empty index at the given location, for the given container path, if none exist.
  */
 public synchronized void ensureIndexExists(IndexLocation indexLocation, IPath containerPath) {
-	this.indexer.makeWorkspacePathDirty(containerPath);
+	// New index is disabled, see bug 544898
+    // this.indexer.makeWorkspacePathDirty(containerPath);
 	SimpleLookupTable states = getIndexStates();
 	Object state = states.get(indexLocation);
 	if (state == null) {
@@ -567,7 +566,8 @@
  * Note: the actual operation is performed in background
  */
 public void indexAll(IProject project) {
-	this.indexer.makeDirty(project);
+	// New index is disabled, see bug 544898
+	// this.indexer.makeDirty(project);
 	if (JavaCore.getPlugin() == null) return;
 
 	try {
@@ -617,7 +617,8 @@
  * Note: the actual operation is performed in background
  */
 public void indexLibrary(IPath path, IProject requestingProject, URL indexURL, final boolean updateIndex) {
-	this.indexer.makeWorkspacePathDirty(path);
+	// New index is disabled, see bug 544898
+	// this.indexer.makeWorkspacePathDirty(path);
 	// requestingProject is no longer used to cancel jobs but leave it here just in case
 	IndexLocation indexFile = null;
 	boolean forceIndexUpdate = false;
@@ -673,7 +674,8 @@
  */
 public void indexSourceFolder(JavaProject javaProject, IPath sourceFolder, char[][] inclusionPatterns, char[][] exclusionPatterns) {
 	IProject project = javaProject.getProject();
-	this.indexer.makeWorkspacePathDirty(sourceFolder);
+	// New index is disabled, see bug 544898
+	// this.indexer.makeWorkspacePathDirty(sourceFolder);
 	if (this.jobEnd > this.jobStart) {
 		// skip it if a job to index the project is already in the queue
 		IndexRequest request = new IndexAllProject(project, this);
@@ -736,7 +738,8 @@
 	rebuildIndex(indexLocation, containerPath, false);
 }
 private void rebuildIndex(IndexLocation indexLocation, IPath containerPath, final boolean updateIndex) {
-	this.indexer.makeWorkspacePathDirty(containerPath);
+	// New index is disabled, see bug 544898
+	// this.indexer.makeWorkspacePathDirty(containerPath);
 	Object target = JavaModel.getTarget(containerPath, true);
 	if (target == null) return;
 
@@ -795,7 +798,8 @@
  * Note: the actual operation is performed in background
  */
 public void remove(String containerRelativePath, IPath indexedContainer){
-	this.indexer.makeWorkspacePathDirty(indexedContainer);
+	// New index is disabled, see bug 544898
+	// this.indexer.makeWorkspacePathDirty(indexedContainer);
 	request(new RemoveFromIndex(containerRelativePath, indexedContainer, this));
 }
 /**
@@ -805,7 +809,8 @@
 public synchronized void removeIndex(IPath containerPath) {
 	if (VERBOSE || DEBUG)
 		Util.verbose("removing index " + containerPath); //$NON-NLS-1$
-	this.indexer.makeWorkspacePathDirty(containerPath);
+	// New index is disabled, see bug 544898
+	// this.indexer.makeWorkspacePathDirty(containerPath);
 	IndexLocation indexLocation = computeIndexLocation(containerPath);
 	Index index = getIndex(indexLocation);
 	File indexFile = null;
@@ -835,7 +840,8 @@
 public synchronized void removeIndexPath(IPath path) {
 	if (VERBOSE || DEBUG)
 		Util.verbose("removing index path " + path); //$NON-NLS-1$
-	this.indexer.makeWorkspacePathDirty(path);
+	// New index is disabled, see bug 544898
+	// this.indexer.makeWorkspacePathDirty(path);
 	Object[] keyTable = this.indexes.keyTable;
 	Object[] valueTable = this.indexes.valueTable;
 	IndexLocation[] locations = null;
@@ -882,7 +888,8 @@
  * Removes all indexes whose paths start with (or are equal to) the given path.
  */
 public synchronized void removeIndexFamily(IPath path) {
-	this.indexer.makeWorkspacePathDirty(path);
+	// New index is disabled, see bug 544898
+	// this.indexer.makeWorkspacePathDirty(path);
 	// only finds cached index files... shutdown removes all non-cached index files
 	ArrayList toRemove = null;
 	Object[] containerPaths = this.indexLocations.keyTable;
@@ -903,7 +910,8 @@
  * Remove the content of the given source folder from the index.
  */
 public void removeSourceFolderFromIndex(JavaProject javaProject, IPath sourceFolder, char[][] inclusionPatterns, char[][] exclusionPatterns) {
-	this.indexer.makeWorkspacePathDirty(sourceFolder);
+	// New index is disabled, see bug 544898
+	// this.indexer.makeWorkspacePathDirty(sourceFolder);
 	IProject project = javaProject.getProject();
 	if (this.jobEnd > this.jobStart) {
 		// skip it if a job to index the project is already in the queue
@@ -1046,10 +1054,11 @@
 	this.needToSave = !allSaved;
 }
 public void scheduleDocumentIndexing(final SearchDocument searchDocument, IPath container, final IndexLocation indexLocation, final SearchParticipant searchParticipant) {
-	IPath targetLocation = JavaIndex.getLocationForPath(new Path(searchDocument.getPath()));
-	if (targetLocation != null) {
-		this.indexer.makeDirty(targetLocation);
-	}
+	// New index is disabled, see bug 544898
+//	IPath targetLocation = JavaIndex.getLocationForPath(new Path(searchDocument.getPath()));
+//	if (targetLocation != null) {
+//		 this.indexer.makeDirty(targetLocation);
+//	}
 	request(new IndexRequest(container, this) {
 		@Override
 		public boolean execute(IProgressMonitor progressMonitor) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java
index 25be604..49b343c 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java
@@ -42,7 +42,14 @@
     if (root.isArchive()) {
         IType type = (IType)this.localVariable.getAncestor(IJavaElement.TYPE);
         relativePath = (type.getFullyQualifiedName('$')).replace('.', '/') + SuffixConstants.SUFFIX_STRING_class;
-        documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
+        IModuleDescription md = root.getModuleDescription();
+        if(md != null) {
+        	String module = md.getElementName();
+				documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR 
+						+ module + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
+        } else {
+        	documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
+        }
     } else {
 		IPath path = this.localVariable.getPath();
         documentPath = path.toString();
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java
index c3539dc..e72e512 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java
@@ -19,6 +19,7 @@
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IMember;
 import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IModuleDescription;
 import org.eclipse.jdt.core.IPackageFragmentRoot;
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.ITypeParameter;
@@ -87,7 +88,14 @@
 	    if (root.isArchive()) {
  	    	IType type = (IType) this.typeParameter.getAncestor(IJavaElement.TYPE);
     	    relativePath = (type.getFullyQualifiedName('$')).replace('.', '/') + SuffixConstants.SUFFIX_STRING_class;
-	        documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
+    	    IModuleDescription md = root.getModuleDescription();
+            if(md != null) {
+            	String module = md.getElementName();
+            	documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR 
+            			+ module + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
+            } else {
+            	documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
+            }
 	    } else {
 			IPath path = this.typeParameter.getPath();
 	        documentPath = path.toString();