Update jdt.core to I20180725-2000 (towards 2018-09 M2)
diff --git a/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
index 9043095..055fbcd 100644
--- a/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.core.tests.compiler;singleton:=true
-Bundle-Version: 3.12.500.qualifier
+Bundle-Version: 3.12.600.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.jdt.core.tests.compiler,
diff --git a/org.eclipse.jdt.core.tests.compiler/about.html b/org.eclipse.jdt.core.tests.compiler/about.html
index 4602330..164f781 100644
--- a/org.eclipse.jdt.core.tests.compiler/about.html
+++ b/org.eclipse.jdt.core.tests.compiler/about.html
@@ -2,27 +2,35 @@
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
 <title>About</title>
 </head>
 <body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>June 2, 2006</p>	
-<h3>License</h3>
+	<h2>About This Content</h2>
 
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+	<p>November 30, 2017</p>
+	<h3>License</h3>
 
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content.  Check the Redistributor's license that was 
-provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+	<p>
+		The Eclipse Foundation makes available all content in this plug-in
+		(&quot;Content&quot;). Unless otherwise indicated below, the Content
+		is provided to you under the terms and conditions of the Eclipse
+		Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
+		available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
+		For purposes of the EPL, &quot;Program&quot; will mean the Content.
+	</p>
+
+	<p>
+		If you did not receive this Content directly from the Eclipse
+		Foundation, the Content is being redistributed by another party
+		(&quot;Redistributor&quot;) and different terms and conditions may
+		apply to your use of any object code in the Content. Check the
+		Redistributor's license that was provided with the Content. If no such
+		license exists, contact the Redistributor. Unless otherwise indicated
+		below, the terms and conditions of the EPL still apply to any source
+		code in the Content and such source code may be obtained at <a
+			href="http://www.eclipse.org/">http://www.eclipse.org</a>.
+	</p>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.compiler/pom.xml b/org.eclipse.jdt.core.tests.compiler/pom.xml
index 98e7a16..f9bdb5f 100644
--- a/org.eclipse.jdt.core.tests.compiler/pom.xml
+++ b/org.eclipse.jdt.core.tests.compiler/pom.xml
@@ -15,12 +15,12 @@
   <parent>
     <artifactId>tests-pom</artifactId>
     <groupId>eclipse.jdt.core</groupId>
-    <version>4.8.0-SNAPSHOT</version>
+    <version>4.9.0-SNAPSHOT</version>
     <relativePath>../tests-pom/</relativePath>
   </parent>
   <groupId>org.eclipse.jdt</groupId>
   <artifactId>org.eclipse.jdt.core.tests.compiler</artifactId>
-  <version>3.12.500-SNAPSHOT</version>
+  <version>3.12.600-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <properties>
@@ -75,6 +75,37 @@
 			<tycho.surefire.argLine>--add-modules ALL-SYSTEM</tycho.surefire.argLine>
 		</properties>
 	</profile>
+	<profile>
+		<id>test-on-javase-10</id>
+		<build>
+			<plugins>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-toolchains-plugin</artifactId>
+					<version>1.1</version>
+					<executions>
+						<execution>
+							<phase>validate</phase>
+							<goals>
+								<goal>toolchain</goal>
+							</goals>
+						</execution>
+					</executions>
+					<configuration>
+						<toolchains>
+							<jdk>
+								<id>JavaSE-10</id>
+							</jdk>
+						</toolchains>
+					</configuration>
+				</plugin>
+			</plugins>
+		</build>
+		<properties>
+			<!-- Overridden in https://ci.eclipse.org/jdt/job/eclipse.jdt.core-run.javac-10/configure  -->
+			<tycho.surefire.argLine>--add-modules ALL-SYSTEM -Dcompliance=1.4,1.7,1.8,10</tycho.surefire.argLine>
+		</properties>
+	</profile>
   </profiles>
 
 </project>
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/RunCompletionParserTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/RunCompletionParserTests.java
index 0ae8f4d..c48f0f6 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/RunCompletionParserTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/RunCompletionParserTests.java
@@ -122,7 +122,28 @@
 			TestCase.RUN_ONLY_ID = null;
 			all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.JDK1_8, tests_1_8));
 		}
-
+		if ((possibleComplianceLevels & AbstractCompilerTest.F_9) != 0) {
+			ArrayList tests_9 = (ArrayList)testClasses.clone();
+			tests_9.addAll(TEST_CLASSES_1_5);
+			// Reset forgotten subsets tests
+			TestCase.TESTS_PREFIX = null;
+			TestCase.TESTS_NAMES = null;
+			TestCase.TESTS_NUMBERS= null;
+			TestCase.TESTS_RANGE = null;
+			TestCase.RUN_ONLY_ID = null;
+			all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.JDK9, tests_9));
+		}
+		if ((possibleComplianceLevels & AbstractCompilerTest.F_10) != 0) {
+			ArrayList tests_10 = (ArrayList)testClasses.clone();
+			tests_10.addAll(TEST_CLASSES_1_5);
+			// Reset forgotten subsets tests
+			TestCase.TESTS_PREFIX = null;
+			TestCase.TESTS_NAMES = null;
+			TestCase.TESTS_NUMBERS= null;
+			TestCase.TESTS_RANGE = null;
+			TestCase.RUN_ONLY_ID = null;
+			all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.JDK10, tests_10));
+		}
 		return all;
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java
index 92a0fec..5cd6983 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java
@@ -158,7 +158,7 @@
 		TestCase.TESTS_NUMBERS= null;
 		TestCase.TESTS_RANGE = null;
 		TestCase.RUN_ONLY_ID = null;
-		all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.JDK9, tests_10));
+		all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.JDK10, tests_10));
 	}
 	return all;
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java
index bb9772a..6150326 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java
@@ -16,6 +16,8 @@
 
 import java.util.Map;
 import junit.framework.Test;
+
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
 import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
 
 @SuppressWarnings({ "unchecked", "rawtypes" })
@@ -86,4 +88,10 @@
 		options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.WARNING);
 		return options;
 	}
+	
+	protected String intersection(String... types) {
+		if (this.complianceLevel >= ClassFileConstants.JDK1_8)
+			return String.join(" & ", types);
+		return String.join("&", types);
+	}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
index f735b2f..5e0f12a 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
@@ -30,6 +30,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.net.URL;
 import java.text.MessageFormat;
@@ -358,15 +359,26 @@
 			if ("9.0.1".equals(rawVersion)) {
 				return 0100;
 			}
+			if ("9.0.4".equals(rawVersion)) {
+				return 0400;
+			}
 		}
 		if (version == JavaCore.VERSION_10) {
-			return 0000; // We are still in EA
+			if ("10.0.0".equals(rawVersion)) {
+				return 0000;
+			}
+			if ("10.0.1".equals(rawVersion)) {
+				return 0100;
+			}
 		}
 		throw new RuntimeException("unknown raw javac version: " + rawVersion);
 	}
 	// returns 0L if everything went fine; else the lower word contains the
 	// exit value and the upper word is non-zero iff the error log has contents
 	long compile(File directory, String options, String[] sourceFileNames, StringBuffer log) throws IOException, InterruptedException {
+		return compile(directory, options, sourceFileNames, log, true);
+	}
+	long compile(File directory, String options, String[] sourceFileNames, StringBuffer log, boolean extendCommandLine) throws IOException, InterruptedException {
 		Process compileProcess = null;
 		long result = 0L;
 		// WORK classpath should depend on the compiler, not on the default runtime
@@ -378,9 +390,11 @@
 			cmdLine.append(this.classpath);
 			cmdLine.append(". ");
 			cmdLine.append(options);
-			for (int i = 0; i < sourceFileNames.length; i ++) {
-				cmdLine.append(' ');
-				cmdLine.append(sourceFileNames[i]);
+			if (extendCommandLine) {
+				for (int i = 0; i < sourceFileNames.length; i ++) {
+					cmdLine.append(' ');
+					cmdLine.append(sourceFileNames[i]);
+				}
 			}
 			String cmdLineAsString;
 			// WORK improve double-quotes management on Linux
@@ -471,7 +485,7 @@
 	};
 	@java.lang.SuppressWarnings("synthetic-access")
 	static JavacTestOptions forRelease(String release) {
-		JavacTestOptions options = new JavacTestOptions();
+		JavacTestOptions options = new JavacTestOptions(Long.parseLong(release));
 		if (isJRE9Plus)
 			options.setCompilerOptions("-release "+release);
 		else
@@ -493,12 +507,16 @@
 			return true;
 		}
 	};
+	long minJavacCompliance = 0;
 	private String compilerOptions = "";
 	public JavacTestOptions() {
 	}
 	public JavacTestOptions(String compilerOptions) {
 		this.compilerOptions = compilerOptions;
 	}
+	public JavacTestOptions(long compliance) {
+		this.minJavacCompliance = compliance;
+	}
 	String getCompilerOptions() {
 		return this.compilerOptions;
 	}
@@ -506,6 +524,8 @@
 		this.compilerOptions = options;
 	}
 	boolean skip(JavacCompiler compiler) {
+		if (this.minJavacCompliance > 0)
+			return compiler.compliance < this.minJavacCompliance;
 		return false;
 	}
 	static class MismatchType {
@@ -521,6 +541,7 @@
 		static final int JavacNotLaunched = 0x0200;
 		static final int JavaAborted = 0x0400;
 		static final int JavaNotLaunched = 0x0800;
+		static final int CompileErrorMismatch = 0x1000;
 	}
 	public static class Excuse extends JavacTestOptions {
 		protected int mismatchType;
@@ -834,7 +855,11 @@
 			JavacBug8033810 = RUN_JAVAC ? // https://bugs.openjdk.java.net/browse/JDK-8033810
 				new JavacHasABug(MismatchType.EclipseErrorsJavacNone) : null,
 			JavacBug8144673 = RUN_JAVAC ? // https://bugs.openjdk.java.net/browse/JDK-8144673
-				new JavacHasABug(MismatchType.JavacErrorsEclipseNone, ClassFileConstants.JDK9, 0100) : null;
+				new JavacHasABug(MismatchType.JavacErrorsEclipseNone, ClassFileConstants.JDK9, 0100) : null,
+			JavacBug8204534 = RUN_JAVAC ? // https://bugs.openjdk.java.net/browse/JDK-8204534
+				new JavacHasABug(MismatchType.EclipseErrorsJavacNone, ((long)55)<<16, 0000) : null, // FIXME: use JDK11
+			JavacBug8207032 = RUN_JAVAC ? // https://bugs.openjdk.java.net/browse/JDK-8207032
+				new JavacHasABug(MismatchType.EclipseErrorsJavacNone) : null;
 
 		// bugs that have been fixed but that we've not identified
 		public static JavacHasABug
@@ -960,8 +985,10 @@
 	protected void checkClassFile(String className, String source, String expectedOutput, int mode) throws ClassFormatException, IOException {
 		this.checkClassFile("", className, source, expectedOutput, mode);
 	}
-	protected void checkClassFile(String directoryName, String className, String disassembledClassName, String source, String expectedOutput, int mode) throws ClassFormatException, IOException {
-		compileAndDeploy(source, directoryName, className);
+	protected void checkClassFile(String directoryName, String className, String disassembledClassName, String source, String expectedOutput,
+			int mode, boolean suppressConsole) throws ClassFormatException, IOException
+	{
+		compileAndDeploy(source, directoryName, className, suppressConsole);
 		try {
 			File directory = new File(EVAL_DIRECTORY, directoryName);
 			if (!directory.exists()) {
@@ -1003,11 +1030,11 @@
 	}
 
 	protected void checkClassFile(String directoryName, String className, String source, String expectedOutput, int mode) throws ClassFormatException, IOException {
-		this.checkClassFile(directoryName, className, className, source, expectedOutput, mode);
+		this.checkClassFile(directoryName, className, className, source, expectedOutput, mode, false);
 	}
 
 	protected ClassFileReader getInternalClassFile(String directoryName, String className, String disassembledClassName, String source) throws ClassFormatException, IOException {
-		compileAndDeploy(source, directoryName, className);
+		compileAndDeploy(source, directoryName, className, false);
 		try {
 			File directory = new File(EVAL_DIRECTORY, directoryName);
 			if (!directory.exists()) {
@@ -1080,7 +1107,7 @@
 		}
 	}
 
-	protected void compileAndDeploy(String source, String directoryName, String className) {
+	protected void compileAndDeploy(String source, String directoryName, String className, boolean suppressConsole) {
 		File directory = new File(SOURCE_DIRECTORY);
 		if (!directory.exists()) {
 			if (!directory.mkdirs()) {
@@ -1133,7 +1160,17 @@
 			.append(Util.getJavaClassLibsAsString())
 			.append(SOURCE_DIRECTORY)
 			.append("\"");
-		BatchCompiler.compile(buffer.toString(), new PrintWriter(System.out), new PrintWriter(System.err), null/*progress*/);
+		OutputStream out = System.out;
+		OutputStream err = System.err;
+		if (suppressConsole) {
+			out = err = new OutputStream() {
+				@Override
+				public void write(int b) {
+					// silently swallow
+				}
+			};
+		}
+		BatchCompiler.compile(buffer.toString(), new PrintWriter(out), new PrintWriter(err), null/*progress*/);
 	}
 
 	/*
@@ -2220,63 +2257,72 @@
 				e.printStackTrace();
 				mismatch = JavacTestOptions.MismatchType.JavaNotLaunched;
 			}
-			if (mismatch != 0) {
-				if (excuse != null && excuse.clears(mismatch)) {
-					excuse = null;
-				} else {
-					System.err.println("----------------------------------------");
-					logTestFiles(true, testFiles);
-					switch (mismatch) {
-						case JavacTestOptions.MismatchType.EclipseErrorsJavacNone:
-							assertEquals(testName + " - Eclipse found error(s) but Javac did not find any",
-									"", expectedCompilerLog.toString());
-							break;
-						case JavacTestOptions.MismatchType.EclipseErrorsJavacWarnings:
-							assertEquals(testName + " - Eclipse found error(s) but Javac only found warning(s)",
-									expectedCompilerLog.toString(),	compilerLog.toString());
-							break;
-						case JavacTestOptions.MismatchType.JavacErrorsEclipseNone:
-							assertEquals(testName + " - Javac found error(s) but Eclipse did not find any",
-									"", compilerLog.toString());
-							break;
-						case JavacTestOptions.MismatchType.JavacErrorsEclipseWarnings:
-							assertEquals(testName + " - Javac found error(s) but Eclipse only found warning(s)",
-									expectedCompilerLog.toString(),	compilerLog.toString());
-							break;
-						case JavacTestOptions.MismatchType.EclipseWarningsJavacNone:
-							assertEquals(testName + " - Eclipse found warning(s) but Javac did not find any",
-									"", expectedCompilerLog.toString());
-							break;
-						case JavacTestOptions.MismatchType.JavacWarningsEclipseNone:
-							assertEquals(testName + " - Javac found warning(s) but Eclipse did not find any",
-									"", compilerLog.toString());
-							break;
-						case JavacTestOptions.MismatchType.StandardOutputMismatch:
-							assertEquals(testName + " - Eclipse/Javac standard output mismatch",
-									expectedOutputString, output);
-							break;
-						case JavacTestOptions.MismatchType.ErrorOutputMismatch:
-							assertEquals(testName + " - Eclipse/Javac standard error mismatch",
-									expectedErrorString, err);
-							break;
-						case JavacTestOptions.MismatchType.JavacAborted:
-						case JavacTestOptions.MismatchType.JavacNotLaunched:
-							fail(testName + " - Javac failure");
-							break;
-						case JavacTestOptions.MismatchType.JavaAborted:
-						case JavacTestOptions.MismatchType.JavaNotLaunched:
-							fail(testName + " - Java failure");
-							break;
-						default:
-							throw new RuntimeException("unexpected mismatch value: " + mismatch);
-					}
-				}
-			}
-			if (excuse != null) {
-				fail(testName + ": unused excuse " + excuse + " for compiler " + compiler);
+			handleMismatch(compiler, testName, testFiles, expectedCompilerLog, expectedOutputString,
+					expectedErrorString, compilerLog, output, err, excuse, mismatch);
+		}
+	}
+}
+void handleMismatch(JavacCompiler compiler, String testName, String[] testFiles, String expectedCompilerLog,
+		String expectedOutputString, String expectedErrorString, StringBuffer compilerLog, String output, String err,
+		JavacTestOptions.Excuse excuse, int mismatch) {
+	if (mismatch != 0) {
+		if (excuse != null && excuse.clears(mismatch)) {
+			excuse = null;
+		} else {
+			System.err.println("----------------------------------------");
+			logTestFiles(true, testFiles);
+			switch (mismatch) {
+				case JavacTestOptions.MismatchType.EclipseErrorsJavacNone:
+					assertEquals(testName + " - Eclipse found error(s) but Javac did not find any",
+							"", expectedCompilerLog.toString());
+					break;
+				case JavacTestOptions.MismatchType.EclipseErrorsJavacWarnings:
+					assertEquals(testName + " - Eclipse found error(s) but Javac only found warning(s)",
+							expectedCompilerLog.toString(),	compilerLog.toString());
+					break;
+				case JavacTestOptions.MismatchType.JavacErrorsEclipseNone:
+					assertEquals(testName + " - Javac found error(s) but Eclipse did not find any",
+							"", compilerLog.toString());
+					break;
+				case JavacTestOptions.MismatchType.JavacErrorsEclipseWarnings:
+					assertEquals(testName + " - Javac found error(s) but Eclipse only found warning(s)",
+							expectedCompilerLog.toString(),	compilerLog.toString());
+					break;
+				case JavacTestOptions.MismatchType.EclipseWarningsJavacNone:
+					assertEquals(testName + " - Eclipse found warning(s) but Javac did not find any",
+							"", expectedCompilerLog.toString());
+					break;
+				case JavacTestOptions.MismatchType.JavacWarningsEclipseNone:
+					assertEquals(testName + " - Javac found warning(s) but Eclipse did not find any",
+							"", compilerLog.toString());
+					break;
+				case JavacTestOptions.MismatchType.StandardOutputMismatch:
+					assertEquals(testName + " - Eclipse/Javac standard output mismatch",
+							expectedOutputString, output);
+					break;
+				case JavacTestOptions.MismatchType.ErrorOutputMismatch:
+					assertEquals(testName + " - Eclipse/Javac standard error mismatch",
+							expectedErrorString, err);
+					break;
+				case JavacTestOptions.MismatchType.JavacAborted:
+				case JavacTestOptions.MismatchType.JavacNotLaunched:
+					fail(testName + " - Javac failure");
+					break;
+				case JavacTestOptions.MismatchType.JavaAborted:
+				case JavacTestOptions.MismatchType.JavaNotLaunched:
+					fail(testName + " - Java failure");
+					break;
+				case JavacTestOptions.MismatchType.CompileErrorMismatch:
+					fail(testName + " Javac failure did not match \"" + expectedCompilerLog +'\"');
+					break;
+				default:
+					throw new RuntimeException("unexpected mismatch value: " + mismatch);
 			}
 		}
 	}
+	if (excuse != null) {
+		fail(testName + ": unused excuse " + excuse + " for compiler " + compiler);
+	}
 }
 
 private String adjustErrorOutput(String error) {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_4.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_4.java
index cf697b1..c7d5817 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_4.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_4.java
@@ -2772,7 +2772,7 @@
 			"}";
 		String expectedOutput =
 			"private static class p.X$A {\n";
-		checkClassFile("p", "X", "X$A", source, expectedOutput, ClassFileBytesDisassembler.DETAILED | ClassFileBytesDisassembler.COMPACT);
+		checkClassFile("p", "X", "X$A", source, expectedOutput, ClassFileBytesDisassembler.DETAILED | ClassFileBytesDisassembler.COMPACT, false);
 	}
 
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102473
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java
index 867e61d..eb61d46 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -46,7 +46,7 @@
 	 * @deprecated
 	 */
 	private void checkClassFileUsingInputStream(String directoryName, String className, String source, String expectedOutput, int mode) throws IOException {
-		compileAndDeploy(source, directoryName, className);
+		compileAndDeploy(source, directoryName, className, false);
 		BufferedInputStream inputStream = null;
 		try {
 			File directory = new File(EVAL_DIRECTORY, directoryName);
@@ -613,7 +613,7 @@
 				"    )\n" + 
 				"}";
 		int mode = ClassFileBytesDisassembler.DETAILED | ClassFileBytesDisassembler.COMPACT | ClassFileBytesDisassembler.SYSTEM;
-		checkClassFile("test", "AllTests", source, expectedOutput, mode);
+		checkClassFile("test", "AllTests", "AllTests", source, expectedOutput, mode, true/*suppress expected errors*/);
 	}
 
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
index 2b46cee..e00c0a0 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
@@ -873,6 +873,51 @@
 			this.javaClassLib = save;
 		}
 	}
+	public void testBug534304() throws Exception {
+		runNegativeTest(
+			new String[] {
+				"p1/C1.java",
+				"package p1;\n" + 
+				"\n" + 
+				"import pdep.Dep1;\n" + 
+				"\n" + 
+				"public class C1 {\n" + 
+				"	Dep1 f;\n" + 
+				"}\n",
+				"pdep/Dep1.java",
+				"package pdep;\n" + 
+				"\n" + 
+				"import pmissing.CMissing;\n" + 
+				"\n" + 
+				"@Deprecated(since=\"13\")\n" + 
+				"@CMissing\n" + 
+				"public class Dep1 {\n" + 
+				"\n" + 
+				"}\n"
+			}, 
+			"----------\n" + 
+			"1. WARNING in p1\\C1.java (at line 3)\n" + 
+			"	import pdep.Dep1;\n" + 
+			"	       ^^^^^^^^^\n" + 
+			"The type Dep1 is deprecated since version 13\n" + 
+			"----------\n" + 
+			"2. WARNING in p1\\C1.java (at line 6)\n" + 
+			"	Dep1 f;\n" + 
+			"	^^^^\n" + 
+			"The type Dep1 is deprecated since version 13\n" + 
+			"----------\n" + 
+			"----------\n" + 
+			"1. ERROR in pdep\\Dep1.java (at line 3)\n" + 
+			"	import pmissing.CMissing;\n" + 
+			"	       ^^^^^^^^\n" + 
+			"The import pmissing cannot be resolved\n" + 
+			"----------\n" + 
+			"2. ERROR in pdep\\Dep1.java (at line 6)\n" + 
+			"	@CMissing\n" + 
+			"	 ^^^^^^^^\n" + 
+			"CMissing cannot be resolved to a type\n" + 
+			"----------\n");
+	}
 	public static Class<?> testClass() {
 		return Deprecated9Test.class;
 	}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java
index e54e3db..03e4a38 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2016 GK Software AG and others.
+ * Copyright (c) 2013, 2018 GK Software AG and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -405,4 +405,173 @@
 		true /*flush*/,
 		getCompilerOptions());
 }
+public void testBug535308a() {
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR);
+	runner.testFiles =
+			new String[] {
+				 "X.java",
+				 "public class X {\n" + 
+				 "	public int someTest() {\n" +
+				 "		boolean unused = false;\n" + 
+				 "		final boolean thisIsFalse = false;\n" + 
+				 "		if (getSomeValue() == thisIsFalse) {\n" + 
+				 "			return 0;\n" + 
+				 "		}\n" + 
+				 "		return 1;\n" + 
+				 "	}\n" + 
+				 "	private boolean getSomeValue() {\n" + 
+				 "		return true;\n" + 
+				 "	}\n" + 
+				 "}"
+			};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 3)\n" + 
+			"	boolean unused = false;\n" + 
+			"	        ^^^^^^\n" + 
+			"The value of the local variable unused is not used\n" + 
+			"----------\n";
+	runner.classLibraries =
+			this.LIBS;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
+}
+public void testBug535308b() {
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR);
+	runner.testFiles =
+			new String[] {
+				 "X.java",
+				 "public class X {\n" + 
+				 "	public int someTest() {\n" +
+				 "		boolean unused = false;\n" + 
+				 "		final boolean thisIsFalse = false;\n" + 
+				 "		if (getSomeValue() != thisIsFalse) {\n" + 
+				 "			return 0;\n" + 
+				 "		}\n" + 
+				 "		return 1;\n" + 
+				 "	}\n" + 
+				 "\n" + 
+				 "	private boolean getSomeValue() {\n" + 
+				 "		return true;\n" + 
+				 "	}\n" + 
+				 "}"
+			};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 3)\n" + 
+			"	boolean unused = false;\n" + 
+			"	        ^^^^^^\n" + 
+			"The value of the local variable unused is not used\n" + 
+			"----------\n";
+	runner.classLibraries =
+			this.LIBS;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
+}
+public void testBug535308c() {
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR);
+	runner.testFiles =
+			new String[] {
+				 "X.java",
+				 "public class X {\n" + 
+				 "	public int someTest() {\n" +
+				 "		boolean unused = false;\n" + 
+				 "		final boolean thisIsFalse = false;\n" + 
+				 "		if (thisIsFalse != getSomeValue()) {\n" + 
+				 "			return 0;\n" + 
+				 "		}\n" + 
+				 "		return 1;\n" + 
+				 "	}\n" + 
+				 "\n" + 
+				 "	private boolean getSomeValue() {\n" + 
+				 "		return true;\n" + 
+				 "	}\n" + 
+				 "}"
+			};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 3)\n" + 
+			"	boolean unused = false;\n" + 
+			"	        ^^^^^^\n" + 
+			"The value of the local variable unused is not used\n" + 
+			"----------\n";
+	runner.classLibraries =
+			this.LIBS;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
+}
+public void testBug535308d() {
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR);
+	runner.testFiles =
+			new String[] {
+				 "X.java",
+				 "public class X {\n" + 
+				 "	public int someTest() {\n" +
+				 "		boolean unused = false;\n" + 
+				 "		final boolean thisIsFalse = false;\n" + 
+				 "		if (thisIsFalse == getSomeValue()) {\n" + 
+				 "			return 0;\n" + 
+				 "		}\n" + 
+				 "		return 1;\n" + 
+				 "	}\n" + 
+				 "\n" + 
+				 "	private boolean getSomeValue() {\n" + 
+				 "		return true;\n" + 
+				 "	}\n" + 
+				 "}"
+			};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 3)\n" + 
+			"	boolean unused = false;\n" + 
+			"	        ^^^^^^\n" + 
+			"The value of the local variable unused is not used\n" + 
+			"----------\n";
+	runner.classLibraries =
+			this.LIBS;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
+}
+public void testBug535308e() {
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR);
+	runner.testFiles =
+			new String[] {
+				 "X.java",
+				 "public class X {\n" + 
+				 "	public int someTest() {\n" +
+				 "		boolean used = false;\n" + 
+				 "		final boolean thisIsFalse = false;\n" + 
+				 "		if (used == getSomeValue()) {\n" + 
+				 "			return 0;\n" + 
+				 "		}\n" + 
+				 "		return 1;\n" + 
+				 "	}\n" + 
+				 "\n" + 
+				 "	private boolean getSomeValue() {\n" + 
+				 "		return true;\n" + 
+				 "	}\n" + 
+				 "}"
+			};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in X.java (at line 4)\n" + 
+			"	final boolean thisIsFalse = false;\n" + 
+			"	              ^^^^^^^^^^^\n" + 
+			"The value of the local variable thisIsFalse is not used\n" + 
+			"----------\n";
+			runner.classLibraries =
+			this.LIBS;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
+}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
index 83ec547..4d0ff91 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
@@ -14452,12 +14452,12 @@
 			"3. ERROR in X.java (at line 12)\n" +
 			"	Cloneable s4 = choose(true, Integer.valueOf(1), Float.valueOf(2));\n" +
 			"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
-			"Type mismatch: cannot convert from Number&Comparable<?> to Cloneable\n" +
+			"Type mismatch: cannot convert from "+intersection("Number","Comparable<?>")+" to Cloneable\n" +
 			"----------\n" +
 			"4. ERROR in X.java (at line 13)\n" +
 			"	Cloneable s5 = choose(true, \"string\", Integer.valueOf(1));\n" +
 			"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
-			"Type mismatch: cannot convert from Object&Serializable&Comparable<?> to Cloneable\n" +
+			"Type mismatch: cannot convert from "+intersection("Object","Serializable","Comparable<?>")+" to Cloneable\n" +
 			"----------\n");
 	}
 
@@ -19774,7 +19774,7 @@
     		"1. ERROR in X.java (at line 9)\n" +
     		"	String s = foo(l1, l2);\n" +
     		"	           ^^^^^^^^^^^\n" +
-    		"Type mismatch: cannot convert from List<capture#2-of ? extends Object&Serializable&Comparable<?>> to String\n" +
+    		"Type mismatch: cannot convert from List<capture#2-of ? extends "+intersection("Object","Serializable","Comparable<?>")+"> to String\n" +
     		"----------\n");
 	}
 	// check capture for conditional operator
@@ -19806,7 +19806,7 @@
 	    			"1. ERROR in X.java (at line 10)\n" + 
 	    			"	String s = l1 != null ? foo(l1, l2) : l3;\n" + 
 		    		"	                        ^^^^^^^^^^^\n" +
-		    		"Type mismatch: cannot convert from List<capture#2-of ? extends Number&Comparable<?>> to String\n" +
+		    		"Type mismatch: cannot convert from List<capture#2-of ? extends Number & Comparable<?>> to String\n" +
 	    			"----------\n");
 	}
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92556
@@ -24038,7 +24038,7 @@
 		"1. ERROR in X.java (at line 3)\n" +
 		"	String s = java.util.Arrays.asList(3, 3.1);\n" +
 		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
-		"Type mismatch: cannot convert from List<Number&Comparable<?>> to String\n" +
+		"Type mismatch: cannot convert from List<"+intersection("Number","Comparable<?>")+"> to String\n" +
 		"----------\n",
 		null,
 		true,
@@ -26055,7 +26055,7 @@
 		"2. ERROR in X.java (at line 14)\n" +
 		"	String s2 = foo(integers, floats);\n" +
 		"	            ^^^^^^^^^^^^^^^^^^^^^\n" +
-		"Type mismatch: cannot convert from Number&Comparable<? extends Number&Comparable<?>>[] to String\n" +
+		"Type mismatch: cannot convert from "+intersection("Number","Comparable<? extends "+intersection("Number","Comparable<?>")+">[]")+" to String\n" +
 		"----------\n");
 }
 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107079
@@ -27575,7 +27575,7 @@
 		"1. ERROR in X.java (at line 12)\n" +
 		"	List<? extends String> result2 = merge(list1, list2);\n" +
 		"	                                 ^^^^^^^^^^^^^^^^^^^\n" +
-		"Type mismatch: cannot convert from List<Object&Serializable&CharSequence> to List<? extends String>\n" +
+		"Type mismatch: cannot convert from List<"+intersection("Object","Serializable","CharSequence")+"> to List<? extends String>\n" +
 		"----------\n");
 }
 public void test0843() {
@@ -27601,17 +27601,17 @@
 		"1. WARNING in X.java (at line 11)\n" +
 		"	Object result3 = (List<? extends CharSequence>)merge(list1, list2);\n" +
 		"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
-		"Unnecessary cast from List<Object&Serializable&CharSequence> to List<? extends CharSequence>\n" +
+		"Unnecessary cast from List<"+intersection("Object","Serializable","CharSequence")+"> to List<? extends CharSequence>\n" +
 		"----------\n" +
 		"2. ERROR in X.java (at line 12)\n" +
 		"	Object result4 = (List<? extends String>)merge(list1, list2);\n" +
 		"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
-		"Cannot cast from List<Object&Serializable&CharSequence> to List<? extends String>\n" +
+		"Cannot cast from List<"+intersection("Object","Serializable","CharSequence")+"> to List<? extends String>\n" +
 		"----------\n" +
 		"3. WARNING in X.java (at line 12)\n" +
 		"	Object result4 = (List<? extends String>)merge(list1, list2);\n" +
 		"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
-		"Unnecessary cast from List<Object&Serializable&CharSequence> to List<? extends String>\n" +
+		"Unnecessary cast from List<"+intersection("Object","Serializable","CharSequence")+"> to List<? extends String>\n" +
 		"----------\n");
 }
 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112595
@@ -29249,7 +29249,7 @@
 		"1. ERROR in X.java (at line 5)\n" +
 		"	Object oc1 = m1(c2, c3).new C1Member();\n" +
 		"	                            ^^^^^^^^\n" +
-		"X.C1&X.I1.C1Member cannot be resolved to a type\n" +
+		intersection("X.C1","X.I1.C1Member")+" cannot be resolved to a type\n" +
 		"----------\n");
 }
 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=126177
@@ -29613,14 +29613,8 @@
 		"----------\n" +
 		"1. ERROR in X.java (at line 6)\n" +
 		"	return foo(i, f);\n" +
-		(this.complianceLevel < ClassFileConstants.JDK1_8
-		?
 		"	       ^^^^^^^^^\n" +
-		"Type mismatch: cannot convert from Object&Serializable&Cloneable to Object[]\n"
-		:
-		"	       ^^^\n" +
-		"The method foo(T, T) in the type X is not applicable for the arguments (int[], float[])\n"
-		)+
+		"Type mismatch: cannot convert from "+intersection("Object","Serializable","Cloneable")+" to Object[]\n" +
 		"----------\n",
 		// javac options
 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
@@ -32918,7 +32912,7 @@
 			"1. ERROR in X.java (at line 4)\n" +
 			"	List<Class<Object>>  lco = Arrays.asList(String.class, Integer.class, Long.class);\n" +
 			"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
-			"Type mismatch: cannot convert from List<Class<? extends Object&Serializable&Comparable<?>>> to List<Class<Object>>\n" +
+			"Type mismatch: cannot convert from List<Class<? extends "+intersection("Object","Serializable","Comparable<?>")+">> to List<Class<Object>>\n" +
 			"----------\n",
 			null,
 			true,
@@ -41047,7 +41041,7 @@
 		"1. ERROR in X.java (at line 4)\n" +
 		"	(b ? x1 : x2).field = x1.field;\n" +
 		"	                      ^^^^^^^^\n" +
-		"Type mismatch: cannot convert from Integer to capture#1-of ? extends Number&Comparable<?>\n" +
+		"Type mismatch: cannot convert from Integer to capture#1-of ? extends "+intersection("Number","Comparable<?>")+"\n" +
 		"----------\n");
 }
 public void test1174() {
@@ -41065,7 +41059,7 @@
 		"1. ERROR in X.java (at line 4)\n" +
 		"	(b ? x1 : x2).field = (b ? x1 : x2).field;\n" +
 		"	                      ^^^^^^^^^^^^^^^^^^^\n" +
-		"Type mismatch: cannot convert from capture#2-of ? extends Number&Comparable<?> to capture#1-of ? extends Number&Comparable<?>\n" +
+		"Type mismatch: cannot convert from capture#2-of ? extends "+intersection("Number","Comparable<?>")+" to capture#1-of ? extends "+intersection("Number","Comparable<?>")+"\n" +
 		"----------\n");
 }
 public void test1175() {
@@ -47018,7 +47012,7 @@
 			"1. ERROR in X.java (at line 6)\n" +
 			"	foo((Collection<Number>) Arrays.asList(i, d));\n" +
 			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
-			"Cannot cast from List<Number&Comparable<?>> to Collection<Number>\n" +
+			"Cannot cast from List<"+intersection("Number","Comparable<?>")+"> to Collection<Number>\n" +
 			"----------\n",
 			null,
 			true,
@@ -47779,7 +47773,7 @@
 			"1. ERROR in X.java (at line 7)\n" + 
 			"	int i = getValue(0, s);\n" + 
 			"	        ^^^^^^^^^^^^^^\n" + 
-			"Type mismatch: cannot convert from Comparable<capture#1-of ? extends Object&Comparable<?>&Serializable> to int\n" + 
+			"Type mismatch: cannot convert from Comparable<capture#1-of ? extends "+intersection("Object","Comparable<?>","Serializable")+"> to int\n" + 
 			"----------\n");
 }
 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=239225
@@ -50638,7 +50632,7 @@
 			"1. ERROR in X.java (at line 4)\n" + 
 			"	(x1 != null ? x1 : x2).bar(new Object());\n" + 
 			"	                       ^^^\n" + 
-			"The method bar(capture#4-of ? extends Object&Serializable&Comparable<? extends Object&Serializable&Comparable<?>>) in the type X<capture#4-of ? extends Object&Serializable&Comparable<? extends Object&Serializable&Comparable<?>>> is not applicable for the arguments (Object)\n" + 
+			"The method bar(capture#4-of ? extends "+intersection("Object","Serializable","Comparable<? extends "+intersection("Object","Serializable","Comparable<?>")+">")+") in the type X<capture#4-of ? extends "+intersection("Object","Serializable","Comparable<? extends "+intersection("Object","Serializable","Comparable<?>")+">")+"> is not applicable for the arguments (Object)\n" + 
 			"----------\n");
 }
 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=221253
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 8eb270a..cc88649 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
@@ -11,6 +11,7 @@
  *******************************************************************************/
 package org.eclipse.jdt.core.tests.compiler.regression;
 
+import java.util.HashMap;
 import java.util.Map;
 
 import org.eclipse.jdt.core.JavaCore;
@@ -8982,4 +8983,442 @@
 				"}"
 			});
 	}
+	public void testBug535969() {
+		runConformTest(
+			new String[] {
+				"Test.java",
+				"import java.util.List;\n" + 
+				"import java.util.stream.Collectors;\n" + 
+				"import java.util.stream.Stream;\n" + 
+				"\n" + 
+				"public class Test {\n" + 
+				"	public static void main(String[] args) {\n" + 
+				"		List<String> strings = Stream.of(1, 2, 3).map(i -> {\n" + 
+				"			return new Object() {\n" + 
+				"				final Integer myInt = i;\n" + 
+				"			};\n" + 
+				"		}).map(o -> {\n" + 
+				"			return o.myInt.toString();\n" + 
+				"		}).collect(Collectors.toList());\n" + 
+				"	}\n" + 
+				"}\n"
+			});
+	}
+	public void testBug535969b() {
+		runConformTest(
+			new String[] {
+				"B.java",
+				"\n" + 
+				"import java.util.Optional;\n" + 
+				"import java.util.function.Supplier;\n" +
+				"import java.io.Serializable;\n" + 
+				"\n" + 
+				"public class B {\n" + 
+				"    public static void main(String[] args) {\n" + 
+				"\n" + 
+				"        // This works fine:\n" + 
+				"        System.out.println(new Object() {\n" + 
+				"            int j = 5;\n" + 
+				"        }.j);\n" + 
+				"\n" + 
+				"        // This also\n" + 
+				"        System.out.println(trace(new Object() {\n" + 
+				"            int j = 5;\n" + 
+				"        }).j);\n" + 
+				"\n" + 
+				"        // Also no problem\n" + 
+				"        System.out.println(unwrapAndTrace(Optional.of(new Object() {\n" + 
+				"            int j = 5;\n" + 
+				"        })).j);\n" + 
+				"\n" + 
+				"        // Lambdas work:\n" + 
+				"        System.out.println(((Supplier & Serializable) () -> new Object()).get()); \n" + 
+				"\n" + 
+				"        // This doesn't work.\n" + 
+				"        System.out.println(invokeAndTrace(() -> new Object() {\n" + 
+				"            int j = 5;\n" + 
+				"        }).j);\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public static <T> T trace(T obj) {\n" + 
+				"        System.out.println(obj);\n" + 
+				"        return obj;\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public static <T> T invokeAndTrace(Supplier<T> supplier) {\n" + 
+				"        T result = supplier.get();\n" + 
+				"        System.out.println(result);\n" + 
+				"        return result;\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public static <T> T unwrapAndTrace(Optional<T> optional) {\n" + 
+				"        T result = optional.get();\n" + 
+				"        System.out.println(result);\n" + 
+				"        return result;\n" + 
+				"    }\n" +
+				"}\n"
+			});
+	}
+	public void testBug477894() {
+		runConformTest(
+			new String[] {
+				"Main.java",
+				"public class Main {\n" + 
+				"	static class Foo<T> {\n" + 
+				"		private final T arg;\n" + 
+				"		public Foo(T arg) {\n" + 
+				"			this.arg = arg;\n" + 
+				"		}\n" + 
+				"		<R> Foo<R> select(java.util.function.Function<T, R> transformer) {\n" + 
+				"			return new Foo<>(transformer.apply(this.arg));\n" + 
+				"		}\n" + 
+				"		<R> R select2(java.util.function.Function<T, R> transformer) {\n" + 
+				"			return transformer.apply(this.arg);\n" + 
+				"		}\n" + 
+				"	}\n" + 
+				"	public static void main(String[] args) {\n" + 
+				"		String out = new Foo<Object>(null)\n" + 
+				"		.select(x -> new Object() {\n" + 
+				"			String alias = \"anonymous#1\";\n" + 
+				"		})\n" + 
+				"		.select2(x -> x.alias);\n" + 
+				"		System.out.println(out);\n" + 
+				"	}\n" + 
+				"}\n"
+			});
+	}
+	public void testBug427265() {
+		runConformTest(
+			new String[] {
+				"X.java",
+				"import java.util.Arrays;\n" + 
+				"import java.util.List;\n" + 
+				"\n" + 
+				"public class X {\n" + 
+				"	public static void main(String[] args) {\n" + 
+				"		List<String> ss = Arrays.asList(\"1\", \"2\", \"3\");\n" + 
+				"		ss.stream().map(s -> new Object() { });\n" + 
+				"	}\n" + 
+				"}\n"
+			});
+	}
+	public void testBug427265_comment6() {
+		runConformTest(
+			new String[] {
+				"X.java",
+				"import java.util.Arrays;\n" + 
+				"import java.util.List;\n" + 
+				"\n" + 
+				"public class X {\n" + 
+				"	void m() {\n" + 
+				"        List<String> ss = Arrays.asList(\"1\", \"2\", \"3\");\n" + 
+				"        \n" + 
+				"        ss.stream().map(s -> {\n" + 
+				"          class L1 {};\n" + 
+				"          class L2 {\n" + 
+				"            L1 mm(L1 l) { return l;}\n" + 
+				"          }\n" + 
+				"          return new L2().mm(new L1());\n" + 
+				"        }).forEach(e -> System.out.println(e));\n" + 
+				"    }\n" + 
+				"}\n"
+			});
+	}
+	public void testBug525580() {
+		Runner runner = new Runner();
+		runner.customOptions = new HashMap<String, String>();
+		runner.customOptions.put(JavaCore.COMPILER_PB_DEPRECATION, JavaCore.IGNORE);
+		runner.testFiles =
+			new String[] { 
+				"org/a/a/g/d.java",
+				"package org.a.a.g;\n" + 
+				"\n" + 
+				"public class d {\n" + 
+				"\n" + 
+				"    public <T extends e> T a(Class<T> cls) {\n" + 
+				"        T t = (e) cls.newInstance();\n" + 
+				"        while (size >= 0) {\n" + 
+				"            T a = ((b) this.e.m.get(size)).a();\n" + 
+				"            t = a;\n" + 
+				"        }\n" + 
+				"        return t;\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public interface b {\n" + 
+				"        <T extends e> T a();\n" + 
+				"\n" + 
+				"        <T extends j> T b();\n" + 
+				"    }\n" + 
+				"}\n"
+			};
+		runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. ERROR in org\\a\\a\\g\\d.java (at line 5)\n" + 
+			"	public <T extends e> T a(Class<T> cls) {\n" + 
+			"	                  ^\n" + 
+			"e cannot be resolved to a type\n" + 
+			"----------\n" + 
+			"2. ERROR in org\\a\\a\\g\\d.java (at line 6)\n" + 
+			"	T t = (e) cls.newInstance();\n" + 
+			"	      ^^^^^^^^^^^^^^^^^^^^^\n" + 
+			"e cannot be resolved to a type\n" + 
+			"----------\n" + 
+			"3. ERROR in org\\a\\a\\g\\d.java (at line 6)\n" + 
+			"	T t = (e) cls.newInstance();\n" + 
+			"	       ^\n" + 
+			"e cannot be resolved to a type\n" + 
+			"----------\n" + 
+			"4. ERROR in org\\a\\a\\g\\d.java (at line 7)\n" + 
+			"	while (size >= 0) {\n" + 
+			"	       ^^^^\n" + 
+			"size cannot be resolved to a variable\n" + 
+			"----------\n" + 
+			"5. ERROR in org\\a\\a\\g\\d.java (at line 8)\n" + 
+			"	T a = ((b) this.e.m.get(size)).a();\n" + 
+			"	      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+			"Type mismatch: cannot convert from e to T\n" + 
+			"----------\n" + 
+			"6. ERROR in org\\a\\a\\g\\d.java (at line 8)\n" + 
+			"	T a = ((b) this.e.m.get(size)).a();\n" + 
+			"	                ^\n" + 
+			"e cannot be resolved or is not a field\n" + 
+			"----------\n" + 
+			"7. ERROR in org\\a\\a\\g\\d.java (at line 8)\n" + 
+			"	T a = ((b) this.e.m.get(size)).a();\n" + 
+			"	                        ^^^^\n" + 
+			"size cannot be resolved to a variable\n" + 
+			"----------\n" + 
+			"8. ERROR in org\\a\\a\\g\\d.java (at line 15)\n" + 
+			"	<T extends e> T a();\n" + 
+			"	           ^\n" + 
+			"e cannot be resolved to a type\n" + 
+			"----------\n" + 
+			"9. ERROR in org\\a\\a\\g\\d.java (at line 17)\n" + 
+			"	<T extends j> T b();\n" + 
+			"	           ^\n" + 
+			"j cannot be resolved to a type\n" + 
+			"----------\n" + 
+			"10. WARNING in org\\a\\a\\g\\d.java (at line 17)\n" + 
+			"	<T extends j> T b();\n" + 
+			"	                ^^^\n" + 
+			"This method has a constructor name\n" + 
+			"----------\n";
+		runner.runNegativeTest();
+	}
+	public void testBug525580_comment28() {
+		Runner runner = new Runner();
+		runner.customOptions = new HashMap<String, String>();
+		runner.customOptions.put(JavaCore.COMPILER_PB_DEPRECATION, JavaCore.IGNORE);
+		runner.testFiles =
+			new String[] {
+				"xxxxxx/iiibii.java",
+				"package xxxxxx;\n" + 
+				"\n" + 
+				"public class iiibii {\n" + 
+				"\n" + 
+				"    public <T extends xxxxxx.jajaja> T b041D041D041D041DН041DН(xxxxxx.jjajaa jjajaa) {\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public xxxxxx.jajaja bН041D041D041DН041DН(byte b, byte b2) {\n" + 
+				"        return b041D041D041D041DН041DН(new xxxxxx.jjajaa(b, b2));\n" + 
+				"    }\n" + 
+				"}\n",
+				"xxxxxx/jjajaa.java",
+				"package xxxxxx;\n" + 
+				"\n" + 
+				"public class jjajaa implements java.io.Serializable, java.lang.Comparable<xxxxxx.jjajaa> {\n" + 
+				"    private byte b0445х0445хх04450445;\n" + 
+				"    private byte bхх0445хх04450445;\n" + 
+				"\n" + 
+				"    public jjajaa(byte b, byte b2) {\n" + 
+				"        this.bхх0445хх04450445 = b;\n" + 
+				"        this.b0445х0445хх04450445 = b2;\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public int b043704370437з04370437з(xxxxxx.jjajaa jjajaa) {\n" + 
+				"        int i = this.bхх0445хх04450445 - jjajaa.bхх0445хх04450445;\n" + 
+				"        return i != 0 ? i : this.b0445х0445хх04450445 - jjajaa.b0445х0445хх04450445;\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public byte[] bззз043704370437з() {\n" + 
+				"        return new byte[]{this.bхх0445хх04450445, this.b0445х0445хх04450445};\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public /* synthetic */ int compareTo(java.lang.Object obj) {\n" + 
+				"        return b043704370437з04370437з((xxxxxx.jjajaa) obj);\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public boolean equals(java.lang.Object obj) {\n" + 
+				"        if (obj == null || getClass() != obj.getClass()) {\n" + 
+				"            return false;\n" + 
+				"        }\n" + 
+				"        xxxxxx.jjajaa jjajaa = (xxxxxx.jjajaa) obj;\n" + 
+				"        return this.bхх0445хх04450445 == jjajaa.bхх0445хх04450445 && this.b0445х0445хх04450445 == jjajaa.b0445х0445хх04450445;\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public int hashCode() {\n" + 
+				"        return ((this.bхх0445хх04450445 + 427) * 61) + this.b0445х0445хх04450445;\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public java.lang.String toString() {\n" + 
+				"        return xxxxxx.ttotoo.bг04330433г04330433г(this.bхх0445хх04450445) + xxxxxx.ttotoo.bг04330433г04330433г(this.b0445х0445хх04450445);\n" + 
+				"    }\n" + 
+				"}\n"
+			};
+		runner.expectedCompilerLog =
+				"----------\n" + 
+				"1. ERROR in xxxxxx\\iiibii.java (at line 5)\n" + 
+				"	public <T extends xxxxxx.jajaja> T b041D041D041D041DН041DН(xxxxxx.jjajaa jjajaa) {\n" + 
+				"	                  ^^^^^^^^^^^^^\n" + 
+				"xxxxxx.jajaja cannot be resolved to a type\n" + 
+				"----------\n" + 
+				"2. ERROR in xxxxxx\\iiibii.java (at line 8)\n" + 
+				"	public xxxxxx.jajaja bН041D041D041DН041DН(byte b, byte b2) {\n" + 
+				"	       ^^^^^^^^^^^^^\n" + 
+				"xxxxxx.jajaja cannot be resolved to a type\n" + 
+				"----------\n" + 
+				"3. ERROR in xxxxxx\\iiibii.java (at line 9)\n" + 
+				"	return b041D041D041D041DН041DН(new xxxxxx.jjajaa(b, b2));\n" + 
+				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+				"Type mismatch: cannot convert from jajaja to jajaja\n" + 
+				"----------\n" + 
+				"----------\n" + 
+				"1. ERROR in xxxxxx\\jjajaa.java (at line 3)\n" + 
+				"	public class jjajaa implements java.io.Serializable, java.lang.Comparable<xxxxxx.jjajaa> {\n" + 
+				"	             ^^^^^^\n" + 
+				"The type jjajaa must implement the inherited abstract method Comparable<jjajaa>.compareTo(jjajaa)\n" + 
+				"----------\n" + 
+				"2. WARNING in xxxxxx\\jjajaa.java (at line 3)\n" + 
+				"	public class jjajaa implements java.io.Serializable, java.lang.Comparable<xxxxxx.jjajaa> {\n" + 
+				"	             ^^^^^^\n" + 
+				"The serializable class jjajaa does not declare a static final serialVersionUID field of type long\n" + 
+				"----------\n" + 
+				"3. ERROR in xxxxxx\\jjajaa.java (at line 21)\n" + 
+				"	public /* synthetic */ int compareTo(java.lang.Object obj) {\n" + 
+				"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+				"Name clash: The method compareTo(Object) of type jjajaa has the same erasure as compareTo(T) of type Comparable<T> but does not override it\n" + 
+				"----------\n" + 
+				"4. ERROR in xxxxxx\\jjajaa.java (at line 38)\n" + 
+				"	return xxxxxx.ttotoo.bг04330433г04330433г(this.bхх0445хх04450445) + xxxxxx.ttotoo.bг04330433г04330433г(this.b0445х0445хх04450445);\n" + 
+				"	       ^^^^^^^^^^^^^\n" + 
+				"xxxxxx.ttotoo cannot be resolved to a type\n" + 
+				"----------\n" + 
+				"5. ERROR in xxxxxx\\jjajaa.java (at line 38)\n" + 
+				"	return xxxxxx.ttotoo.bг04330433г04330433г(this.bхх0445хх04450445) + xxxxxx.ttotoo.bг04330433г04330433г(this.b0445х0445хх04450445);\n" + 
+				"	                                                                    ^^^^^^^^^^^^^\n" + 
+				"xxxxxx.ttotoo cannot be resolved to a type\n" + 
+				"----------\n";
+		runner.runNegativeTest();
+	}
+	public void testBug340506() {
+		runNegativeTest(
+			new String[] {
+				"Test.java",
+				"public class Test {\n" + 
+				"    public <T> void setValue(Parameter<T> parameter, T value) {\n" + 
+				"        System.out.println(\"Object\");\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public <T> void setValue(Parameter<T> parameter, Field<T> value) {\n" + 
+				"        System.out.println(\"Field\");\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    public static void main(String[] args) {\n" + 
+				"        new Test().test();\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    private void test() {\n" + 
+				"        Parameter<String> p1 = p1();\n" + 
+				"        Field<String> f1 = f1();\n" + 
+				"        setValue(p1, f1);\n" +
+				"		 setValue(p1, null);\n" + 
+				"\n" + 
+				"        Parameter<Object> p2 = p2();\n" + 
+				"        Field<Object> f2 = f2();\n" + 
+				"        setValue(p2, f2);\n" + 
+				"  		 setValue(p2, null);" + 
+				"    }\n" + 
+				"\n" + 
+				"    private Field<String> f1() {\n" + 
+				"        Field<String> f1 = null;\n" + 
+				"        return f1;\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    private Parameter<String> p1() {\n" + 
+				"        Parameter<String> p1 = null;\n" + 
+				"        return p1;\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    private Parameter<Object> p2() {\n" + 
+				"        Parameter<Object> p2 = null;\n" + 
+				"        return p2;\n" + 
+				"    }\n" + 
+				"\n" + 
+				"    private Field<Object> f2() {\n" + 
+				"        Field<Object> f2 = null;\n" + 
+				"        return f2;\n" + 
+				"    }\n" + 
+				"}\n" + 
+				"\n" + 
+				"interface Field<T> {}\n" + 
+				"interface Parameter <T> {}\n"
+			},
+			"----------\n" + 
+			"1. ERROR in Test.java (at line 18)\n" + 
+			"	setValue(p1, null);\n" + 
+			"	^^^^^^^^\n" + 
+			"The method setValue(Parameter<String>, String) is ambiguous for the type Test\n" + 
+			"----------\n" + 
+			"2. ERROR in Test.java (at line 22)\n" + 
+			"	setValue(p2, f2);\n" + 
+			"	^^^^^^^^\n" + 
+			"The method setValue(Parameter<Object>, Object) is ambiguous for the type Test\n" + 
+			"----------\n" + 
+			"3. ERROR in Test.java (at line 23)\n" + 
+			"	setValue(p2, null);    }\n" + 
+			"	^^^^^^^^\n" + 
+			"The method setValue(Parameter<Object>, Object) is ambiguous for the type Test\n" + 
+			"----------\n");
+	}
+	public void testBug333011() {
+		runNegativeTest(
+			new String[] {
+				"Example.java",
+				"import java.util.ArrayList;\n" +
+				"public class Example {\n" + 
+				"	public static void doSomething() {\n" + 
+				"		DoJobMr bean = getOnlyElement(new ArrayList());\n" + 
+				"	}\n" + 
+				"	public static <T> T getOnlyElement(Iterable<T> iterable) { \n" + 
+				"		return null;\n" + 
+				"	}\n" + 
+				"	public static class DoJobMr {\n" + 
+				"	}\n" + 
+				"}\n"
+			},
+			"----------\n" + 
+			"1. ERROR in Example.java (at line 4)\n" + 
+			"	DoJobMr bean = getOnlyElement(new ArrayList());\n" + 
+			"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+			"Type mismatch: cannot convert from Object to Example.DoJobMr\n" + 
+			"----------\n" + 
+			"2. WARNING in Example.java (at line 4)\n" + 
+			"	DoJobMr bean = getOnlyElement(new ArrayList());\n" + 
+			"	                                  ^^^^^^^^^\n" + 
+			"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" + 
+			"----------\n");
+	}
+	public void testBug537089() {
+		runConformTest(
+			new String[] {
+				"EclipseBug.java",
+				"public class EclipseBug {\n" + 
+				"    public static <T> void foo(T p1, T p2) {}\n" + 
+				"\n" + 
+				"    public void shouldCompile() {\n" + 
+				"        foo(new int[0], new byte[0]);\n" + 
+				"    }\n" + 
+				"}\n"
+			});
+	}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java
index 10216e4..b07c5fd 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java
@@ -70,7 +70,7 @@
 	simpleTypeNames.put("ComparableAny", "Comparable<?>");
 	simpleTypeNames.put("CollectionExt_ComparableAny", "Collection<? extends Comparable<?>>");
 	simpleTypeNames.put("CollectionSuperComparableAny", "Collection<? super Comparable<?>>");
-	simpleTypeNames.put("IntLongFloat", "java.lang.Number&Comparable<?>");
+	simpleTypeNames.put("IntLongFloat", "java.lang.Number & Comparable<?>");
 	simpleTypeNames.put("ListTestAndSerializable", "List<? extends Z & java.io.Serializable>");
 	simpleTypeNames.put("TestAndSerializable", "Z & java.io.Serializable");
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java
index 6c4f4b4..dffca1c 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java
@@ -21,6 +21,9 @@
 @SuppressWarnings({ "unchecked", "rawtypes" })
 public class LocalVariableTest extends AbstractRegressionTest {
 
+static {
+//	TESTS_NAMES = new String[] { "testBug537033" };
+}
 public LocalVariableTest(String name) {
 	super(name);
 }
@@ -737,9 +740,10 @@
 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=412119, Optional warning for unused throwable variable in catch block
 //Error message for exception parameter not being used.
 public void test412119b() {
-	Map options = getCompilerOptions();
-	options.put(CompilerOptions.OPTION_ReportUnusedExceptionParameter, CompilerOptions.ERROR);
-	this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedExceptionParameter, CompilerOptions.ERROR);
+	runner.testFiles =
 			new String[] {
 				"p/X.java",
 				"package p;\n" +
@@ -768,25 +772,26 @@
 				"		}\n" +
 				"    }\n" +
 				"}\n",
-			},
+			};
+	runner.expectedCompilerLog =
 			"----------\n" +
 			"1. ERROR in p\\X.java (at line 7)\n" +
 			"	} catch(Exception e) {\n" +
 			"	                  ^\n" +
 			"The value of the exception parameter e is not used\n" +
-			"----------\n",
-			null,
-			true,
-			options);
+			"----------\n";
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=412119, Optional warning for unused throwable variable in catch block
 //Multi-catch parameters.
 public void test412119c() {
 	if (this.complianceLevel < ClassFileConstants.JDK1_7)
 		return;
-	Map options = getCompilerOptions();
-	options.put(CompilerOptions.OPTION_ReportUnusedExceptionParameter, CompilerOptions.ERROR);
-	this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(CompilerOptions.OPTION_ReportUnusedExceptionParameter, CompilerOptions.ERROR);
+	runner.testFiles =
 			new String[] {
 				"p/X.java",
 				"package p;\n" +
@@ -813,17 +818,17 @@
 				"			throw new RuntimeException(z2);\n" +
 				"		}\n" +
 				"	}\n" +
-				"}\n",
-			},
+				"}\n"
+			};
+	runner.expectedCompilerLog =
 			"----------\n" +
 			"1. ERROR in p\\X.java (at line 16)\n" +
 			"	} catch(Z2|Z1 z) {\n" +
 			"	              ^\n" +
 			"The value of the exception parameter z is not used\n" +
-			"----------\n",
-			null,
-			true,
-			options);
+			"----------\n";
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=412119, Optional warning for unused throwable variable in catch block
 //Suppress Warnings.
@@ -856,6 +861,51 @@
 			true,
 			options);
 }
+public void testBug537033() {
+	if (this.complianceLevel < ClassFileConstants.JDK1_5)
+		return;
+	runNegativeTest(
+		new String[] {
+			"ShowBug.java",
+			"import java.util.concurrent.Callable;\n" + 
+			"\n" + 
+			"public class ShowBug {\n" + 
+			"    private static abstract class X {\n" + 
+			"        abstract void x(int val);\n" + 
+			"    }\n" + 
+			"\n" + 
+			"    public ShowBug() {\n" + 
+			"        final X x = new X() {\n" + 
+			"            void x(int val) {\n" + 
+			"                if (val > 0) {\n" + 
+			"                    // (1) The local variable x may not have been initialized\n" + 
+			"                    x.x(val - 1);\n" + 
+			"                }\n" + 
+			"            }\n" + 
+			"        };\n" + 
+			"\n" + 
+			"        new Callable<Void>() {\n" + 
+			"            public Void call() {\n" + 
+			"                // (2) Missing code implementation in the compiler\n" + 
+			"                x.x(10);          \n" + 
+			"                return null;\n" + 
+			"            }\n" + 
+			"        }.call();\n" + 
+			"    }\n" + 
+			"}\n"
+		},
+		"----------\n" + 
+		"1. WARNING in ShowBug.java (at line 9)\n" + 
+		"	final X x = new X() {\n" + 
+		"	                ^^^\n" + 
+		"Access to enclosing constructor ShowBug.X() is emulated by a synthetic accessor method\n" + 
+		"----------\n" + 
+		"2. ERROR in ShowBug.java (at line 13)\n" + 
+		"	x.x(val - 1);\n" + 
+		"	^\n" + 
+		"The local variable x may not have been initialized\n" + 
+		"----------\n");
+}
 public static Class testClass() {
 	return LocalVariableTest.class;
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
index 0b0da53..eaf48b2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14371,4 +14371,20 @@
 		"",
 		JavacTestOptions.DEFAULT);
 }
+public void testBug536593() {
+	runConformTest(
+		new String[] {
+			"AbstractComp.java",
+			"public abstract class AbstractComp {\n" + 
+			"	protected abstract boolean isReadOnly();\n" + 
+			"}\n",
+			"HasValue.java",
+			"public interface HasValue<T> {\n" + 
+			"	boolean isReadOnly();\n" + 
+			"}\n",
+			"Factory.java",
+			"public class Factory<T, F extends AbstractComp & HasValue<T>> {\n" + 
+			"}\n"
+		});
+}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
index 4524975..3ba2d0b 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
@@ -42,6 +42,9 @@
 		// TESTS_RANGE = new int[] { 298, -1 };
 	}
 
+	// use -source rather than --release but suppress: warning: [options] bootstrap class path not set in conjunction with -source 9:
+	private static final String JAVAC_SOURCE_9_OPTIONS = "-source 9 -Xlint:-options";
+
 	public ModuleCompilationTests(String name) {
 		super(name);
 	}
@@ -79,6 +82,40 @@
 		}
 	}
 	
+	class Runner extends AbstractRegressionTest.Runner {
+		StringBuffer commandLine = new StringBuffer();
+		String outputDir = OUTPUT_DIR + File.separator + "javac";
+		List<String> fileNames = new ArrayList<>();
+		/** will replace any -8, -9 ... option for javac */
+		String javacVersionOptions;
+
+		Runner() {
+			this.javacTestOptions = JavacTestOptions.DEFAULT;
+			this.expectedOutputString = "";
+			this.expectedErrorString = "";
+		}
+		/** Create a source file and add the filename to the compiler command line. */
+		void createFile(String directoryName, String fileName, String source) {
+			writeFileCollecting(this.fileNames, directoryName, fileName, source);
+		}
+		Set<String> runConformModuleTest() {
+			if (!this.fileNames.isEmpty()) {
+				this.shouldFlushOutputDirectory = false;
+				if (this.testFiles == null)
+					this.testFiles = new String[0];
+				for (String fileName : this.fileNames) {
+					this.commandLine.append(" \"").append(fileName).append("\"");
+				}
+			}
+			String commandLineString = this.commandLine.toString();
+			String javacCommandLine = adjustForJavac(commandLineString, this.javacVersionOptions);
+			return ModuleCompilationTests.this.runConformModuleTest(this.testFiles, commandLineString,
+					this.expectedOutputString, this.expectedErrorString,
+					this.shouldFlushOutputDirectory, this.outputDir,
+					this.javacTestOptions, javacCommandLine);
+		}
+	}
+
 	void runConformModuleTest(List<String> testFileNames, StringBuffer commandLine,
 			String expectedFailureOutOutputString, String expectedFailureErrOutputString,
 			boolean shouldFlushOutputDirectory)
@@ -94,19 +131,21 @@
 		for (String file : testFileNames)
 			commandLine.append(" \"").append(file).append("\"");
 		runConformModuleTest(new String[0], commandLine.toString(),
-				expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, output);
+				expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory,
+				output, JavacTestOptions.DEFAULT, null);
 	}
 
 	Set<String> runConformModuleTest(String[] testFiles, String commandLine,
 			String expectedFailureOutOutputString, String expectedFailureErrOutputString,
 			boolean shouldFlushOutputDirectory)
 	{
-		return runConformModuleTest(testFiles, commandLine, expectedFailureErrOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, OUTPUT_DIR);
+		return runConformModuleTest(testFiles, commandLine, expectedFailureErrOutputString, expectedFailureErrOutputString,
+				shouldFlushOutputDirectory, OUTPUT_DIR, JavacTestOptions.DEFAULT, null);
 	}
 
 	Set<String> runConformModuleTest(String[] testFiles, String commandLine,
 			String expectedFailureOutOutputString, String expectedFailureErrOutputString,
-			boolean shouldFlushOutputDirectory, String output)
+			boolean shouldFlushOutputDirectory, String output, JavacTestOptions options, String javacCommandLine)
 	{
 		this.runConformTest(testFiles, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory);
 		if (RUN_JAVAC) {
@@ -117,18 +156,25 @@
 			for (int i = 0; i < testFileNames.length; i++) {
 				testFileNames[i] = testFiles[i*2];
 			}
+			if (javacCommandLine == null) {
+				javacCommandLine = adjustForJavac(commandLine, null);
+			}
 			for (Object comp : javacCompilers) {
 				JavacCompiler javacCompiler = (JavacCompiler) comp;
 				if (javacCompiler.compliance < ClassFileConstants.JDK9)
 					continue;
-				commandLine = adjustForJavac(commandLine);
+				if (options.skip(javacCompiler)) {
+					System.err.println("Skip testing javac in "+testName());
+					continue;
+				}
 				StringBuffer log = new StringBuffer();
 				try {
 					long compileResult = javacCompiler.compile(
 											outputDir, /* directory */
-											commandLine /* options */,
+											javacCommandLine /* options */,
 											testFileNames /* source file names */,
-											log);
+											log,
+											false); // don't repeat filenames on the command line
 					if (compileResult != 0) {
 						System.err.println("Previous error was from "+testName());
 						fail("Unexpected error from javac");
@@ -158,21 +204,29 @@
 			String expectedFailureOutOutputString, String expectedFailureErrOutputString,
 			boolean shouldFlushOutputDirectory, String javacErrorMatch, String output)
 	{
+		runNegativeModuleTest(testFileNames, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString,
+				shouldFlushOutputDirectory, javacErrorMatch, output, JavacTestOptions.DEFAULT);
+	}
+	void runNegativeModuleTest(List<String> testFileNames, StringBuffer commandLine,
+			String expectedFailureOutOutputString, String expectedFailureErrOutputString,
+			boolean shouldFlushOutputDirectory, String javacErrorMatch, String output, JavacTestOptions options)
+	{
 		for (String file : testFileNames)
 			commandLine.append(" \"").append(file).append("\"");
 		runNegativeModuleTest(new String[0], commandLine.toString(),
-				expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, javacErrorMatch, output);
+				expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, javacErrorMatch, output,
+				options);
 	}
 	void runNegativeModuleTest(String[] testFiles, String commandLine,
 			String expectedFailureOutOutputString, String expectedFailureErrOutputString,
 			boolean shouldFlushOutputDirectory, String javacErrorMatch) {
 		runNegativeModuleTest(testFiles, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString,
-				shouldFlushOutputDirectory, javacErrorMatch, OUTPUT_DIR);
+				shouldFlushOutputDirectory, javacErrorMatch, OUTPUT_DIR, JavacTestOptions.DEFAULT);
 	}
 
 	void runNegativeModuleTest(String[] testFiles, String commandLine,
 			String expectedFailureOutOutputString, String expectedFailureErrOutputString,
-			boolean shouldFlushOutputDirectory, String javacErrorMatch, String output)
+			boolean shouldFlushOutputDirectory, String javacErrorMatch, String output, JavacTestOptions options)
 	{
 		this.runNegativeTest(testFiles, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory);
 		if (RUN_JAVAC) {
@@ -187,8 +241,11 @@
 				JavacCompiler javacCompiler = (JavacCompiler) comp;
 				if (javacCompiler.compliance < ClassFileConstants.JDK9)
 					continue;
-				commandLine = adjustForJavac(commandLine);
+				JavacTestOptions.Excuse excuse = options.excuseFor(javacCompiler);
+
+				commandLine = adjustForJavac(commandLine, null);
 				StringBuffer log = new StringBuffer();
+				int mismatch = 0;
 				try {
 					long compileResult = javacCompiler.compile(
 											outputDir, /* directory */
@@ -196,17 +253,20 @@
 											testFileNames /* source file names */,
 											log);
 					if (compileResult == 0) {
+						mismatch = JavacTestOptions.MismatchType.EclipseErrorsJavacNone;
+						javacErrorMatch = expectedFailureErrOutputString;
 						System.err.println("Previous error was from "+testName());
-						fail(testName()+": Unexpected success from javac");
-					}
-					if (!log.toString().contains(javacErrorMatch)) {
+					} else if (!log.toString().contains(javacErrorMatch)) {
+						mismatch = JavacTestOptions.MismatchType.CompileErrorMismatch;
 						System.err.println(testName()+": Error match " + javacErrorMatch + " not found in \n"+log.toString());
-						fail("Expected error match not found: "+javacErrorMatch);
 					}
 				} catch (IOException | InterruptedException e) {
 					e.printStackTrace();
 					throw new AssertionFailedError(e.getMessage());
 				}
+				handleMismatch(javacCompiler, testName(), testFiles, javacErrorMatch,
+						"", "", log, "", "",
+						excuse, mismatch);
 				final Set<String> expectedFiles = new HashSet<>(outFiles);
 				walkOutFiles(output, expectedFiles, false);
 				for (String missingFile : expectedFiles)
@@ -215,7 +275,13 @@
 		}
 	}
 
-	String adjustForJavac(String commandLine) {
+	/**
+	 * @param commandLine command line arguments as used for ecj
+	 * @param versionOptions if non-null use this to replace any ecj-specific -8, -9 etc. arg.
+	 * 		If ecj-specific arg is not found, append anyway
+	 * @return commandLine adjusted for javac
+	 */
+	String adjustForJavac(String commandLine, String versionOptions) {
 		String[] tokens = commandLine.split(" ");
 		StringBuffer buf = new StringBuffer();
 		boolean skipNext = false;
@@ -225,11 +291,13 @@
 				continue;
 			}
 			if (tokens[i].trim().equals("-9")) {
-				buf.append(" -source 9 ");
+				if (versionOptions == null)
+					buf.append(' ').append(" --release 9 ");
 				continue;
 			}
 			if (tokens[i].trim().equals("-8")) {
-				buf.append(" -source 1.8 ");
+				if (versionOptions == null)
+					buf.append(' ').append(" --release 8 ");
 				continue;
 			}
 			if (tokens[i].startsWith("-warn") || tokens[i].startsWith("-err") || tokens[i].startsWith("-info")) {
@@ -243,6 +311,9 @@
 			}
 			buf.append(tokens[i]).append(' ');
 		}
+		if (versionOptions != null) {
+			buf.append(versionOptions);
+		}
 		return buf.toString();
 	}
 	
@@ -1014,7 +1085,8 @@
 				"1 problem (1 error)\n",
 				false,
 				"cannot be resolved",
-				OUTPUT_DIR + File.separator + out);
+				OUTPUT_DIR + File.separator + out,
+				JavacTestOptions.JavacHasABug.JavacBug8207032);
 	}
 	public void test016() {
 		File outputDirectory = new File(OUTPUT_DIR);
@@ -1178,13 +1250,13 @@
 	 * Unnamed module tries to access a type from an unexported package successfully due to --add-exports
 	 */
 	public void test019() {
+		Runner runner = new Runner();
 		File outputDirectory = new File(OUTPUT_DIR);
 		Util.flushDirectoryContent(outputDirectory);
 		String out = "bin";
 		String directory = OUTPUT_DIR + File.separator + "src";
 		String moduleLoc = directory + File.separator + "mod.one";
-		List<String> files = new ArrayList<>(); 
-		writeFileCollecting(files, moduleLoc + File.separator + "p", "X.java", 
+		runner.createFile(moduleLoc + File.separator + "p", "X.java", 
 						"package p;\n" +
 						"public abstract class X extends com.sun.security.ntlm.Server {\n" +
 						"	//public X() {}\n" +
@@ -1193,8 +1265,7 @@
 						"	}\n" +
 						"}");
 
-		StringBuffer buffer = new StringBuffer();
-		buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+		runner.commandLine.append("-d " + OUTPUT_DIR + File.separator + out )
 			.append(" -9 ")
 			.append(" -classpath \"")
 			.append(Util.getJavaClassLibsAsString())
@@ -1202,11 +1273,8 @@
 			.append(" -sourcepath " + "\"" + moduleLoc + "\" ")
 			.append(" --add-exports java.base/com.sun.security.ntlm=ALL-UNNAMED ");
 
-		runConformModuleTest(files, 
-				buffer,
-				"",
-				"",
-				false);
+		runner.javacVersionOptions = JAVAC_SOURCE_9_OPTIONS; // otherwise javac: error: exporting a package from system module java.base is not allowed with --release
+		runner.runConformModuleTest();
 	}
 	/*
 	 * Named module tries to access a type from an unnamed module successfully due to --add-reads
@@ -1299,7 +1367,8 @@
 				"1 problem (1 error)\n",
 				false,
 				"package s",
-				 OUTPUT_DIR + File.separator + out);
+				 OUTPUT_DIR + File.separator + out,
+				 JavacTestOptions.JavacHasABug.JavacBug8204534);
 	}
 	/*
 	 * Unnamed module tries to access a type from an unexported package, fail
@@ -1344,7 +1413,25 @@
 				"----------\n" + 
 				"2 problems (2 errors)\n",
 				false,
-				"does not export it to the unnamed module");
+				"package com.sun.security.ntlm");
+				/* javac9:
+				 * src/mod.one/p/X.java:2: error: package com.sun.security.ntlm is not visible
+				 * public abstract class X extends com.sun.security.ntlm.Server {
+				 *                                                 ^
+				 *   (package com.sun.security.ntlm is declared in module java.base, which does not export it to the unnamed module)
+				 * src/mod.one/p/X.java:4: error: package com.sun.security.ntlm is not visible
+				 * public X(String arg0, String arg1) throws com.sun.security.ntlm.NTLMException {
+				 *                                                           ^
+				 *   (package com.sun.security.ntlm is declared in module java.base, which does not export it to the unnamed module)
+				 */
+				/* javac10:
+				 * src/mod.one/p/X.java:2: error: package com.sun.security.ntlm does not exist
+				 * public abstract class X extends com.sun.security.ntlm.Server {
+				 *                                                      ^
+				 * src/mod.one/p/X.java:4: error: package com.sun.security.ntlm does not exist
+				 * public X(String arg0, String arg1) throws com.sun.security.ntlm.NTLMException {
+				 *                                                                ^
+				 */
 	}
 	public void test020() {
 		File outputDirectory = new File(OUTPUT_DIR);
@@ -1543,29 +1630,25 @@
 				"endorseddirs");
 	}
 	public void test026() {
+		Runner runner = new Runner();
 		File outputDirectory = new File(OUTPUT_DIR);
 		Util.flushDirectoryContent(outputDirectory);
 		String out = "bin";
 		String directory = OUTPUT_DIR + File.separator + "src";
 		String moduleLoc = directory + File.separator + "mod.one";
-		List<String> files = new ArrayList<>(); 
-		writeFileCollecting(files, moduleLoc, "module-info.java", 
+		runner.createFile(
+						moduleLoc, "module-info.java", 
 						"module mod.one { \n" +
 						"	requires java.base;\n" +
 						"	requires transitive java.sql;\n" +
 						"}");
 		String javaHome = System.getProperty("java.home");
-		StringBuffer buffer = new StringBuffer();
-		buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+		runner.commandLine.append("-d " + OUTPUT_DIR + File.separator + out )
 			.append(" -9 ")
-			.append(" --system \"").append(javaHome).append("\"")
-			.append(" \"" + moduleLoc +  File.separator + "module-info.java\" ");
+			.append(" --system \"").append(javaHome).append("\"");
 
-		runConformModuleTest(new String[0], 
-				buffer.toString(),
-				"",
-				"",
-				false);
+		runner.javacVersionOptions = JAVAC_SOURCE_9_OPTIONS;
+		runner.runConformModuleTest();
 	}
 	/**
 	 * Mixed case of exported and non exported packages being referred to in another module
@@ -3388,17 +3471,18 @@
 			.append("\" ")
 			.append(" --module-source-path " + "\"" + directory + "\"");
 
-		runConformModuleTest(files, 
+		runNegativeModuleTest(files, 
 			buffer,
 			"",
 			"----------\n" + 
-			"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/X.java (at line 1)\n" + 
+			"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/X.java (at line 1)\n" + 
 			"	public class X {\n" + 
 			"	^\n" + 
 			"Must declare a named package because this compilation unit is associated to the named module \'mod.one\'\n" + 
 			"----------\n" + 
-			"1 problem (1 warning)\n",
+			"1 problem (1 error)\n",
 			false,
+			"unnamed package is not allowed in named modules",
 			OUTPUT_DIR + File.separator + out);
 	}
 	public void testAutoModule1() throws Exception {
@@ -3546,10 +3630,10 @@
 			"The package p1 does not exist or is empty\n" + 
 			"----------\n" +
 			"----------\n" + 
-			"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p1/X.java\n" + 
+			"2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/p1/X.java\n" + 
 			"Must declare a named package because this compilation unit is associated to the named module \'mod.one\'\n" + 
 			"----------\n" + 
-			"2 problems (1 error, 1 warning)\n",
+			"2 problems (2 errors)\n",
 			false,
 			"empty",
 			OUTPUT_DIR + File.separator + out);
@@ -3837,11 +3921,23 @@
 			.append("\" ")
 			.append(" --module-path " + "\"" + OUTPUT_DIR + File.separator + out + "\" ")
 			.append(" --module-source-path " + "\"" + directory + "\" ");
-		runConformModuleTest(files, 
+		runNegativeModuleTest(files, 
 				buffer,
 				"",
-				"",
-				false);
+				"----------\n" + 
+				"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/module-info.java (at line 2)\n" + 
+				"	requires mod.one;\n" + 
+				"	^^^^^^^^^^^^^^^^\n" + 
+				"The package x.y.z is accessible from more than one module: mod.one, mod.one.a\n" + 
+				"----------\n" + 
+				"2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.two/module-info.java (at line 3)\n" + 
+				"	requires mod.one.a;\n" + 
+				"	^^^^^^^^^^^^^^^^^^\n" + 
+				"The package x.y.z is accessible from more than one module: mod.one, mod.one.a\n" + 
+				"----------\n" + 
+				"2 problems (2 errors)\n",
+				false,
+				"module mod.two reads package x.y.z from both mod.one and mod.one.a");
 	}
 	public void testReleaseOption1() throws Exception {
 		this.runConformTest(
@@ -4092,24 +4188,22 @@
 	        true);
 	}
 	public void testReleaseOption13a() {
-		runConformModuleTest(
-			new String[] {
-				"p/X.java",
+		Runner runner = new Runner();
+		runner.createFile( 
+				OUTPUT_DIR +File.separator+"p", "X.java",
 				"package p;\n" +
 				"public class X {\n" +
 				"	public static void main(String[] args) {\n" +
 				"	}\n" +
-				"}",
-				"module-info.java",
+				"}");
+		runner.createFile( 
+				OUTPUT_DIR, "module-info.java",
 				"module mod.one { \n" +
 				"	requires java.base;\n" +
-				"}"
-	        },
-			" --release 10 \"" + OUTPUT_DIR +  File.separator + "module-info.java\" "
-	        + "\"" + OUTPUT_DIR +  File.separator + "p/X.java\"",
-	        "",
-	        "",
-	        true);
+				"}");
+		runner.commandLine.append(" --release 10");
+		runner.javacTestOptions = new JavacTestOptions(ClassFileConstants.JDK10);
+		runner.runConformModuleTest();
 	}
 	public void testReleaseOption14() {
 		runNegativeModuleTest(
@@ -4138,25 +4232,22 @@
 	}
 	// Test from https://bugs.eclipse.org/bugs/show_bug.cgi?id=526997
 	public void testReleaseOption15() {
-		runConformModuleTest(
-			new String[] {
-				"foo/Module.java",
+		Runner runner = new Runner();
+		String fooDir = OUTPUT_DIR + File.separator + "foo";
+		runner.createFile(
+				fooDir, "Module.java",
 				"package foo;\n" +
-				"public class Module {}\n",
-				"foo/X.java",
+				"public class Module {}\n");
+		runner.createFile(
+				fooDir, "X.java",
 				"package foo;\n" +
 				"public class X { \n" +
 				"	public Module getModule(String name) {\n" + 
 				"		return null;\n" +
 				"	}\n" + 
-				"}"
-	        },
-			" --release 8 \"" + OUTPUT_DIR +  File.separator + "foo" + File.separator + "Module.java\" " +
-			"\"" +  OUTPUT_DIR +  File.separator + "foo" + File.separator + "X.java\" ",
-	        "",
-    		"",
-	        true,
-	        OUTPUT_DIR);
+				"}");
+		runner.commandLine.append(" --release 8 ");
+	    runner.runConformModuleTest();
 	}
 	// Test from https://bugs.eclipse.org/bugs/show_bug.cgi?id=526997
 	public void testReleaseOption16() {
@@ -4417,10 +4508,10 @@
 		String outDir = OUTPUT_DIR + File.separator + "bin";
 		String srcDir = OUTPUT_DIR + File.separator + "src";
 		String moduleLoc = srcDir + File.separator + "test";
-		List<String> files = new ArrayList<>(); 
-		writeFileCollecting(files, moduleLoc, "module-info.java", 
+		Runner runner = new Runner();
+		runner.createFile(moduleLoc, "module-info.java", 
 						"module test {}");
-		writeFileCollecting(files, moduleLoc + File.separator + "test", "Thing.java", 
+		runner.createFile(moduleLoc + File.separator + "test", "Thing.java", 
 				"package test;\n" +
 				"import java.util.Comparator;\n" + 
 				"import java.util.Iterator;\n" + 
@@ -4432,14 +4523,11 @@
 				"    }\n" + 
 				"}\n");
 
-		StringBuffer buffer = new StringBuffer();
-		buffer.append("-d " + outDir )
+		runner.commandLine.append("-d " + outDir )
 			.append(" -source 9 ")
 			.append(" --module-source-path " + "\"" + srcDir + "\" ");
-		runConformModuleTest(files, buffer,
-				"",
-				"",
-				false);
+		runner.javacVersionOptions = "-Xlint:-options"; // -source 9 already provided
+		runner.runConformModuleTest();
 	}
 	public void testBug508889_001() throws Exception {
 		this.runConformTest(
@@ -4578,115 +4666,105 @@
 		String outDir = OUTPUT_DIR + File.separator + "bin";
 		String srcDir = OUTPUT_DIR + File.separator + "src";
 		String moduleLoc = srcDir + File.separator + "test";
-		List<String> files = new ArrayList<>(); 
-		writeFileCollecting(files, moduleLoc, "module-info.java", 
+		Runner runner = new Runner();
+		runner.createFile(moduleLoc, "module-info.java", 
 						"module test {\n" +
 						"	requires org.astro;\n" +
 						"}");
-		writeFileCollecting(files, moduleLoc + File.separator + "p", "Test.java", 
+		runner.createFile(moduleLoc + File.separator + "p", "Test.java", 
 			"package p;\n" +
 			"import org.astro.World;\n" + 
 			"public class Test {\n" +
 			"	World w = null;\n" +
 			"}");
 		moduleLoc = srcDir + File.separator + "org.astro";
-		writeFileCollecting(files, moduleLoc, "module-info.java", 
+		runner.createFile(moduleLoc, "module-info.java", 
 				"module org.astro {\n" +
 				"	exports org.astro;\n" +
 				"}");
-		writeFileCollecting(files, moduleLoc + File.separator + "org" + File.separator + "astro", "World.java", 
+		runner.createFile(moduleLoc + File.separator + "org" + File.separator + "astro", "World.java", 
 			"package org.astro;\n" +
 			"public interface World {\n" + 
 			"	public static String name() {\n" + 
 			"		return \"\";\n" + 
 			"	}\n" + 
 			"}");
-		StringBuffer buffer = new StringBuffer();
-		buffer.append("-d " + outDir )
+		runner.commandLine.append("-d " + outDir )
 			.append(" -source 9 ")
 			.append(" --module-source-path " + "\"" + srcDir + "\" ");
-		runConformModuleTest(files, buffer,
-				"",
-				"",
-				false);
+		runner.javacVersionOptions = " -Xlint:-options";
+		runner.runConformModuleTest();
 	}
 	public void testBug520858a() {
 		Util.flushDirectoryContent(new File(OUTPUT_DIR));
 		String outDir = OUTPUT_DIR + File.separator + "bin";
 		String srcDir = OUTPUT_DIR + File.separator + "src";
 		String moduleLoc = srcDir + File.separator + "test";
-		List<String> files = new ArrayList<>(); 
-		writeFileCollecting(files, moduleLoc, "module-info.java", 
+		Runner runner = new Runner();
+		// not adding some files to the command line
+		writeFile(moduleLoc, "module-info.java", 
 						"module test {\n" +
 						"	requires org.astro;\n" +
 						"}");
-		writeFileCollecting(files, moduleLoc + File.separator + "p", "Test.java", 
+		// the only file added:
+		runner.createFile(moduleLoc + File.separator + "p", "Test.java", 
 			"package p;\n" +
 			"import org.astro.World;\n" + 
 			"public class Test {\n" +
 			"	World w = null;\n" +
 			"}");
 		moduleLoc = srcDir + File.separator + "org.astro";
-		writeFileCollecting(files, moduleLoc, "module-info.java", 
+		writeFile(moduleLoc, "module-info.java", 
 				"module org.astro {\n" +
 				"	exports org.astro;\n" +
 				"}");
-		writeFileCollecting(files, moduleLoc + File.separator + "org" + File.separator + "astro", "World.java", 
+		writeFile(moduleLoc + File.separator + "org" + File.separator + "astro", "World.java", 
 			"package org.astro;\n" +
 			"public interface World {\n" + 
 			"	public static String name() {\n" + 
 			"		return \"\";\n" + 
 			"	}\n" + 
 			"}");
-		StringBuffer buffer = new StringBuffer();
-		buffer.append("-d " + outDir )
+		runner.commandLine.append("-d " + outDir )
 			.append(" -source 9 ")
-			.append(" --module-source-path " + "\"" + srcDir + "\" ")
-			.append(srcDir + File.separator + "test" + File.separator + "p" + File.separator + "Test.java");
-		runConformModuleTest(Collections.emptyList(), buffer,
-				"",
-				"",
-				false);
+			.append(" --module-source-path " + "\"" + srcDir + "\" ");
+		runner.javacVersionOptions = " -Xlint:-options";
+		runner.runConformModuleTest();
 	}
 	public void testBug520858b() {
 		Util.flushDirectoryContent(new File(OUTPUT_DIR));
 		String outDir = OUTPUT_DIR + File.separator + "bin";
 		String srcDir = OUTPUT_DIR + File.separator + "src";
 		String moduleLoc = srcDir + File.separator + "test";
-		List<String> files = new ArrayList<>(); 
-		writeFileCollecting(files, moduleLoc, "module-info.java", 
+		Runner runner = new Runner();
+		runner.createFile(moduleLoc, "module-info.java", 
 						"module test {\n" +
 						"	requires org.astro;\n" +
 						"}");
-		writeFileCollecting(files, moduleLoc + File.separator + "p", "Test.java", 
+		runner.createFile(moduleLoc + File.separator + "p", "Test.java", 
 			"package p;\n" +
 			"import org.astro.World;\n" + 
 			"public class Test {\n" +
 			"	World w = null;\n" +
 			"}");
 		moduleLoc = srcDir + File.separator + "org.astro";
-		writeFileCollecting(files, moduleLoc, "module-info.java", 
+		// not adding this file to the command line (intentional?):
+		writeFile(moduleLoc, "module-info.java", 
 				"module org.astro {\n" +
 				"	exports org.astro;\n" +
 				"}");
-		writeFileCollecting(files, moduleLoc + File.separator + "org" + File.separator + "astro", "World.java", 
+		runner.createFile(moduleLoc + File.separator + "org" + File.separator + "astro", "World.java", 
 			"package org.astro;\n" +
 			"public interface World {\n" + 
 			"	public static String name() {\n" + 
 			"		return \"\";\n" + 
 			"	}\n" + 
 			"}");
-		StringBuffer buffer = new StringBuffer();
-		buffer.append("-d " + outDir )
+		runner.commandLine.append("-d " + outDir )
 			.append(" -source 9 ")
-			.append(" --module-source-path " + "\"" + srcDir + "\" ")
-			.append(srcDir + File.separator + "test" + File.separator + "p" + File.separator + "Test.java ")
-			.append(srcDir + File.separator + "test" + File.separator + "module-info.java ")
-			.append(srcDir + File.separator + "org.astro" + File.separator + "org" + File.separator + "astro" + File.separator + "World.java");
-		runConformModuleTest(Collections.emptyList(), buffer,
-				"",
-				"",
-				false);
+			.append(" --module-source-path " + "\"" + srcDir + "\" ");
+		runner.javacVersionOptions = " -Xlint:-options";
+		runner.runConformModuleTest();
 	}
 	public void testBug520858c() {
 		Util.flushDirectoryContent(new File(OUTPUT_DIR));
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java
index b6b3a1e..49f2c69 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java
@@ -16,6 +16,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.core.tests.util.Util;
 import org.eclipse.jdt.internal.compiler.CompilationResult;
@@ -23,6 +24,7 @@
 import org.eclipse.jdt.internal.compiler.batch.BasicModule;
 import org.eclipse.jdt.internal.compiler.batch.CompilationUnit;
 import org.eclipse.jdt.internal.compiler.batch.FileSystem;
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
 import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
 import org.eclipse.jdt.internal.compiler.env.IModule;
 import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
@@ -356,4 +358,71 @@
 			"----------\n";
 		runner.runNegativeTest();
 	}
+	public void testBug536037a() {
+		if (this.complianceLevel < ClassFileConstants.JDK10) return;
+		runConformTestWithLibs(
+			new String[] {
+				"Bar.java",
+				"@org.eclipse.jdt.annotation.NonNullByDefault\n" + 
+				"public class Bar {\n" + 
+				"    static void bar(Iterable<String> list) {\n" + 
+				"        for(var s : list);\n" + 
+				"    }\n" + 
+				"}\n"
+			},
+			null,
+			"");
+	}
+	public void testBug536037b() {
+		// tests combination of declaration null-annotations & 'var':
+		if (this.complianceLevel < ClassFileConstants.JDK10) return;
+		Map<String, String> options = getCompilerOptions();
+		options.put(JavaCore.COMPILER_NONNULL_ANNOTATION_NAME, "test.NonNull");
+		options.put(JavaCore.COMPILER_NULLABLE_ANNOTATION_NAME, "test.Nullable");
+		runNegativeTestWithLibs(
+			new String[] {
+				"test/NonNull.java",
+				"package test;\n" +
+				"import java.lang.annotation.*;\n" +
+				"@Target({ElementType.LOCAL_VARIABLE,ElementType.PARAMETER}) public @interface NonNull {}\n",
+				"test/Nullable.java",
+				"package test;\n" +
+				"import java.lang.annotation.*;\n" +
+				"@Target({ElementType.LOCAL_VARIABLE,ElementType.PARAMETER}) public @interface Nullable {}\n",
+				"Bar.java",
+				"import test.*;\n" +
+				"public class Bar {\n" + 
+				"    static void bar1(@Nullable String s1, Iterable<String> list) {\n" + 
+				"		@NonNull var s2 = s1;\n" +
+				"		for (@NonNull var s : list);\n" +
+				"	 }\n" + 
+				"    static void bar2(int[] array) {\n" + 
+				"		@NonNull var i1 = 3;\n" +
+				"		for (@NonNull var s : array);\n" +
+				"	 }\n" + 
+				"}\n"
+			},
+			options,
+			"----------\n" + 
+			"1. ERROR in Bar.java (at line 4)\n" + 
+			"	@NonNull var s2 = s1;\n" + 
+			"	                  ^^\n" + 
+			"Null type mismatch: required \'@NonNull String\' but the provided value is specified as @Nullable\n" + 
+			"----------\n" + 
+			"2. WARNING in Bar.java (at line 5)\n" + 
+			"	for (@NonNull var s : list);\n" + 
+			"	                      ^^^^\n" + 
+			"Null type safety: The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" + 
+			"----------\n" + 
+			"3. ERROR in Bar.java (at line 8)\n" + 
+			"	@NonNull var i1 = 3;\n" + 
+			"	^^^^^^^^\n" + 
+			"The nullness annotation @NonNull is not applicable for the primitive type int\n" + 
+			"----------\n" + 
+			"4. ERROR in Bar.java (at line 9)\n" + 
+			"	for (@NonNull var s : array);\n" + 
+			"	     ^^^^^^^^\n" + 
+			"The nullness annotation @NonNull is not applicable for the primitive type int\n" + 
+			"----------\n");
+	}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java
index 8c3ac2f..5e322c6 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java
@@ -18202,4 +18202,36 @@
 		"not dead"
 	);
 }
+public void testBug536408() {
+	if (this.complianceLevel < ClassFileConstants.JDK1_5)
+		return; // uses auto unboxing
+	Runner runner = new Runner();
+	runner.testFiles =
+		new String[] {
+			"X.java",
+			"public class X {\n" + 
+			"    public static void main(String[] args) {\n" + 
+			"        Long s1 = null;\n" + 
+			"        long t = 0;\n" + 
+			"        t += s1;\n" +
+			"		 Long s2 = t > 0 ? 1l : null;\n" +
+			"		 t += s2;\n" + 
+			"    }\n" + 
+			"}\n"
+		};
+	runner.expectedCompilerLog =
+		"----------\n" + 
+		"1. ERROR in X.java (at line 5)\n" + 
+		"	t += s1;\n" + 
+		"	     ^^\n" + 
+		"Null pointer access: This expression of type Long is null but requires auto-unboxing\n" + 
+		"----------\n" + 
+		"2. ERROR in X.java (at line 7)\n" + 
+		"	t += s2;\n" + 
+		"	     ^^\n" + 
+		"Potential null pointer access: This expression of type Long may be null but requires auto-unboxing\n" + 
+		"----------\n";
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
+}
 }
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java
index 3e4a2bc..1c4a152 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java
@@ -164,7 +164,8 @@
 
 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 public void testBug127575b() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -172,20 +173,24 @@
 				"    org.eclipse.core.runtime.Assert.isLegal(o == null);\n" + 	// forces null
 				"    o.toString();\n" + 		// can only be null
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 		"----------\n" +
 		"1. ERROR in X.java (at line 4)\n" +
 		"	o.toString();\n" +
 		"	^\n" +
 		"Null pointer access: The variable o can only be null at this location\n" +
-		"----------\n",
-		this.assertLib,
-		true);
+		"----------\n";
+	runner.classLibraries =
+		this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 
 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 public void testBug127575c() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -193,20 +198,24 @@
 				"    org.eclipse.core.runtime.Assert.isLegal(o != null || b, \"FAIL\");\n" + // shed doubts
 				"    o.toString();\n" + 		// complain
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 		"----------\n" +
 		"1. ERROR in X.java (at line 4)\n" +
 		"	o.toString();\n" +
 		"	^\n" +
 		"Potential null pointer access: The variable o may be null at this location\n" +
-		"----------\n",
-	    this.assertLib,
-	    true);
+		"----------\n";
+	runner.classLibraries =
+	    this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 public void testBug127575d() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -215,7 +224,8 @@
 				"    if (o1 == null) { };\n" + 		// complain
 				"    if (o2 == null) { };\n" + 		// complain
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 			"----------\n" + 
 			"1. ERROR in X.java (at line 4)\n" + 
 			"	if (o1 == null) { };\n" + 
@@ -231,14 +241,17 @@
 			"	if (o2 == null) { };\n" + 
 			"	    ^^\n" + 
 			"Redundant null check: The variable o2 can only be null at this location\n" + 
-			"----------\n",
-		    this.assertLib,
-		    true);
+			"----------\n";
+	runner.classLibraries =
+		    this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 public void testBug127575e() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -246,18 +259,23 @@
 				"    org.eclipse.core.runtime.Assert.isLegal(false && o != null);\n" +
 				"    if (o == null) { };\n" + 		// quiet
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 				"----------\n" + 
 				"1. WARNING in X.java (at line 3)\n" + 
 				"	org.eclipse.core.runtime.Assert.isLegal(false && o != null);\n" + 
 				"	                                                 ^^^^^^^^^\n" + 
 				"Dead code\n" + 
-				"----------\n",
-				this.assertLib, true);
+				"----------\n";
+	runner.classLibraries =
+				this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
+	runner.runConformTest();
 }
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 public void testBug127575e_1() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -266,7 +284,8 @@
 				"    org.eclipse.core.runtime.Assert.isLegal(false && o != null);\n" +
 				"    if (o == null) { };\n" + 		// warn on o because o was null above.
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 				"----------\n" + 
 				"1. WARNING in X.java (at line 4)\n" + 
 				"	org.eclipse.core.runtime.Assert.isLegal(false && o != null);\n" + 
@@ -277,13 +296,17 @@
 				"	if (o == null) { };\n" + 
 				"	    ^\n" + 
 				"Redundant null check: The variable o can only be null at this location\n" + 
-				"----------\n",
-				this.assertLib, true);
+				"----------\n";
+	runner.classLibraries =
+				this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 public void testBug127575e_2() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -291,18 +314,23 @@
 				"    org.eclipse.core.runtime.Assert.isLegal(true || o != null);\n" +
 				"    if (o == null) { };\n" + 		// quiet
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 				"----------\n" + 
 				"1. WARNING in X.java (at line 3)\n" + 
 				"	org.eclipse.core.runtime.Assert.isLegal(true || o != null);\n" + 
 				"	                                                ^^^^^^^^^\n" + 
 				"Dead code\n" + 
-				"----------\n",
-				this.assertLib, true);
+				"----------\n";
+	runner.classLibraries =
+				this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
+	runner.runConformTest();
 }
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 public void testBug127575f() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -310,7 +338,8 @@
 				"    org.eclipse.core.runtime.Assert.isLegal(false || o != null);\n" +
 				"    if (o == null) { };\n" + 		// complain
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 		"----------\n" + 
 		"1. ERROR in X.java (at line 4)\n" + 
 		"	if (o == null) { };\n" + 
@@ -321,14 +350,18 @@
 		"	if (o == null) { };\n" + 
 		"	               ^^^\n" + 
 		"Dead code\n" + 
-		"----------\n",
-	    this.assertLib, true);
+		"----------\n";
+	runner.classLibraries =
+	    this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 // do warn always false comparisons even inside org.eclipse.core.runtime.Assert.isLegal
 public void testBug127575g() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -337,7 +370,8 @@
 				"    org.eclipse.core.runtime.Assert.isLegal(o != null);\n" +    // don't complain
 				"    if (o == null) { };\n" +   // complain
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 		"----------\n" + 
 		"1. ERROR in X.java (at line 4)\n" + 
 		"	org.eclipse.core.runtime.Assert.isLegal(o != null);\n" + 
@@ -353,15 +387,19 @@
 		"	if (o == null) { };\n" + 
 		"	               ^^^\n" + 
 		"Dead code\n" + 
-		"----------\n",
-		this.assertLib, true);
+		"----------\n";
+	runner.classLibraries =
+		this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 // Test to verify that asserts are exempted from redundant null check warnings,
 // but this doesn't affect the downstream info.
 public void testBug127575h() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -379,7 +417,8 @@
 				"	 org.eclipse.core.runtime.Assert.isLegal (bar2 != null);\n" +	// always false check - warn
 				"	 if (bar2 == null) {}\n" +
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 		"----------\n" + 
 		"1. ERROR in X.java (at line 5)\n" + 
 		"	if (foo == null) {}\n" + 
@@ -420,15 +459,19 @@
 		"	if (bar2 == null) {}\n" + 
 		"	                  ^^\n" + 
 		"Dead code\n" + 
-		"----------\n",
-	    this.assertLib, true);
+		"----------\n";
+	runner.classLibraries =
+	    this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 // Test to verify that asserts are exempted from redundant null check warnings,
 // but this doesn't affect the downstream info.
 public void testBug127575i() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -443,7 +486,8 @@
 				"	 if (bar == null) {}\n" +		// warn
 				"  }\n" +
 				"  public X getX() { return new X();}\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 		"----------\n" +
 		"1. ERROR in X.java (at line 9)\n" + 
 		"	if (foo != null) {}\n" + 
@@ -454,15 +498,19 @@
 		"	if (bar == null) {}\n" + 
 		"	    ^^^\n" + 
 		"Redundant null check: The variable bar can only be null at this location\n" + 
-		"----------\n",
-	    this.assertLib, true);
+		"----------\n";
+	runner.classLibraries =
+	    this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 // Test to verify that asserts are exempted from redundant null check warnings in a looping context,
 // but this doesn't affect the downstream info.
 public void testBug127575j() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -482,7 +530,8 @@
 				"	 	if (bar2 == null) {}\n" +
 				"	 }\n" +
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 		"----------\n" + 
 		"1. ERROR in X.java (at line 9)\n" + 
 		"	if (foo == null) {}\n" + 
@@ -523,15 +572,19 @@
 		"	if (bar2 == null) {}\n" + 
 		"	                  ^^\n" + 
 		"Dead code\n" + 
-		"----------\n",
-	    this.assertLib, true);
+		"----------\n";
+	runner.classLibraries =
+	    this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 // Test to verify that asserts are exempted from redundant null check warnings in a finally context,
 // but this doesn't affect the downstream info.
 public void testBug127575k() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -554,7 +607,8 @@
 				"	 	if (bar2 == null) {}\n" +
 				"	 }\n" +
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 		"----------\n" + 
 		"1. ERROR in X.java (at line 12)\n" + 
 		"	if (foo == null) {}\n" + 
@@ -595,15 +649,19 @@
 		"	if (bar2 == null) {}\n" + 
 		"	                  ^^\n" + 
 		"Dead code\n" + 
-		"----------\n",
-	    this.assertLib, true);
+		"----------\n";
+	runner.classLibraries =
+	    this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 // The condition of org.eclipse.core.runtime.Assert.isLegal is considered always true
 // and alters the following analysis suitably.
 public void testBug127575l() {
-		this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 			new String[] {
 				"Test.java",
 				"public class Test {\n" +
@@ -633,7 +691,8 @@
 				"		Test test = new Test();\n" +
 				"		test.foo(null,null, null);\n" +
 				"	}\n" +
-				"}\n"},
+				"}\n"};
+	runner.expectedCompilerLog =
 			"----------\n" + 
 			"1. ERROR in Test.java (at line 4)\n" + 
 			"	if (a!=null) {\n" + 
@@ -673,14 +732,18 @@
 			"	if (c.equals(a)) {\n" + 
 			"	    ^\n" + 
 			"Null pointer access: The variable c can only be null at this location\n" + 
-			"----------\n",
-			this.assertLib, true);
+			"----------\n";
+	runner.classLibraries =
+			this.assertLib;
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127575
 // NPE warnings should be given inside org.eclipse.core.runtime.Assert.isLegal too
 public void testBug127575m() {
 	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
-		this.runNegativeTest(
+		Runner runner = new Runner();
+		runner.testFiles =
 			new String[] {
 				"Info.java",
 				"public class Info {\n" +
@@ -700,15 +763,18 @@
 				"	}\n" +
 				"	void doSomething()  {}\n" +
 				"	boolean checkSomething() {return true;}\n" +
-				"}\n"},
+				"}\n"};
+		runner.expectedCompilerLog =
 				"----------\n" + 
 			"1. ERROR in Info.java (at line 11)\n" + 
 			"	org.eclipse.core.runtime.Assert.isLegal(info.checkSomething());\n" + 
 			"	                                        ^^^^\n" + 
 			"Null pointer access: The variable info can only be null at this location\n" + 
-			"----------\n",
-			this.assertLib,
-			true);
+			"----------\n";
+		runner.classLibraries =
+			this.assertLib;
+		runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+		runner.runNegativeTest();
 	}
 }
 
@@ -716,7 +782,8 @@
 // always false comparison in Assert.isLegal in loop should be warned against
 public void testBug127575n() {
 	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
-		this.runNegativeTest(
+		Runner runner = new Runner();
+		runner.testFiles =
 			new String[] {
 		"DoWhileBug.java",
 				"public class DoWhileBug {\n" + 
@@ -730,7 +797,8 @@
 				"		} while (true);\n" + 
 				"	}\n" + 
 				"}"	
-			},
+			};
+		runner.expectedCompilerLog =
 			"----------\n" + 
 			"1. ERROR in DoWhileBug.java (at line 7)\n" + 
 			"	o1 = null;\n" + 
@@ -741,9 +809,11 @@
 			"	org.eclipse.core.runtime.Assert.isLegal (o1 != null);\n" + 
 			"	                                         ^^\n" + 
 			"Null comparison always yields false: The variable o1 can only be null at this location\n" + 
-			"----------\n",
-			this.assertLib,
-			true);
+			"----------\n";
+		runner.classLibraries =
+			this.assertLib;
+		runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+		runner.runNegativeTest();
 	}
 }
 
@@ -751,7 +821,8 @@
 // "redundant null check" in Assert.isLegal in loop should not be warned against
 public void testBug127575o() {
 	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
-		this.runNegativeTest(
+		Runner runner = new Runner();
+		runner.testFiles =
 			new String[] {
 		"DoWhileBug.java",
 				"public class DoWhileBug {\n" + 
@@ -765,21 +836,26 @@
 				"		} while (true);\n" + 
 				"	}\n" + 
 				"}"	
-			},
+			};
+		runner.expectedCompilerLog =
 			"----------\n" + 
 			"1. ERROR in DoWhileBug.java (at line 7)\n" + 
 			"	o1 = null;\n" + 
 			"	^^\n" + 
 			"Redundant assignment: The variable o1 can only be null at this location\n" + 
-			"----------\n",
-			this.assertLib,
-			true);
+			"----------\n";
+		runner.classLibraries =
+			this.assertLib;
+		runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+		runner.runNegativeTest();
 	}
 }
 
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=373953
 public void testBug373953() throws IOException {
-		this.runNegativeTest(
+	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
+		Runner runner = new Runner();
+		runner.testFiles =
 			new String[] {
 				"X.java",
 				"public class X {\n" +
@@ -805,7 +881,8 @@
 				"public class Assert {\n" +
 				"  public static void isLegal(boolean b) {\n" +
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+		runner.expectedCompilerLog =
 			"----------\n" + 
 			"1. ERROR in X.java (at line 5)\n" + 
 			"	o.toString();\n" + 
@@ -816,7 +893,10 @@
 			"	o.toString();\n" + 
 			"	^\n" + 
 			"Potential null pointer access: The variable o may be null at this location\n" + 
-			"----------\n");
+			"----------\n";
+		runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+		runner.runNegativeTest();
+	}
 }
 
 // https://bugs.eclipse.org/382069 - [null] Make the null analysis consider JUnit's assertNotNull similarly to assertions
@@ -868,7 +948,8 @@
 // https://bugs.eclipse.org/382069 - [null] Make the null analysis consider JUnit's assertNotNull similarly to assertions
 // junit's assertNull and dead code analysis
 public void testBug382069c() throws IOException {
-	this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 		new String[] {
 			JUNIT_ASSERT_NAME,
 			JUNIT_ASSERT_CONTENT,
@@ -887,7 +968,8 @@
 			"      return; // dead code\n" +
 			"    }\n" +
 			"  }\n" +
-			"}\n"},
+			"}\n"};
+	runner.expectedCompilerLog =
 			"----------\n" + 
 			"1. ERROR in X.java (at line 5)\n" + 
 			"	return o1 != null;\n" + 
@@ -903,12 +985,15 @@
 			"	return; // dead code\n" + 
 			"	^^^^^^^\n" + 
 			"Dead code\n" + 
-			"----------\n");
+			"----------\n";
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 // https://bugs.eclipse.org/382069 - [null] Make the null analysis consider JUnit's assertNotNull similarly to assertions
 // various asserts from org.apache.commons.lang.Validate
 public void testBug382069d() throws IOException {
-	this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 		new String[] {
 			APACHE_VALIDATE_NAME,
 			APACHE_VALIDATE_CONTENT,
@@ -925,19 +1010,23 @@
 			"    Validate.isTrue(x == null, \"ups\", x);\n" +
 			"    x.foo(null, null, null); // definite NPE\n" +
 			"  }\n" +
-			"}\n"},
+			"}\n"};
+	runner.expectedCompilerLog =
 			"----------\n" + 
 			"1. ERROR in X.java (at line 11)\n" + 
 			"	x.foo(null, null, null); // definite NPE\n" + 
 			"	^\n" + 
 			"Null pointer access: The variable x can only be null at this location\n" + 
-			"----------\n");
+			"----------\n";
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+	runner.runNegativeTest();
 }
 // https://bugs.eclipse.org/382069 - [null] Make the null analysis consider JUnit's assertNotNull similarly to assertions
 // various asserts from org.apache.commons.lang3Validate
 public void testBug382069e() throws IOException {
 	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
-		this.runNegativeTest(
+		Runner runner = new Runner();
+		runner.testFiles =
 			new String[] {
 				APACHE_3_VALIDATE_NAME,
 				APACHE_3_VALIDATE_CONTENT,
@@ -954,20 +1043,24 @@
 				"    Validate.isTrue(x == null, \"ups\", x);\n" +
 				"    x.foo(null, null, null); // definite NPE\n" +
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+		runner.expectedCompilerLog =
 				"----------\n" + 
 				"1. ERROR in X.java (at line 11)\n" + 
 				"	x.foo(null, null, null); // definite NPE\n" + 
 				"	^\n" + 
 				"Null pointer access: The variable x can only be null at this location\n" + 
-				"----------\n");
+				"----------\n";
+		runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+		runner.runNegativeTest();
 	}
 }
 // https://bugs.eclipse.org/382069 - [null] Make the null analysis consider JUnit's assertNotNull similarly to assertions
 // various asserts from com.google.common.base.Preconditions
 public void testBug382069f() throws IOException {
 	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
-		this.runNegativeTest(
+		Runner runner = new Runner();
+		runner.testFiles =
 			new String[] {
 				GOOGLE_PRECONDITIONS_NAME,
 				GOOGLE_PRECONDITIONS_CONTENT,
@@ -984,13 +1077,16 @@
 				"    Preconditions.checkArgument(x == null, \"ups\");\n" +
 				"    x.foo(null, null, null); // definite NPE\n" +
 				"  }\n" +
-				"}\n"},
+				"}\n"};
+		runner.expectedCompilerLog =
 				"----------\n" + 
 				"1. ERROR in X.java (at line 11)\n" + 
 				"	x.foo(null, null, null); // definite NPE\n" + 
 				"	^\n" + 
 				"Null pointer access: The variable x can only be null at this location\n" + 
-				"----------\n");
+				"----------\n";
+		runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+		runner.runNegativeTest();
 	}
 }
 // https://bugs.eclipse.org/382069 - [null] Make the null analysis consider JUnit's assertNotNull similarly to assertions
@@ -1038,7 +1134,8 @@
 // Bug 401159 - [null] Respect org.junit.Assert for control flow
 // various asserts from org.junit.Assert
 public void testBug401159() throws IOException {
-	this.runNegativeTest(
+	Runner runner = new Runner();
+	runner.testFiles =
 		new String[] {
 			ORG_JUNIT_ASSERT_NAME,
 			ORG_JUNIT_ASSERT_CONTENT,
@@ -1055,13 +1152,15 @@
 			"    Assert.assertTrue(\"ups\", x == null);\n" +
 			"    x.foo(null, null, null); // definite NPE\n" +
 			"  }\n" +
-			"}\n"},
+			"}\n"};
+	runner.expectedCompilerLog =
 			"----------\n" + 
 			"1. ERROR in X.java (at line 11)\n" + 
 			"	x.foo(null, null, null); // definite NPE\n" + 
 			"	^\n" + 
 			"Null pointer access: The variable x can only be null at this location\n" + 
-			"----------\n");
+			"----------\n";
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
 }
 
 // https://bugs.eclipse.org/472618 - [compiler][null] assertNotNull vs. Assert.assertNotNull
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
index 65e531d..73664f9 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
@@ -17551,4 +17551,103 @@
 	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
 	runner.runWarningTest();
 }
+public void testBug534516() {
+	runConformTestWithLibs(
+			new String[] {
+				"testbug/nullannotations/Utility.java",
+				"package testbug.nullannotations;\n" +
+				"\n" +
+				"import org.eclipse.jdt.annotation.NonNullByDefault;\n" +
+				"\n" +
+				"@NonNullByDefault\n" +
+				"public class Utility {\n" +
+				"\n" +
+				"	public static String massageString(final String input) {\n" +
+				"		return input + \" .\";\n" +
+				"	}\n" +
+				"\n" +
+				"	private Utility() {\n" +
+				"\n" +
+				"	}\n" +
+				"\n" +
+				"}\n" +
+				"",
+			}, 
+			getCompilerOptions(),
+			""
+		);
+	runConformTestWithLibs(
+			false,
+			new String[] {
+				"testbug/nullannotations/ApplyIfNonNullElseGetBugDemo.java",
+				"package testbug.nullannotations;\n" +
+				"\n" +
+				"import java.util.function.Function;\n" +
+				"import org.eclipse.jdt.annotation.NonNull;\n" +
+				"import org.eclipse.jdt.annotation.Nullable;\n" +
+				"\n" +
+				"public class ApplyIfNonNullElseGetBugDemo {\n" +
+				"\n" +
+				"	public static <T, U> U applyIfNonNullElse(@Nullable T value, @NonNull Function<@NonNull ? super T, ? extends U> function, U fallbackValue) {\n" + 
+				"		if (value != null)\n" + 
+				"			return function.apply(value);\n" + 
+				"		return fallbackValue;\n" + 
+				"	}\n" + 
+				"\n" +
+				"	public static void main(final @Nullable String[] args) {\n" +
+				"		final @Nullable String arg = args.length == 0 ? null : args[0];\n" +
+				"		System.out.println(applyIfNonNullElse(arg, Utility::massageString, \"\")); // incorrect warning here\n" +
+				"	}\n" +
+				"\n" +
+				"}\n" +
+				"",
+			}, 
+			getCompilerOptions(),
+			""
+		);
+}
+public void testBug536459() {
+	runConformTestWithLibs(
+			new String[] {
+				"X.java",
+				"import org.eclipse.jdt.annotation.Nullable;\n" + 
+				"\n" + 
+				"public class X {\n" + 
+				"    static void x() {\n" + 
+				"        @Nullable String x1 = \"\";\n" + 
+				"        @Nullable String[] x2 = { \"\" };\n" + 
+				"    }\n" + 
+				"}\n"
+			},
+			getCompilerOptions(),
+			"");
+}
+public void testBug536555() {
+	Runner runner = new Runner();
+	runner.customOptions = getCompilerOptions();
+	runner.customOptions.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED);
+	runner.testFiles =
+			new String[] {
+				"Foo.java",
+				"public class Foo\n" + 
+				"{\n" + 
+				"	/** Test {@link #foo(boolean)}. */\n" + 
+				"	public static final String TEST = \"foo\";\n" + 
+				"\n" + 
+				"	public void foo(@SuppressWarnings(TEST) final boolean test)\n" + 
+				"	{\n" + 
+				"		System.out.println(test);\n" + 
+				"	}\n" + 
+				"}\n"
+			};
+	runner.expectedCompilerLog =
+			"----------\n" + 
+			"1. WARNING in Foo.java (at line 6)\n" + 
+			"	public void foo(@SuppressWarnings(TEST) final boolean test)\n" + 
+			"	                                  ^^^^\n" + 
+			"Unsupported @SuppressWarnings(\"foo\")\n" + 
+			"----------\n";
+	runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings;
+	runner.runWarningTest();
+}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java
index a6fcaaf..66ff0f6 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java
@@ -68,8 +68,9 @@
 				"		Y.count(new int[] {1, 2, 3, 4 });\n" +
 				"		System.out.print('>');\n" +
 				"	}\n" +
-				"}\n" +
-				"class Y {\n" +
+				"}\n",
+				"Y.java",
+				"public class Y {\n" +
 				"	public Y(int ... values) {\n" +
 				"		int result = 0;\n" +
 				"		for (int i = 0, l = values == null ? 0 : values.length; i < l; i++)\n" +
@@ -128,8 +129,9 @@
 				"		y = new Y(new int[] {1, 2, 3, 4 });\n" +
 				"		System.out.print('>');\n" +
 				"	}\n" +
-				"}\n" +
-				"class Y extends Z {\n" +
+				"}\n",
+				"Y.java",
+				"public class Y extends Z {\n" +
 				"	public Y(int ... values) { super(values); }\n" +
 				"}\n" +
 				"class Z {\n" +
@@ -179,8 +181,9 @@
 				"		Y.count(new int[][] {new int[] {1, 2, 3}, new int[] {4}});\n" +
 				"		System.out.print('>');\n" +
 				"	}\n" +
-				"}\n" +
-				"class Y {\n" +
+				"}\n",
+				"Y.java",
+				"public class Y {\n" +
 				"	public static int count(int[] values) {\n" +
 				"		int result = 0;\n" +
 				"		for (int i = 0, l = values == null ? 0 : values.length; i < l; i++)\n" +
@@ -237,8 +240,9 @@
 				"		Y.count((byte) 4, new int[][] {new int[] {1}, new int[] {2, 3}, new int[] {4}});\n" +
 				"		System.out.print('>');\n" +
 				"	}\n" +
-				"}\n" +
-				"class Y {\n" +
+				"}\n",
+				"Y.java",
+				"public class Y {\n" +
 				"	public static int count(int j, int[] values) {\n" +
 				"		int result = j;\n" +
 				"		System.out.print(' ');\n" +
@@ -293,13 +297,14 @@
 				"	public static void main(String[] s) {\n" +
 				"		System.out.print('<');\n" +
 				"		Y.print();\n" +
-				"		Y.print(new Integer(1));\n" +
-				"		Y.print(new Integer(1), new Byte((byte) 3), new Integer(7));\n" +
-				"		Y.print(new Integer[] {new Integer(11) });\n" +
+				"		Y.print(Integer.valueOf(1));\n" +
+				"		Y.print(Integer.valueOf(1), Byte.valueOf((byte) 3), Integer.valueOf(7));\n" +
+				"		Y.print(new Integer[] {Integer.valueOf(11) });\n" +
 				"		System.out.print('>');\n" +
 				"	}\n" +
-				"}\n" +
-				"class Y {\n" +
+				"}\n",
+				"Y.java",
+				"public class Y {\n" +
 				"	public static void print(Number ... values) {\n" +
 				"		for (int i = 0, l = values.length; i < l; i++) {\n" +
 				"			System.out.print(' ');\n" +
@@ -317,9 +322,9 @@
 				"	public static void main(String[] s) {\n" +
 				"		System.out.print('<');\n" +
 				"		Y.print();\n" +
-				"		Y.print(new Integer(1));\n" +
-				"		Y.print(new Integer(1), new Byte((byte) 3), new Integer(7));\n" +
-				"		Y.print(new Integer[] {new Integer(11) });\n" +
+				"		Y.print(Integer.valueOf(1));\n" +
+				"		Y.print(Integer.valueOf(1), Byte.valueOf((byte) 3), Integer.valueOf(7));\n" +
+				"		Y.print(new Integer[] {Integer.valueOf(11) });\n" +
 				"		System.out.print('>');\n" +
 				"	}\n" +
 				"}\n",
@@ -338,7 +343,7 @@
 				"	public static void main(String[] s) {\n" +
 				"		String[] T_NAMES = new String[] {\"foo\"};\n" +
 				"		String error = \"error\";\n" +
-				"		Y.format(\"E_UNSUPPORTED_CONV\", new Integer(0));\n" +
+				"		Y.format(\"E_UNSUPPORTED_CONV\", Integer.valueOf(0));\n" +
 				"		Y.format(\"E_SAVE\", T_NAMES[0], error);\n" +
 				"	}\n" +
 				"}\n" +
@@ -618,8 +623,8 @@
 				"public class X {\n" +
 				"	public static void main(String[] s) {\n" +
 				"		System.out.print('<');\n" +
-				"		Y.count((Object) new Integer(1));\n" +
-				"		Y.count(new Integer(1));\n" +
+				"		Y.count((Object) Integer.valueOf(1));\n" +
+				"		Y.count(Integer.valueOf(1));\n" +
 				"\n" +
 				"		Y.count((Object) null);\n" +
 				"		Y.count((Object[]) null);\n" +
@@ -639,8 +644,8 @@
 				"public class X {\n" +
 				"	public static void main(String[] s) {\n" +
 				"		System.out.print('<');\n" +
-				"		Y.count(new Object[] {new Integer(1)});\n" +
-				"		Y.count(new Integer[] {new Integer(1)});\n" +
+				"		Y.count(new Object[] {Integer.valueOf(1)});\n" +
+				"		Y.count(new Integer[] {Integer.valueOf(1)});\n" +
 				"\n" +
 				"		Y.count((Object[]) null);\n" +
 				"		Y.count((Object[][]) null);\n" +
@@ -1215,7 +1220,7 @@
 				"import java.io.Serializable;\n" +
 				"public class X {\n" +
 				"	public static void main(String[] args) {\n" +
-				"		audit(\"osvaldo\", \"localhost\", \"logged\", \"X\", new Integer(0));\n" +
+				"		audit(\"osvaldo\", \"localhost\", \"logged\", \"X\", Integer.valueOf(0));\n" +
 				"		audit(\"osvaldo\", \"localhost\", \"logged\", \"X\", \"Y\");\n" +
 				"		audit(\"osvaldo\", \"localhost\", \"logged\", new Float(0), new java.awt.Point(0, 0));\n" +
 				"	}\n" +
@@ -2335,7 +2340,7 @@
 				"	}\r\n" + 
 				"	\r\n" + 
 				"	Object foo(final Float f) {\r\n" + 
-				"		return new A(new Integer(0), CONST) {\r\n" + 
+				"		return new A(Integer.valueOf(0), CONST) {\r\n" + 
 				"			public String toString() {\r\n" + 
 				"				return f.toString();\r\n" + 
 				"			}\r\n" + 
@@ -2355,17 +2360,6 @@
 		if (this.complianceLevel < ClassFileConstants.JDK1_7) return;
 		this.runConformTest(
 			new String[] {
-				"java/lang/SafeVarargs.java",
-				"package java.lang;\n" +
-				"import java.lang.annotation.Retention;\n" + 
-				"import java.lang.annotation.Target;\n" + 
-				"import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" + 
-				"import static java.lang.annotation.ElementType.CONSTRUCTOR;\n" + 
-				"import static java.lang.annotation.ElementType.METHOD;\n" + 
-				"\n" + 
-				"@Retention(value=RUNTIME)\n" + 
-				"@Target(value={CONSTRUCTOR,METHOD})\n" + 
-				"public @interface SafeVarargs {}",
 				"Y.java",
 				"import java.util.ArrayList;\n" +
 				"import java.util.List;\n" +
@@ -2399,21 +2393,6 @@
 	}
 	public void test064() throws Exception {
 		if (this.complianceLevel < ClassFileConstants.JDK1_7) return;
-		this.runConformTest(
-			new String[] {
-				"java/lang/SafeVarargs.java",
-				"package java.lang;\n" +
-				"import java.lang.annotation.Retention;\n" + 
-				"import java.lang.annotation.Target;\n" + 
-				"import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" + 
-				"import static java.lang.annotation.ElementType.CONSTRUCTOR;\n" + 
-				"import static java.lang.annotation.ElementType.METHOD;\n" + 
-				"\n" + 
-				"@Retention(value=RUNTIME)\n" + 
-				"@Target(value={CONSTRUCTOR,METHOD})\n" + 
-				"public @interface SafeVarargs {}",
-			},
-			"");
 		Map options = getCompilerOptions();
 		options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.ERROR);
 		this.runConformTest(
@@ -2440,21 +2419,6 @@
 	}
 	public void test065() throws Exception {
 		if (this.complianceLevel < ClassFileConstants.JDK1_7) return;
-		this.runConformTest(
-			new String[] {
-				"java/lang/SafeVarargs.java",
-				"package java.lang;\n" +
-				"import java.lang.annotation.Retention;\n" + 
-				"import java.lang.annotation.Target;\n" + 
-				"import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" + 
-				"import static java.lang.annotation.ElementType.CONSTRUCTOR;\n" + 
-				"import static java.lang.annotation.ElementType.METHOD;\n" + 
-				"\n" + 
-				"@Retention(value=RUNTIME)\n" + 
-				"@Target(value={CONSTRUCTOR,METHOD})\n" + 
-				"public @interface SafeVarargs {}",
-			},
-			"");
 		Map options = getCompilerOptions();
 		options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.ERROR);
 		this.runConformTest(
@@ -2532,21 +2496,6 @@
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337799
 	public void test067() throws Exception {
 		if (this.complianceLevel < ClassFileConstants.JDK1_7) return;
-		this.runConformTest(
-			new String[] {
-				"java/lang/SafeVarargs.java",
-				"package java.lang;\n" +
-				"import java.lang.annotation.Retention;\n" + 
-				"import java.lang.annotation.Target;\n" + 
-				"import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" + 
-				"import static java.lang.annotation.ElementType.CONSTRUCTOR;\n" + 
-				"import static java.lang.annotation.ElementType.METHOD;\n" + 
-				"\n" + 
-				"@Retention(value=RUNTIME)\n" + 
-				"@Target(value={CONSTRUCTOR,METHOD})\n" + 
-				"public @interface SafeVarargs {}",
-			},
-			"");
 		Map options = getCompilerOptions();
 		options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.ERROR);
 		this.runNegativeTest(
@@ -2607,21 +2556,6 @@
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337799
 	public void test067b() throws Exception {
 		if (this.complianceLevel < ClassFileConstants.JDK1_7) return;
-		this.runConformTest(
-			new String[] {
-				"java/lang/SafeVarargs.java",
-				"package java.lang;\n" +
-				"import java.lang.annotation.Retention;\n" + 
-				"import java.lang.annotation.Target;\n" + 
-				"import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" + 
-				"import static java.lang.annotation.ElementType.CONSTRUCTOR;\n" + 
-				"import static java.lang.annotation.ElementType.METHOD;\n" + 
-				"\n" + 
-				"@Retention(value=RUNTIME)\n" + 
-				"@Target(value={CONSTRUCTOR,METHOD})\n" + 
-				"public @interface SafeVarargs {}",
-			},
-			"");
 		Map options = getCompilerOptions();
 		options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.ERROR);
 		this.runNegativeTest(
@@ -2647,21 +2581,6 @@
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795 (make sure there is no warning if vararg parameter is reifiable)
 	public void test068() throws Exception {
 		if (this.complianceLevel < ClassFileConstants.JDK1_7) return;
-		this.runConformTest(
-			new String[] {
-				"java/lang/SafeVarargs.java",
-				"package java.lang;\n" +
-				"import java.lang.annotation.Retention;\n" + 
-				"import java.lang.annotation.Target;\n" + 
-				"import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" + 
-				"import static java.lang.annotation.ElementType.CONSTRUCTOR;\n" + 
-				"import static java.lang.annotation.ElementType.METHOD;\n" + 
-				"\n" + 
-				"@Retention(value=RUNTIME)\n" + 
-				"@Target(value={CONSTRUCTOR,METHOD})\n" + 
-				"public @interface SafeVarargs {}",
-			},
-			"");
 		Map options = getCompilerOptions();
 		options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.ERROR);
 		this.runNegativeTest(
@@ -2691,21 +2610,6 @@
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795 (make sure there is a warning if vararg parameter is not reifiable)
 	public void test068b() throws Exception {
 		if (this.complianceLevel < ClassFileConstants.JDK1_7) return;
-		this.runConformTest(
-			new String[] {
-				"java/lang/SafeVarargs.java",
-				"package java.lang;\n" +
-				"import java.lang.annotation.Retention;\n" + 
-				"import java.lang.annotation.Target;\n" + 
-				"import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" + 
-				"import static java.lang.annotation.ElementType.CONSTRUCTOR;\n" + 
-				"import static java.lang.annotation.ElementType.METHOD;\n" + 
-				"\n" + 
-				"@Retention(value=RUNTIME)\n" + 
-				"@Target(value={CONSTRUCTOR,METHOD})\n" + 
-				"public @interface SafeVarargs {}",
-			},
-			"");
 		Map options = getCompilerOptions();
 		options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.ERROR);
 		this.runNegativeTest(
@@ -2750,21 +2654,6 @@
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795
 	public void test068c() throws Exception {
 		if (this.complianceLevel < ClassFileConstants.JDK1_7) return;
-		this.runConformTest(
-			new String[] {
-				"java/lang/SafeVarargs.java",
-				"package java.lang;\n" +
-				"import java.lang.annotation.Retention;\n" + 
-				"import java.lang.annotation.Target;\n" + 
-				"import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" + 
-				"import static java.lang.annotation.ElementType.CONSTRUCTOR;\n" + 
-				"import static java.lang.annotation.ElementType.METHOD;\n" + 
-				"\n" + 
-				"@Retention(value=RUNTIME)\n" + 
-				"@Target(value={CONSTRUCTOR,METHOD})\n" + 
-				"public @interface SafeVarargs {}",
-			},
-			"");
 		Map options = getCompilerOptions();
 		options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.ERROR);
 		this.runNegativeTest(
@@ -2803,21 +2692,6 @@
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795
 	public void test068d() throws Exception {
 		if (this.complianceLevel < ClassFileConstants.JDK1_7) return;
-		this.runConformTest(
-			new String[] {
-				"java/lang/SafeVarargs.java",
-				"package java.lang;\n" +
-				"import java.lang.annotation.Retention;\n" + 
-				"import java.lang.annotation.Target;\n" + 
-				"import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" + 
-				"import static java.lang.annotation.ElementType.CONSTRUCTOR;\n" + 
-				"import static java.lang.annotation.ElementType.METHOD;\n" + 
-				"\n" + 
-				"@Retention(value=RUNTIME)\n" + 
-				"@Target(value={CONSTRUCTOR,METHOD})\n" + 
-				"public @interface SafeVarargs {}",
-			},
-			"");
 		Map options = getCompilerOptions();
 		options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.ERROR);
 		this.runNegativeTest(
@@ -2848,27 +2722,12 @@
 			"2. WARNING in X.java (at line 13)\n" + 
 			"	classes = X.asList2(String.class, Boolean.class);\n" + 
 			"	          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
-			"Type safety: A generic array of Class<? extends Object&Serializable&Comparable<?>> is created for a varargs parameter\n" + 
+			"Type safety: A generic array of Class<? extends "+intersection("Object","Serializable","Comparable<?>")+"> is created for a varargs parameter\n" + 
 			"----------\n");
 	}
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795 (test effect of SuppressWarnings (should suppress at declaration site, but not at call site)
 	public void test068e() throws Exception {
 		if (this.complianceLevel < ClassFileConstants.JDK1_7) return;
-		this.runConformTest(
-			new String[] {
-				"java/lang/SafeVarargs.java",
-				"package java.lang;\n" +
-				"import java.lang.annotation.Retention;\n" + 
-				"import java.lang.annotation.Target;\n" + 
-				"import static java.lang.annotation.RetentionPolicy.RUNTIME;\n" + 
-				"import static java.lang.annotation.ElementType.CONSTRUCTOR;\n" + 
-				"import static java.lang.annotation.ElementType.METHOD;\n" + 
-				"\n" + 
-				"@Retention(value=RUNTIME)\n" + 
-				"@Target(value={CONSTRUCTOR,METHOD})\n" + 
-				"public @interface SafeVarargs {}",
-			},
-			"");
 		Map options = getCompilerOptions();
 		options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.ERROR);
 		this.runNegativeTest(
@@ -2895,7 +2754,7 @@
 			"1. WARNING in X.java (at line 14)\n" + 
 			"	classes = X.asList2(String.class, Boolean.class);\n" + 
 			"	          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
-			"Type safety: A generic array of Class<? extends Object&Serializable&Comparable<?>> is created for a varargs parameter\n" + 
+			"Type safety: A generic array of Class<? extends "+intersection("Object","Serializable","Comparable<?>")+"> is created for a varargs parameter\n" + 
 			"----------\n");
 	}
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=346042
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
index 3cf0260..9b2ec42 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java
@@ -349,38 +349,44 @@
 		if (possibleComplianceLevels == UNINITIALIZED) {
 			String specVersion = System.getProperty("java.specification.version");
 			isJRE9Plus = CompilerOptions.VERSION_9.equals(specVersion) || CompilerOptions.VERSION_10.equals(specVersion);
-			String compliance = System.getProperty("compliance");
-			if (compliance != null) {
-				if (CompilerOptions.VERSION_1_3.equals(compliance)) {
-					possibleComplianceLevels = RUN_JAVAC ? NONE : F_1_3;
-				} else if (CompilerOptions.VERSION_1_4.equals(compliance)) {
-					possibleComplianceLevels = RUN_JAVAC ? NONE : F_1_4;
-				} else if (CompilerOptions.VERSION_1_5.equals(compliance)) {
-					possibleComplianceLevels = F_1_5;
-				} else if (CompilerOptions.VERSION_1_6.equals(compliance)) {
-					possibleComplianceLevels = F_1_6;
-				} else if (CompilerOptions.VERSION_1_7.equals(compliance)) {
-					possibleComplianceLevels = F_1_7;
-				} else if (CompilerOptions.VERSION_1_8.equals(compliance)) {
-					possibleComplianceLevels = F_1_8;
-				} else if (CompilerOptions.VERSION_9.equals(compliance)) {
-					possibleComplianceLevels = F_9;
-				} else if (CompilerOptions.VERSION_10.equals(compliance)) {
-					possibleComplianceLevels = F_10;
-				} else {
-					System.out.println("Invalid compliance specified (" + compliance + ")");
-					System.out.print("Use one of ");
-					System.out.print(CompilerOptions.VERSION_1_3 + ", ");
-					System.out.print(CompilerOptions.VERSION_1_4 + ", ");
-					System.out.print(CompilerOptions.VERSION_1_5 + ", ");
-					System.out.print(CompilerOptions.VERSION_1_6 + ", ");
-					System.out.print(CompilerOptions.VERSION_1_7 + ", ");
-					System.out.print(CompilerOptions.VERSION_1_8 + ", ");
-					System.out.print(CompilerOptions.VERSION_1_8 + ", ");
-					System.out.print(CompilerOptions.VERSION_9 + ", ");
-					System.out.println(CompilerOptions.VERSION_10);
-					System.out.println("Defaulting to all possible compliances");
+			String compliances = System.getProperty("compliance");
+			if (compliances != null) {
+				possibleComplianceLevels = 0;
+				for (String compliance : compliances.split(",")) {
+					if (CompilerOptions.VERSION_1_3.equals(compliance)) {
+						possibleComplianceLevels |= RUN_JAVAC ? NONE : F_1_3;
+					} else if (CompilerOptions.VERSION_1_4.equals(compliance)) {
+						possibleComplianceLevels |= RUN_JAVAC ? NONE : F_1_4;
+					} else if (CompilerOptions.VERSION_1_5.equals(compliance)) {
+						possibleComplianceLevels |= F_1_5;
+					} else if (CompilerOptions.VERSION_1_6.equals(compliance)) {
+						possibleComplianceLevels |= F_1_6;
+					} else if (CompilerOptions.VERSION_1_7.equals(compliance)) {
+						possibleComplianceLevels |= F_1_7;
+					} else if (CompilerOptions.VERSION_1_8.equals(compliance)) {
+						possibleComplianceLevels |= F_1_8;
+					} else if (CompilerOptions.VERSION_9.equals(compliance)) {
+						possibleComplianceLevels |= F_9;
+					} else if (CompilerOptions.VERSION_10.equals(compliance)) {
+						possibleComplianceLevels |= F_10;
+					} else {
+						System.out.println("Ignoring invalid compliance (" + compliance + ")");
+						System.out.print("Use one of ");
+						System.out.print(CompilerOptions.VERSION_1_3 + ", ");
+						System.out.print(CompilerOptions.VERSION_1_4 + ", ");
+						System.out.print(CompilerOptions.VERSION_1_5 + ", ");
+						System.out.print(CompilerOptions.VERSION_1_6 + ", ");
+						System.out.print(CompilerOptions.VERSION_1_7 + ", ");
+						System.out.print(CompilerOptions.VERSION_1_8 + ", ");
+						System.out.print(CompilerOptions.VERSION_1_8 + ", ");
+						System.out.print(CompilerOptions.VERSION_9 + ", ");
+						System.out.println(CompilerOptions.VERSION_10);
+					}
 				}
+				if (possibleComplianceLevels == 0) {
+					System.out.println("Defaulting to all possible compliances");
+					possibleComplianceLevels = UNINITIALIZED;
+				}						
 			}
 			if (possibleComplianceLevels == UNINITIALIZED) {
 				if (!RUN_JAVAC) {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java
index c18e256..174f52a 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java
@@ -1163,6 +1163,15 @@
 	}
 	return buffer.toString();
 }
+private static String  getZipEntryFileName(File destDir, ZipEntry e, String canonicalDestDirPath) throws IOException {
+	  String result = e.getName();
+	  File destfile = new File(destDir, result);
+	  String canonicalDestFile = destfile.getCanonicalPath();
+	  if (!canonicalDestFile.startsWith(canonicalDestDirPath + File.separator)) {
+		  throw new ZipEntryStorageException("Entry is outside of the target dir: " + e.getName());
+	  }
+	  return result;
+}
 /**
  * Unzip the contents of the given zip in the given directory (create it if it doesn't exist)
  */
@@ -1171,6 +1180,7 @@
     InputStream zipIn = new FileInputStream(zipPath);
     byte[] buf = new byte[8192];
     File destDir = new File(destDirPath);
+    String canonicalDestDirPath = destDir.getCanonicalPath();
     ZipInputStream zis = new ZipInputStream(zipIn);
     FileOutputStream fos = null;
     try {
@@ -1182,7 +1192,7 @@
                 continue;
             }
             // if it is a file, extract it
-            String filePath = zEntry.getName();
+            String filePath = getZipEntryFileName(destDir, zEntry, canonicalDestDirPath);
             int lastSeparator = filePath.lastIndexOf("/"); //$NON-NLS-1$
             String fileDir = ""; //$NON-NLS-1$
             if (lastSeparator >= 0) {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/ZipEntryStorageException.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/ZipEntryStorageException.java
new file mode 100644
index 0000000..16506bf
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/ZipEntryStorageException.java
@@ -0,0 +1,12 @@
+package org.eclipse.jdt.core.tests.util;
+
+import java.io.IOException;
+
+public class ZipEntryStorageException extends IOException {
+
+	private static final long serialVersionUID = 1L;
+	
+	public ZipEntryStorageException(String message) {
+		super(message);
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
index 193ae48..7eeb537 100644
--- a/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.core.tests.model;singleton:=true
-Bundle-Version: 3.10.500.qualifier
+Bundle-Version: 3.10.600.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.jdt.core.tests,
diff --git a/org.eclipse.jdt.core.tests.model/about.html b/org.eclipse.jdt.core.tests.model/about.html
index 4602330..164f781 100644
--- a/org.eclipse.jdt.core.tests.model/about.html
+++ b/org.eclipse.jdt.core.tests.model/about.html
@@ -2,27 +2,35 @@
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
 <title>About</title>
 </head>
 <body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>June 2, 2006</p>	
-<h3>License</h3>
+	<h2>About This Content</h2>
 
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+	<p>November 30, 2017</p>
+	<h3>License</h3>
 
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content.  Check the Redistributor's license that was 
-provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+	<p>
+		The Eclipse Foundation makes available all content in this plug-in
+		(&quot;Content&quot;). Unless otherwise indicated below, the Content
+		is provided to you under the terms and conditions of the Eclipse
+		Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
+		available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
+		For purposes of the EPL, &quot;Program&quot; will mean the Content.
+	</p>
+
+	<p>
+		If you did not receive this Content directly from the Eclipse
+		Foundation, the Content is being redistributed by another party
+		(&quot;Redistributor&quot;) and different terms and conditions may
+		apply to your use of any object code in the Content. Check the
+		Redistributor's license that was provided with the Content. If no such
+		license exists, contact the Redistributor. Unless otherwise indicated
+		below, the terms and conditions of the EPL still apply to any source
+		code in the Content and such source code may be obtained at <a
+			href="http://www.eclipse.org/">http://www.eclipse.org</a>.
+	</p>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/pom.xml b/org.eclipse.jdt.core.tests.model/pom.xml
index 2842883..fb3ec4c 100644
--- a/org.eclipse.jdt.core.tests.model/pom.xml
+++ b/org.eclipse.jdt.core.tests.model/pom.xml
@@ -15,12 +15,12 @@
   <parent>
     <artifactId>tests-pom</artifactId>
     <groupId>eclipse.jdt.core</groupId>
-    <version>4.8.0-SNAPSHOT</version>
+    <version>4.9.0-SNAPSHOT</version>
     <relativePath>../tests-pom/</relativePath>
   </parent>
   <groupId>org.eclipse.jdt</groupId>
   <artifactId>org.eclipse.jdt.core.tests.model</artifactId>
-  <version>3.10.500-SNAPSHOT</version>
+  <version>3.10.600-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <properties>
@@ -77,6 +77,37 @@
 			<tycho.surefire.argLine>--add-modules ALL-SYSTEM</tycho.surefire.argLine>
 		</properties>
 	</profile>
+		<profile>
+		<id>test-on-javase-10</id>
+		<build>
+			<plugins>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-toolchains-plugin</artifactId>
+					<version>1.1</version>
+					<executions>
+						<execution>
+							<phase>validate</phase>
+							<goals>
+								<goal>toolchain</goal>
+							</goals>
+						</execution>
+					</executions>
+					<configuration>
+						<toolchains>
+							<jdk>
+								<id>JavaSE-10</id>
+							</jdk>
+						</toolchains>
+					</configuration>
+				</plugin>
+			</plugins>
+		</build>
+		<properties>
+			<!-- Overridden in https://ci.eclipse.org/jdt/job/eclipse.jdt.core-run.javac-10/configure  -->
+			<tycho.surefire.argLine>--add-modules ALL-SYSTEM -Dcompliance=1.4,1.7,1.8,10</tycho.surefire.argLine>
+		</properties>
+	</profile>
   </profiles>
 
 </project>
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter10Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter10Test.java
index cbfff29..ee5b9ad 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter10Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter10Test.java
@@ -19,8 +19,15 @@
 import org.eclipse.jdt.core.dom.*;
 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
 import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+
+import java.io.IOException;
+import java.util.Hashtable;
+
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.compiler.IProblem;
 
 public class ASTConverter10Test extends ConverterTestSetup {
 
@@ -203,5 +210,68 @@
 			ITypeBinding typeBinding = (ITypeBinding) binding;
 			assertTrue("wrong type binding", typeBinding.getName().equals("int"));
 	}
+	public void testBug525580_comment38() throws CoreException, IOException {
+		// not really using Java 10, but apiLevel JLS10 as per bug report
+		String jarPath = null;
+		try {
+			Hashtable<String, String> options = JavaCore.getDefaultOptions();
+			options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8);
+			options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8);
+			options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8);
+	
+			String srcFolderInWS = "/Converter10/src";
+			createFolder(srcFolderInWS + "/cardManager/");
+	
+			String srcFilePathInWS = srcFolderInWS + "/cardManager/CardManagerFragment.java";
+			createFile(srcFilePathInWS, 
+					"package cardManager;\n" + 
+					"\n" + 
+					"public class CardManagerFragment {\n" + 
+					"    private view.View i;\n" + 
+					"\n" + 
+					"    private <T> T a() {\n" + 
+					"        return this.i.findViewById(-1);\n" + 
+					"    }\n" + 
+					"}\n");
+	
+			jarPath = getWorkspacePath() + "Converter10/P.jar";
+			createJar(new String[] {
+				"view/View.java",
+				"package view;\n" +
+				"public class View {\n" +
+				"	public final <T extends View> T findViewById(int i) { return null; }\n" +
+				"}\n"
+				},
+				jarPath,
+				options);
+	
+			ASTParser parser = ASTParser.newParser(AST_INTERNAL_JLS10);
+			parser.setResolveBindings(true);
+			parser.setStatementsRecovery(true);
+			parser.setBindingsRecovery(true);
+		    parser.setCompilerOptions(options);
+			parser.setEnvironment(new String[] {jarPath}, new String[] {getWorkspacePath() + srcFolderInWS}, null, true);
+			parser.setKind(ASTParser.K_COMPILATION_UNIT);
+	
+			class MyFileASTRequestor extends FileASTRequestor {
+				boolean accepted = false;
+				@SuppressWarnings("synthetic-access")
+				@Override
+				public void acceptAST(String sourceFilePath, CompilationUnit cu) {
+					if (sourceFilePath.equals(getWorkspacePath() + srcFilePathInWS))
+						this.accepted = true;
+					assertEquals(1, cu.getProblems().length);
+					IProblem problem = cu.getProblems()[0];
+					assertEquals("Unexpected problem", "Pb(17) Type mismatch: cannot convert from View to T", problem.toString());
+				}
+			}
+			MyFileASTRequestor requestor = new MyFileASTRequestor();
+			parser.createASTs(new String[] {getWorkspacePath() + srcFilePathInWS}, null, new String[0], requestor, null);
+			assertTrue("file should have been accepted", requestor.accepted);
+		} finally {
+			if (jarPath != null)
+				deleteFile(jarPath);
+		}
+	}
 // Add new tests here
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
index 5aa0b41..310ebc2 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
@@ -12862,4 +12862,60 @@
 		"}";
 	formatSource(source);
 }
+/**
+ * https://bugs.eclipse.org/534742 - Error on save file due to formatter:
+ * IndexOutOfBoundsException in CommentWrapExecutor
+ */
+public void testBug534742() {
+	setPageWidth80();
+	this.formatterPrefs.comment_preserve_white_space_between_code_and_line_comments = true;
+	String source =
+		"class C {\n" + 
+		"	String ssssssssssss = fffffffffffffffff(\"aaaaaaaaaaaaaaaaa\", bbbbbbbbbbbbbbbbbb); //$NON-NLS-1$\n" + 
+		"}";
+	formatSource(source,
+		"class C {\n" + 
+		"	String ssssssssssss = fffffffffffffffff(\"aaaaaaaaaaaaaaaaa\", //$NON-NLS-1$\n" + 
+		"			bbbbbbbbbbbbbbbbbb);\n" + 
+		"}"
+	);
+}
+/**
+ * https://bugs.eclipse.org/536322 - Java formatter misses one level of
+ * indentation in enum declaration if Javadoc is present
+ */
+public void testBug536322() {
+	String source =
+		"class C {\n" + 
+		"	/** */\n" + 
+		"	enum E {\n" + 
+		"		enum1;\n" + 
+		"	}\n" + 
+		"}";
+	formatSource(source);
+}
+/**
+ * https://bugs.eclipse.org/536552 - Freeze when formatting Java source code
+ */
+public void testBug536552a() {
+	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
+	this.formatterPrefs.never_indent_line_comments_on_first_column = true;
+	String source =
+		"// comment\n" + 
+		"class C {\n" + 
+		"}";
+	formatSource(source);
+}
+/**
+ * https://bugs.eclipse.org/536552 - Freeze when formatting Java source code
+ */
+public void testBug536552b() {
+	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
+	this.formatterPrefs.never_indent_block_comments_on_first_column = true;
+	String source =
+		"/* comment */\n" + 
+		"class C {\n" + 
+		"}";
+	formatSource(source);
+}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
index a5ad49c..9b159e0 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
@@ -1405,7 +1405,19 @@
 		String javaHome = System.getProperty("java.home") + File.separator;
 		Path bootModPath = new Path(javaHome +"/lib/jrt-fs.jar");
 		Path sourceAttachment = new Path(javaHome +"/lib/src.zip");
-		IClasspathEntry jrtEntry = JavaCore.newLibraryEntry(bootModPath, sourceAttachment, null, null, attributes, false);
+		IClasspathEntry jrtEntry;
+		String javaVersion = System.getProperty("java.version"); //$NON-NLS-1$
+		if (javaVersion != null && javaVersion.startsWith("1.8")) { //$NON-NLS-1$
+			// fall back to a regular JCL to provide access via the unnamed module:
+			jrtEntry = JavaCore.newVariableEntry(new Path("JCL18_LIB"), sourceAttachment, null);
+			try {
+				setUpJCLClasspathVariables("1.8");
+			} catch (IOException e) {
+				throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, e.getMessage(), e));
+			}
+		} else {
+			jrtEntry = JavaCore.newLibraryEntry(bootModPath, sourceAttachment, null, null, attributes, false);
+		}
 		IJavaProject project = this.createJavaProject(name, srcFolders, new String[0],
 				new String[0], "bin", compliance);
 		IClasspathEntry[] old = project.getRawClasspath();
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations18Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations18Test.java
index ed9545b..c06d8bf 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations18Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalAnnotations18Test.java
@@ -2279,4 +2279,48 @@
 		reconciled = cu.reconcile(getJSL9(), true, null, new NullProgressMonitor());
 		assertNoProblems(reconciled.getProblems());
 	}
+	public void testBug517275() throws Exception {
+		myCreateJavaProject("TestLibs");
+		String lib1Content =
+				"package libs;\n" + 
+				"import java.util.List;\n" +
+				"public abstract class Collections {\n" +
+				"   public static final <T> List<T> emptyList() {\n" + 
+				"		return null;\n" +
+				"	}\n" +
+				"}\n";
+		addLibraryWithExternalAnnotations(this.project, "lib1.jar", "annots", new String[] {
+				"/UnannotatedLib/libs/Collections.java",
+				lib1Content								
+			}, null);
+		createFileInProject("annots/libs", "Collections.eea",
+				"class libs/Collections\n" + 
+				"\n" + 
+				"emptyList\n" + 
+				" <T:Ljava/lang/Object;>()Ljava/util/List<TT;>;\n" + 
+				" <T:Ljava/lang/Object;>()L1java/util/List<T1T;>;\n" + 
+				"\n");
+
+		// type check sources:
+		IPackageFragment fragment = this.project.getPackageFragmentRoots()[0].createPackageFragment("tests", true, null);
+		ICompilationUnit cu = fragment.createCompilationUnit("Test1.java",
+				"package tests;\n" +
+				"import libs.Collections;\n" + 
+				"import java.util.List;\n" + 
+				"\n" + 
+				"import org.eclipse.jdt.annotation.NonNull;\n" + 
+				"import org.eclipse.jdt.annotation.NonNullByDefault;\n" + 
+				"\n" + 
+				"@NonNullByDefault\n" + 
+				"public class Test1 {\n" + 
+				"  List<@NonNull String> strings;\n" + 
+				"\n" + 
+				"  public Test1() {\n" + 
+				"    strings = Collections.emptyList();      // <<<<< WARNING\n" + 
+				"  }\n" + 
+				"}\n",
+				true, new NullProgressMonitor()).getWorkingCopy(new NullProgressMonitor());
+		CompilationUnit reconciled = cu.reconcile(getJSL9(), true, null, new NullProgressMonitor());
+		assertNoProblems(reconciled.getProblems());
+	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java
index 14533e3..c37da9f 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java
@@ -910,13 +910,15 @@
 public void testBug400899g25() throws CoreException {
 this.workingCopies = new ICompilationUnit[1];
 this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b400899/X.java",
+		"package b400899;\n" +
 		"import java.lang.annotation.ElementType;\n" +
 		"import java.lang.annotation.Target;\n" +
 		"public class X {\n" +
-		"	public class X <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker Integer> {\n" + 
+		"	public class Z <@Marker T extends @Marker Y<@Marker ?>, @Marker Q extends @Marker CharSequence> {\n" + 
 		"}\n" +
  		"@Target(ElementType.TYPE_USE)\n" +	
-		"@interface Marker {}\n"
+		"@interface Marker {}\n" +
+		"interface Y<U> {}\n"
 	);
 SearchPattern pattern = SearchPattern.createPattern(
 		"Marker",
@@ -929,11 +931,11 @@
 this.resultCollector,
 null);
 assertSearchResults(
-		"src/b400899/X.java b400899.X$X [Marker] POTENTIAL_MATCH\n" +
-		"src/b400899/X.java b400899.X$X [Marker] POTENTIAL_MATCH\n" +
-		"src/b400899/X.java b400899.X$X [Marker] POTENTIAL_MATCH\n" +
-		"src/b400899/X.java b400899.X$X [Marker] POTENTIAL_MATCH\n" +
-		"src/b400899/X.java b400899.X$X [Marker] POTENTIAL_MATCH"
+		"src/b400899/X.java b400899.X$Z [Marker] EXACT_MATCH\n" +
+		"src/b400899/X.java b400899.X$Z [Marker] EXACT_MATCH\n" +
+		"src/b400899/X.java b400899.X$Z [Marker] EXACT_MATCH\n" +
+		"src/b400899/X.java b400899.X$Z [Marker] EXACT_MATCH\n" +
+		"src/b400899/X.java b400899.X$Z [Marker] EXACT_MATCH"
 );	
 }
 
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 cf6c3bf..c2be041 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
@@ -116,6 +116,12 @@
 	deleteProject("Reconciler9");
 	super.tearDownSuite();
 }
+private String deprecatedForRemoval(String element) {
+	if (isJRE9)
+		return element + " has been deprecated and marked for removal\n";
+	else
+		return element + " is deprecated\n";
+}
 /*
  * Ensures that the delta is correct when adding an annotation
  */
@@ -314,22 +320,35 @@
 public void testTerminalDeprecation2() throws CoreException, IOException {
 	try {
 		IJavaProject p1 = createJava9Project("P1");
-		createJar(
-			new String[] {
-				"p/X1.java", 
-				"package p;\n" +
+		String x1Source = "package p;\n" +
 				"@Deprecated(forRemoval=true)\n" +
-				"public class X1 {}",
-				"/P1/src/p/X2.java", 
-				"package p;\n" +
-				"public class X2 {\n" +
-				"   @Deprecated(forRemoval=true)\n" +
-				"	public Object field;\n" +
-				"   @Deprecated(forRemoval=true)\n" +
-				"	public void m() {}\n" +
-				"	@Deprecated public void m2() {}\n" +
-				"}\n"
-			},
+				"public class X1 {}";
+		String x2Source = "package p;\n" +
+			"public class X2 {\n" +
+			"   @Deprecated(forRemoval=true)\n" +
+			"	public Object field;\n" +
+			"   @Deprecated(forRemoval=true)\n" +
+			"	public void m() {}\n" +
+			"	@Deprecated public void m2() {}\n" +
+			"}\n";
+		String[] allJarSources = (isJRE9)
+				? new String[] {
+					"p/X1.java",
+					x1Source,
+					"/P1/src/p/X2.java",
+					x2Source }
+				: new String[] {
+					"java/lang/Deprecated.java",
+					"package java.lang;\n" +
+					"public @interface Deprecated {\n" +
+					"	boolean forRemoval() default false;" +
+					"}\n",
+					"p/X1.java",
+					x1Source,
+					"/P1/src/p/X2.java",
+					x2Source };
+		createJar(
+			allJarSources,
 			p1.getProject().getLocation().append("lib.jar").toOSString(),
 			null,
 			"9");
@@ -350,12 +369,12 @@
 			"1. WARNING in /P1/src/Y.java (at line 1)\n" + 
 			"	public class Y extends p.X1 {\n" + 
 			"	                         ^^\n" + 
-			"The type X1 has been deprecated and marked for removal\n" + 
+			deprecatedForRemoval("The type X1") +
 			"----------\n" + 
 			"2. WARNING in /P1/src/Y.java (at line 3)\n" + 
 			"	x2.m();\n" + 
 			"	   ^^^\n" + 
-			"The method m() from the type X2 has been deprecated and marked for removal\n" + 
+			deprecatedForRemoval("The method m() from the type X2") + 
 			"----------\n" + 
 			"3. WARNING in /P1/src/Y.java (at line 4)\n" + 
 			"	x2.m2();\n" + 
@@ -365,7 +384,7 @@
 			"4. WARNING in /P1/src/Y.java (at line 5)\n" + 
 			"	return x2.field;\n" + 
 			"	          ^^^^^\n" + 
-			"The field X2.field has been deprecated and marked for removal\n" + 
+			deprecatedForRemoval("The field X2.field") + 
 			"----------\n");
 	} finally {
 		deleteProject("P1");
diff --git a/org.eclipse.jdt.core/.settings/.api_filters b/org.eclipse.jdt.core/.settings/.api_filters
deleted file mode 100644
index f2bf406..0000000
--- a/org.eclipse.jdt.core/.settings/.api_filters
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.eclipse.jdt.core" version="2">
-    <resource path="search/org/eclipse/jdt/core/search/IJavaSearchConstants.java" type="org.eclipse.jdt.core.search.IJavaSearchConstants">
-        <filter comment="Need to make room for new JDT constant MODULE_GRAPH" id="388194388">
-            <message_arguments>
-                <message_argument value="org.eclipse.jdt.core.search.IJavaSearchConstants"/>
-                <message_argument value="PLAYEDBY_REFERENCES"/>
-                <message_argument value="6"/>
-            </message_arguments>
-        </filter>
-    </resource>
-    <resource path="META-INF/MANIFEST.MF">
-        <filter id="924844039">
-            <message_arguments>
-                <message_argument value="3.13.102"/>
-                <message_argument value="3.13.101"/>
-            </message_arguments>
-        </filter>
-    </resource>
-    <resource path="compiler/org/eclipse/jdt/core/compiler/IProblem.java" type="org.eclipse.jdt.core.compiler.IProblem">
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarIsNotAllowedHere"/>
-            </message_arguments>
-        </filter>
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarIsReserved"/>
-            </message_arguments>
-        </filter>
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarIsReservedInFuture"/>
-            </message_arguments>
-        </filter>
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarLocalCannotBeArray"/>
-            </message_arguments>
-        </filter>
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarLocalCannotBeArrayInitalizers"/>
-            </message_arguments>
-        </filter>
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarLocalCannotBeLambda"/>
-            </message_arguments>
-        </filter>
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarLocalCannotBeMethodReference"/>
-            </message_arguments>
-        </filter>
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarLocalInitializedToNull"/>
-            </message_arguments>
-        </filter>
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarLocalInitializedToVoid"/>
-            </message_arguments>
-        </filter>
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarLocalMultipleDeclarators"/>
-            </message_arguments>
-        </filter>
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarLocalReferencesItself"/>
-            </message_arguments>
-        </filter>
-        <filter id="1209008130">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VarLocalWithoutInitizalier"/>
-            </message_arguments>
-        </filter>
-    </resource>
-    <resource path="dom/org/eclipse/jdt/core/dom/AST.java" type="org.eclipse.jdt.core.dom.AST">
-        <filter id="1141899266">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="JLS10"/>
-            </message_arguments>
-        </filter>
-    </resource>
-    <resource path="dom/org/eclipse/jdt/core/dom/SimpleName.java" type="org.eclipse.jdt.core.dom.SimpleName">
-        <filter comment="In the works - may have to increase the version number" id="336658481">
-            <message_arguments>
-                <message_argument value="org.eclipse.jdt.core.dom.SimpleName"/>
-                <message_argument value="VAR_PROPERTY"/>
-            </message_arguments>
-        </filter>
-    </resource>
-    <resource path="dom/org/eclipse/jdt/core/dom/Type.java" type="org.eclipse.jdt.core.dom.Type">
-        <filter id="1141899266">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="isVar()"/>
-            </message_arguments>
-        </filter>
-    </resource>
-    <resource path="model/org/eclipse/jdt/core/JavaCore.java" type="org.eclipse.jdt.core.JavaCore">
-        <filter id="1141899266">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="VERSION_10"/>
-            </message_arguments>
-        </filter>
-        <filter id="1141899266">
-            <message_arguments>
-                <message_argument value="3.14"/>
-                <message_argument value="3.13"/>
-                <message_argument value="getAllVersions()"/>
-            </message_arguments>
-        </filter>
-    </resource>
-</component>
diff --git a/org.eclipse.jdt.core/META-INF/MANIFEST.MF b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
index 397d3f4..1e26efd 100644
--- a/org.eclipse.jdt.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.core; singleton:=true
-Bundle-Version: 3.14.0.OTDT_r270_qualifier
+Bundle-Version: 3.14.100.OTDT_r271_qualifier
 Bundle-Activator: org.eclipse.jdt.core.JavaCore
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/org.eclipse.jdt.core/about.html b/org.eclipse.jdt.core/about.html
index 2bb6753..c7dc7cb 100644
--- a/org.eclipse.jdt.core/about.html
+++ b/org.eclipse.jdt.core/about.html
@@ -2,28 +2,37 @@
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
 <title>About</title>
 </head>
 <body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>April 2, 2015</p>
-<h3>License</h3>
+	<h2>About This Content</h2>
 
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+	<p>November 30, 2017</p>
+	<h3>License</h3>
 
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content.  Check the Redistributor's license that was 
-provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+	<p>
+		The Eclipse Foundation makes available all content in this plug-in
+		(&quot;Content&quot;). Unless otherwise indicated below, the Content
+		is provided to you under the terms and conditions of the Eclipse
+		Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
+		available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
+		For purposes of the EPL, &quot;Program&quot; will mean the Content.
+	</p>
 
+	<p>
+		If you did not receive this Content directly from the Eclipse
+		Foundation, the Content is being redistributed by another party
+		(&quot;Redistributor&quot;) and different terms and conditions may
+		apply to your use of any object code in the Content. Check the
+		Redistributor's license that was provided with the Content. If no such
+		license exists, contact the Redistributor. Unless otherwise indicated
+		below, the terms and conditions of the EPL still apply to any source
+		code in the Content and such source code may be obtained at <a
+			href="http://www.eclipse.org/">http://www.eclipse.org</a>.
+	</p>
+
+	
 <h3>Disassembler</h3>
 <p>This plug-in contains a bytecode disassembler (&quot;Disassembler&quot;) that can produce a listing of the Java assembler mnemonics (&quot;Assembler Mnemonics&quot;) for a Java method.  If you 
 use the Disassembler to view the Assembler Mnemonics for a method, you should ensure that doing so will not violate the terms of any licenses that apply to your use of that method, as
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 9466806..d732182 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
@@ -755,6 +755,8 @@
 					// additional checks, because LE.resolveType may return a valid binding even in the presence of structural errors
 					if (!lambda.isCompatibleWith(parameterType, scope) || lambda.hasErrors())
 						continue;
+					// avoid that preliminary local type bindings escape beyond this point:
+					lambda.updateLocalTypesInMethod(candidateMethod);
 				} else {
 					updatedArgumentType = argument.resolveType(scope);
 				}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
index 9de4695..4c0a782 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
@@ -837,7 +837,6 @@
 //{ObjectTeams: no javadoc in generated / copied methods
 		  if (!(this.isGenerated || this.isCopied))
 // SH}
-			resolveJavadoc();
 			resolveAnnotations(this.scope, this.annotations, this.binding, this.isConstructor());
 			
 			long sourceLevel = this.scope.compilerOptions().sourceLevel;
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 38c3dc8..0bca5c7 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -208,7 +208,7 @@
 				LocalVariableBinding targetLocal;
 				if ((targetLocal = syntheticArgument.actualOuterLocalVariable) == null) continue;
 				if (targetLocal.declaration != null && !flowInfo.isDefinitelyAssigned(targetLocal)){
-					currentScope.problemReporter().uninitializedLocalVariable(targetLocal, this);
+					currentScope.problemReporter().uninitializedLocalVariable(targetLocal, this, currentScope);
 				}
 			}
 	}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java
index 8d87a4d..5a7c5aa 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -51,6 +51,7 @@
 		// account for exceptions thrown by any arithmetics:
 		flowContext.recordAbruptExit();
 	}
+	this.expression.checkNPEbyUnboxing(currentScope, flowContext, flowInfo);
 	flowInfo = ((Reference) this.lhs).analyseAssignment(currentScope, flowContext, flowInfo, this, true).unconditionalInits();
 	if (this.resolvedType.id == T_JavaLangString) {
 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=339250
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
index f99c521..f6326c6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -139,7 +139,16 @@
 		// we do not impact enclosing try context because this kind of protection
 		// does not preclude the variable from being null in an enclosing scope
 	}
-
+	private void analyzeLocalVariable(Expression exp, FlowInfo flowInfo) {
+		if (exp instanceof SingleNameReference && (exp.bits & Binding.LOCAL) != 0 ) {
+			LocalVariableBinding localBinding = (LocalVariableBinding) ((SingleNameReference ) exp).binding;
+			if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) {
+				localBinding.useFlag = LocalVariableBinding.USED;
+			} else if (localBinding.useFlag == LocalVariableBinding.UNUSED ) {
+				localBinding.useFlag = LocalVariableBinding.FAKE_USED;
+			}
+	}
+	}
 	@Override
 	public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
 		FlowInfo result;
@@ -151,6 +160,7 @@
 				} else { // false == anything
 					//  this is equivalent to the right argument inits negated
 					result = this.right.analyseCode(currentScope, flowContext, flowInfo).asNegatedCondition();
+					analyzeLocalVariable(this.left, flowInfo);
 				}
 			}
 			else if ((this.right.constant != Constant.NotAConstant) && (this.right.constant.typeID() == T_boolean)) {
@@ -160,6 +170,7 @@
 				} else { // anything == false
 					//  this is equivalent to the right argument inits negated
 					result = this.left.analyseCode(currentScope, flowContext, flowInfo).asNegatedCondition();
+					analyzeLocalVariable(this.right, flowInfo);
 				}
 			}
 			else {
@@ -172,6 +183,7 @@
 				if (!this.left.constant.booleanValue()) { //  false != anything
 					//  this is equivalent to the right argument inits
 					result = this.right.analyseCode(currentScope, flowContext, flowInfo);
+					analyzeLocalVariable(this.left, flowInfo);
 				} else { // true != anything
 					//  this is equivalent to the right argument inits negated
 					result = this.right.analyseCode(currentScope, flowContext, flowInfo).asNegatedCondition();
@@ -181,6 +193,7 @@
 				if (!this.right.constant.booleanValue()) { //  anything != false
 					//  this is equivalent to the right argument inits
 					result = this.left.analyseCode(currentScope, flowContext, flowInfo);
+					analyzeLocalVariable(this.right, flowInfo);
 				} else { // anything != true
 					//  this is equivalent to the right argument inits negated
 					result = this.left.analyseCode(currentScope, flowContext, flowInfo).asNegatedCondition();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
index 5bc293f..3a38a35 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -368,26 +368,6 @@
 			this.binding.setBestNameFromStat(this.initialization);
 // SH}
 		}
-		// Resolve Javadoc comment if one is present
-		if (this.javadoc != null) {
-			this.javadoc.resolve(initializationScope);
-		} else if (this.binding != null && this.binding.declaringClass != null && !this.binding.declaringClass.isLocalType()) {
-			// Set javadoc visibility
-			int javadocVisibility = this.binding.modifiers & ExtraCompilerModifiers.AccVisibilityMASK;
-			ProblemReporter reporter = initializationScope.problemReporter();
-			int severity = reporter.computeSeverity(IProblem.JavadocMissing);
-//{ObjectTeams: not for generated fields
-			if (this.isGenerated)
-				severity = ProblemSeverities.Ignore;
-// SH}
-			if (severity != ProblemSeverities.Ignore) {
-				if (classScope != null) {
-					javadocVisibility = Util.computeOuterMostVisibility(classScope.referenceType(), javadocVisibility);
-				}
-				int javadocModifiers = (this.binding.modifiers & ~ExtraCompilerModifiers.AccVisibilityMASK) | javadocVisibility;
-				reporter.javadocMissing(this.sourceStart, this.sourceEnd, severity, javadocModifiers);
-			}
-		}
 	} finally {
 		initializationScope.initializedField = previousField;
 		initializationScope.lastVisibleFieldID = previousFieldID;
@@ -395,6 +375,38 @@
 			this.binding.setConstant(Constant.NotAConstant);
 	}
 }
+public void resolveJavadoc(MethodScope initializationScope) {
+	if (this.javadoc != null) {
+		FieldBinding previousField = initializationScope.initializedField;
+		int previousFieldID = initializationScope.lastVisibleFieldID;
+		try {
+			initializationScope.initializedField = this.binding;
+			if (this.binding != null)
+				initializationScope.lastVisibleFieldID = this.binding.id;
+			this.javadoc.resolve(initializationScope);
+		} finally {
+			initializationScope.initializedField = previousField;
+			initializationScope.lastVisibleFieldID = previousFieldID;
+		}
+	} else if (this.binding != null && this.binding.declaringClass != null && !this.binding.declaringClass.isLocalType()) {
+		// Set javadoc visibility
+		int javadocVisibility = this.binding.modifiers & ExtraCompilerModifiers.AccVisibilityMASK;
+		ProblemReporter reporter = initializationScope.problemReporter();
+		int severity = reporter.computeSeverity(IProblem.JavadocMissing);
+//{ObjectTeams: not for generated fields
+		if (this.isGenerated)
+			severity = ProblemSeverities.Ignore;
+//SH}
+		if (severity != ProblemSeverities.Ignore) {
+			ClassScope classScope = initializationScope.enclosingClassScope();
+			if (classScope != null) {
+				javadocVisibility = Util.computeOuterMostVisibility(classScope.referenceType(), javadocVisibility);
+			}
+			int javadocModifiers = (this.binding.modifiers & ~ExtraCompilerModifiers.AccVisibilityMASK) | javadocVisibility;
+			reporter.javadocMissing(this.sourceStart, this.sourceEnd, severity, javadocModifiers);
+		}
+	}
+}
 
 public void traverse(ASTVisitor visitor, MethodScope scope) {
 	if (visitor.visit(this, scope)) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
index ca587c6..77f9a4d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -854,7 +854,7 @@
 			scope.problemReporter().indirectAccessToStaticField(this, fieldBinding);
 		}
 		// check if accessing enum static field in initializer
-		if (declaringClass.isEnum()) {
+		if (declaringClass.isEnum() && !scope.isModuleScope()) {
 			MethodScope methodScope = scope.methodScope();
 			SourceTypeBinding sourceType = scope.enclosingSourceType();
 			if (this.constant == Constant.NotAConstant
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java
index fc560c4..65bb8f8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java
@@ -514,6 +514,10 @@
 			} else {
 				elementType = this.elementVariable.patchType(elementType);
 			}
+			// additional check deferred from LocalDeclaration.resolve():
+			if (this.elementVariable.binding != null && this.elementVariable.binding.isValidBinding()) {
+				this.elementVariable.validateNullAnnotations(this.scope);
+			}
 		}
 
 		TypeBinding expectedCollectionType = null;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
index 189932d..a867190 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -215,6 +215,9 @@
 		if ((this.bits & ASTNode.ResolveJavadoc) == 0) {
 			return;
 		}
+
+		this.bits &= ~ASTNode.ResolveJavadoc;// avoid double resolution
+
 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247037, @inheritDoc tag cannot
 		// be used in the documentation comment for a class or interface.
 		if (this.inheritedPositions != null) {
@@ -323,6 +326,9 @@
 		if ((this.bits & ASTNode.ResolveJavadoc) == 0) {
 			return;
 		}
+
+		this.bits &= ~ASTNode.ResolveJavadoc;// avoid double resolution
+
 		// get method declaration
 		AbstractMethodDeclaration methDecl = methScope.referenceMethod();
 		boolean overriding = methDecl == null /* field declaration */ || methDecl.binding == null /* compiler error */
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java
index 954c24a..6c39a62 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,8 +19,11 @@
 import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
 import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
 import org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;
+import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
 import org.eclipse.jdt.internal.compiler.lookup.PackageBinding;
 import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
+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.TypeBinding;
 import org.eclipse.objectteams.otdt.internal.core.compiler.lookup.OTClassScope;
@@ -61,6 +64,14 @@
 			}
 		}
 		this.resolvedType = getTypeBinding(scope);
+		if (this.resolvedType instanceof LocalTypeBinding) {
+			// scope grants access to local types within this method, which, however, are illegal in javadoc
+			LocalTypeBinding localType = (LocalTypeBinding) this.resolvedType;
+			if (localType.scope != null && localType.scope.parent == scope) {
+				this.resolvedType = new ProblemReferenceBinding(new char[][] { localType.sourceName },
+						(ReferenceBinding) this.resolvedType, ProblemReasons.NotFound);
+			}
+		}
 		// End resolution when getTypeBinding(scope) returns null. This may happen in
 		// certain circumstances, typically when an illegal access is done on a type
 		// variable (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=204749)
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 79a6bde..f6df79a 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
@@ -48,6 +48,7 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
+import java.util.Map;
 import java.util.Set;
 
 import org.eclipse.jdt.core.compiler.CategorizedProblem;
@@ -74,6 +75,7 @@
 import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
 import org.eclipse.jdt.internal.compiler.lookup.InferenceContext18;
 import org.eclipse.jdt.internal.compiler.lookup.IntersectionTypeBinding18;
+import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
 import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
 import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
 import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
@@ -85,6 +87,8 @@
 import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
 import org.eclipse.jdt.internal.compiler.lookup.Scope;
 import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
+import org.eclipse.jdt.internal.compiler.lookup.Substitution;
+import org.eclipse.jdt.internal.compiler.lookup.Substitution.NullSubstitution;
 import org.eclipse.jdt.internal.compiler.lookup.SyntheticArgumentBinding;
 import org.eclipse.jdt.internal.compiler.lookup.SyntheticMethodBinding;
 import org.eclipse.jdt.internal.compiler.lookup.TagBits;
@@ -93,6 +97,7 @@
 import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
 import org.eclipse.jdt.internal.compiler.lookup.VariableBinding;
 import org.eclipse.jdt.internal.compiler.lookup.WildcardBinding;
+import org.eclipse.jdt.internal.compiler.lookup.Scope.Substitutor;
 import org.eclipse.jdt.internal.compiler.parser.Parser;
 import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
 import org.eclipse.jdt.internal.compiler.problem.AbortCompilationUnit;
@@ -127,6 +132,8 @@
 	private HashMap<TypeBinding, LambdaExpression> copiesPerTargetType;
 	protected Expression [] resultExpressions = NO_EXPRESSIONS;
 	public InferenceContext18 inferenceContext; // when performing tentative resolve keep a back reference to the driving context
+	private Map<Integer/*sourceStart*/, LocalTypeBinding> localTypes; // support look-up of a local type from this lambda copy
+
 	
 	public LambdaExpression(CompilationResult compilationResult, boolean assistNode, boolean requiresGenericSignature) {
 		super(compilationResult);
@@ -450,6 +457,8 @@
 		if (this.shouldCaptureInstance && this.scope.isConstructorCall) {
 			this.scope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
 		}
+		// beyond this point ensure that all local type bindings are their final binding:
+		updateLocalTypes();
 		return (argumentsHaveErrors|parametersHaveErrors) ? null : this.resolvedType;
 	}
 
@@ -1420,4 +1429,77 @@
 		}
 		return this.classType = new LambdaTypeBinding();
 	}
+
+	public void addLocalType(LocalTypeBinding localTypeBinding) {
+		if (this.localTypes == null)
+			this.localTypes = new HashMap<>();
+		this.localTypes.put(localTypeBinding.sourceStart, localTypeBinding);
+	}
+
+	/**
+	 * During inference, several copies of a lambda may be created.
+	 * If a lambda body contains a local type declaration, one binding may be created
+	 * within each of the lambda copies. Once inference finished, we need to map all
+	 * such local type bindings to the instance from the correct lambda copy.
+	 * <p>
+	 * When a local type binding occurs as a field of another type binding (e.g.,
+	 * type argument), the local type will be replaced in-place, assuming that the
+	 * previous binding should never escape the context of resolving this lambda.
+	 * </p>
+	 */
+	class LocalTypeSubstitutor extends Substitutor {
+		Map<Integer,LocalTypeBinding> localTypes2;
+		
+		public LocalTypeSubstitutor(Map<Integer, LocalTypeBinding> localTypes) {
+			this.localTypes2 = localTypes;
+		}
+
+		@Override
+		public TypeBinding substitute(Substitution substitution, TypeBinding originalType) {
+			if (originalType.isLocalType()) {
+				LocalTypeBinding orgLocal = (LocalTypeBinding) originalType;
+				MethodScope lambdaScope2 = orgLocal.scope.enclosingLambdaScope();
+				if (lambdaScope2 != null) {
+					if (((LambdaExpression) lambdaScope2.referenceContext).sourceStart == LambdaExpression.this.sourceStart) {
+						// local type within this lambda needs replacement: 
+						TypeBinding substType = this.localTypes2.get(orgLocal.sourceStart);
+						if (substType != null) {
+							orgLocal.transferConstantPoolNameTo(substType);
+							return substType;
+						}
+					}
+				}
+				return originalType;
+			}
+			return super.substitute(substitution, originalType);
+		}
+	}
+
+	private void updateLocalTypes() {
+		if (this.descriptor == null || this.localTypes == null)
+			return;
+		LocalTypeSubstitutor substor = new LocalTypeSubstitutor(this.localTypes);
+		NullSubstitution subst = new NullSubstitution(this.scope.environment());
+		updateLocalTypesInMethod(this.binding, substor, subst);
+		updateLocalTypesInMethod(this.descriptor, substor, subst);
+		this.resolvedType = substor.substitute(subst, this.resolvedType);
+		this.expectedType = substor.substitute(subst, this.expectedType);
+	}
+
+	/**
+	 * Perform substitution with a {@link LocalTypeSubstitutor} on all types mentioned in the given method binding.
+	 */
+	void updateLocalTypesInMethod(MethodBinding method) {
+		if (this.localTypes == null)
+			return;
+		updateLocalTypesInMethod(method, new LocalTypeSubstitutor(this.localTypes), new NullSubstitution(this.scope.environment()));
+	}
+
+	private void updateLocalTypesInMethod(MethodBinding method, Substitutor substor, Substitution subst) {
+		method.declaringClass = (ReferenceBinding) substor.substitute(subst, method.declaringClass);
+		method.returnType = substor.substitute(subst, method.returnType);
+		for (int i = 0; i < method.parameters.length; i++) {
+			method.parameters[i] = substor.substitute(subst, method.parameters[i]);
+		}
+	}
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
index 02b8b02..4fc23c5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
@@ -422,10 +422,15 @@
 			return;
 		}
 
-		boolean mayRequireTypeInference = scope.environment().usesNullTypeAnnotations() 
-				&& variableType.isValidBinding()
-				&& (this.initialization instanceof Invocation || this.initialization instanceof ConditionalExpression);
-		if (mayRequireTypeInference) {
+		boolean resolveAnnotationsEarly = false;
+		if (scope.environment().usesNullTypeAnnotations() 
+				&& !isTypeNameVar // 'var' does not provide a target type
+				&& variableType.isValidBinding()) { 
+			resolveAnnotationsEarly = this.initialization instanceof Invocation
+					|| this.initialization instanceof ConditionalExpression
+					|| this.initialization instanceof ArrayInitializer;
+		}
+		if (resolveAnnotationsEarly) {
 			// these are definitely no constants, so resolving annotations early should be safe
 			resolveAnnotations(scope, this.annotations, this.binding, true);
 			// for type inference having null annotations upfront gives better results
@@ -492,9 +497,13 @@
 // SH}
 		}
 		// if init could be a constant only resolve annotation at the end, for constant to be positioned before (96991)
-		if (!mayRequireTypeInference)
+		if (!resolveAnnotationsEarly)
 			resolveAnnotations(scope, this.annotations, this.binding, true);
 		Annotation.isTypeUseCompatible(this.type, scope, this.annotations);
+		validateNullAnnotations(scope);
+	}
+
+	void validateNullAnnotations(BlockScope scope) {
 		if (!scope.validateNullAnnotation(this.binding.tagBits, this.type, this.annotations))
 			this.binding.tagBits &= ~TagBits.AnnotationNullMASK;
 	}
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 de626b5..27c669b 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
@@ -117,6 +117,10 @@
 			public ReferenceContext referenceContext() {
 				return ModuleDeclaration.this;
 			}
+			@Override
+			public boolean isModuleScope() {
+				return true;
+			}
 		};
 	}
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
index 48096c5..be00b44 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
@@ -143,7 +143,7 @@
 			LocalVariableBinding localBinding;
 			if (!flowInfo
 				.isDefinitelyAssigned(localBinding = (LocalVariableBinding) this.binding)) {
-				currentScope.problemReporter().uninitializedLocalVariable(localBinding, this);
+				currentScope.problemReporter().uninitializedLocalVariable(localBinding, this, currentScope);
 			}
 			if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0)	{
 				localBinding.useFlag = LocalVariableBinding.USED;
@@ -250,7 +250,7 @@
 		case Binding.LOCAL : // reading a local variable
 			LocalVariableBinding localBinding;
 			if (!flowInfo.isDefinitelyAssigned(localBinding = (LocalVariableBinding) this.binding)) {
-				currentScope.problemReporter().uninitializedLocalVariable(localBinding, this);
+				currentScope.problemReporter().uninitializedLocalVariable(localBinding, this, currentScope);
 			}
 			if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) {
 				localBinding.useFlag = LocalVariableBinding.USED;
@@ -823,7 +823,8 @@
 			}
 
 			if (field.isStatic()) {
-				if ((field.modifiers & ClassFileConstants.AccEnum) != 0) { // enum constants are checked even when qualified)
+				if ((field.modifiers & ClassFileConstants.AccEnum) != 0 && !scope.isModuleScope()) {
+					// enum constants are checked even when qualified -- modules don't contain field declarations
 					ReferenceBinding declaringClass = field.original().declaringClass;
 					MethodScope methodScope = scope.methodScope();
 					SourceTypeBinding sourceType = methodScope.enclosingSourceType();
@@ -1007,7 +1008,7 @@
 	if ((this.bits & ASTNode.RestrictiveFlagMASK) == Binding.LOCAL) {
 		LocalVariableBinding localVariableBinding = (LocalVariableBinding) this.binding;
 		if (localVariableBinding != null) {
-			if ((localVariableBinding.tagBits & TagBits.NotInitialized) != 0) {
+			if (localVariableBinding.isUninitializedIn(currentScope)) {
 				// local was tagged as uninitialized
 				return;
 			}
@@ -1239,15 +1240,17 @@
 					ReferenceBinding declaringClass = fieldBinding.original().declaringClass;
 					SourceTypeBinding sourceType = methodScope.enclosingSourceType();
 					// check for forward references
-					if ((this.indexOfFirstFieldBinding == 1 || (fieldBinding.modifiers & ClassFileConstants.AccEnum) != 0 || (!fieldBinding.isFinal() && declaringClass.isEnum())) // enum constants are checked even when qualified
-							&& TypeBinding.equalsEquals(sourceType, declaringClass)
-							&& methodScope.lastVisibleFieldID >= 0
-							&& fieldBinding.id >= methodScope.lastVisibleFieldID
-							&& (!fieldBinding.isStatic() || methodScope.isStatic)) {
-						if (methodScope.insideTypeAnnotation && fieldBinding.id == methodScope.lastVisibleFieldID) {
-							// false alarm, location is NOT a field initializer but the value in a memberValuePair
-						} else {
-							scope.problemReporter().forwardReference(this, this.indexOfFirstFieldBinding-1, fieldBinding);
+					if (!scope.isModuleScope()) {
+						if ((this.indexOfFirstFieldBinding == 1 || (fieldBinding.modifiers & ClassFileConstants.AccEnum) != 0 || (!fieldBinding.isFinal() && declaringClass.isEnum())) // enum constants are checked even when qualified
+								&& TypeBinding.equalsEquals(sourceType, declaringClass)
+								&& methodScope.lastVisibleFieldID >= 0
+								&& fieldBinding.id >= methodScope.lastVisibleFieldID
+								&& (!fieldBinding.isStatic() || methodScope.isStatic)) {
+							if (methodScope.insideTypeAnnotation && fieldBinding.id == methodScope.lastVisibleFieldID) {
+								// false alarm, location is NOT a field initializer but the value in a memberValuePair
+							} else {
+								scope.problemReporter().forwardReference(this, this.indexOfFirstFieldBinding-1, fieldBinding);
+							}
 						}
 					}
 					if (isFieldUseDeprecated(fieldBinding, scope, this.indexOfFirstFieldBinding == this.tokens.length ? this.bits : 0)) {
@@ -1256,9 +1259,8 @@
 					if (fieldBinding.isStatic()) {
 						// only last field is actually a write access if any
 						// check if accessing enum static field in initializer
-						if (declaringClass.isEnum()) {
-							if ((TypeBinding.equalsEquals(sourceType, declaringClass) || 
-									(sourceType != null && TypeBinding.equalsEquals(sourceType.superclass, declaringClass))) // enum constant body
+						if (declaringClass.isEnum() && !scope.isModuleScope()) {
+							if ((TypeBinding.equalsEquals(sourceType, declaringClass) || TypeBinding.equalsEquals(sourceType.superclass, declaringClass)) // enum constant body
 									&& fieldBinding.constant(scope) == Constant.NotAConstant
 									&& !methodScope.isStatic
 									&& methodScope.isInsideInitializerOrConstructor()) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
index 16e76e7..aeda47b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
@@ -634,6 +634,9 @@
 			}
 
 	    	if (this.expectedType == null && this.expressionContext == INVOCATION_CONTEXT) {
+	    		if (compilerOptions.isAnnotationBasedNullAnalysisEnabled && this.binding != null) {
+	    			ImplicitNullAnnotationVerifier.ensureNullnessIsKnown(this.binding, scope);
+	    		}
 	    		return new PolyTypeBinding(this);
 			}
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
index e9ac7ee..3bee840 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
@@ -112,7 +112,7 @@
 				// check if assigning a final blank field
 				LocalVariableBinding localBinding;
 				if (!flowInfo.isDefinitelyAssigned(localBinding = (LocalVariableBinding) this.binding)) {
-					currentScope.problemReporter().uninitializedLocalVariable(localBinding, this);
+					currentScope.problemReporter().uninitializedLocalVariable(localBinding, this, currentScope);
 					// we could improve error msg here telling "cannot use compound assignment on final local variable"
 				}
 				if (localBinding.useFlag != LocalVariableBinding.USED) {
@@ -220,7 +220,7 @@
 		case Binding.LOCAL : // reading a local variable
 			LocalVariableBinding localBinding;
 			if (!flowInfo.isDefinitelyAssigned(localBinding = (LocalVariableBinding) this.binding)) {
-				currentScope.problemReporter().uninitializedLocalVariable(localBinding, this);
+				currentScope.problemReporter().uninitializedLocalVariable(localBinding, this, currentScope);
 			}
 			if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) {
 				localBinding.useFlag = LocalVariableBinding.USED;
@@ -244,7 +244,7 @@
 	if (fieldBinding.isStatic()) {
 		// check if accessing enum static field in initializer
 		ReferenceBinding declaringClass = fieldBinding.declaringClass;
-		if (declaringClass.isEnum()) {
+		if (declaringClass.isEnum() && !scope.isModuleScope()) {
 			SourceTypeBinding sourceType = scope.enclosingSourceType();
 			if (this.constant == Constant.NotAConstant
 					&& !methodScope.isStatic
@@ -932,7 +932,7 @@
 	if ((this.bits & ASTNode.RestrictiveFlagMASK) == Binding.LOCAL) {
 		LocalVariableBinding localVariableBinding = (LocalVariableBinding) this.binding;
 		if (localVariableBinding != null) {
-			if ((localVariableBinding.tagBits & TagBits.NotInitialized) != 0) {
+			if (localVariableBinding.isUninitializedIn(currentScope)) {
 				// local was tagged as uninitialized
 				return;
 			}
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 21d2d3f..9614a2e 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
@@ -2015,6 +2015,16 @@
 				reporter.javadocMissing(this.sourceStart, this.sourceEnd, severity, javadocModifiers);
 			}
 		}
+		FieldDeclaration[] fieldsDecls = this.fields;
+		if (fieldsDecls != null) {
+			for (FieldDeclaration fieldDeclaration : fieldsDecls)
+				fieldDeclaration.resolveJavadoc(this.initializerScope);
+		}
+		AbstractMethodDeclaration[] methodDecls = this.methods;
+		if (methodDecls != null) {
+			for (AbstractMethodDeclaration methodDeclaration : methodDecls)
+				methodDeclaration.resolveJavadoc();
+		}
 	} catch (AbortType e) {
 		this.ignoreFurtherInvestigation = true;
 		return;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
index a3e6db2..a0f4ade 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
@@ -3541,17 +3541,16 @@
 						&& (options.complianceLevel >= ClassFileConstants.JDK1_4 || !(isImplicitThisReceiver && codegenBinding.isStatic()))
 						&& codegenBinding.declaringClass.id != TypeIds.T_JavaLangObject) // no change for Object methods
 					|| !codegenBinding.declaringClass.canBeSeenBy(currentScope)) {
-				TypeBinding erasure = actualReceiverType.erasure();
-				if (erasure.isIntersectionType18()) {
-					TypeBinding[] intersectingTypes = ((IntersectionTypeBinding18)erasure).getIntersectingTypes();
+				if (actualReceiverType.isIntersectionType18()) {
+					TypeBinding[] intersectingTypes = ((IntersectionTypeBinding18)actualReceiverType).getIntersectingTypes();
 					for(int i = 0; i < intersectingTypes.length; i++) {
 						if (intersectingTypes[i].findSuperTypeOriginatingFrom(constantPoolDeclaringClass) != null) {
-							constantPoolDeclaringClass = intersectingTypes[i];
+							constantPoolDeclaringClass = intersectingTypes[i].erasure();
 							break;
 						}
 					}
 				} else {
-					constantPoolDeclaringClass = erasure;
+					constantPoolDeclaringClass = actualReceiverType.erasure();
 				}
 			}
 		}				
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
index a558697..8f6d3ab 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
@@ -294,6 +294,13 @@
 		case Binding.INTERSECTION_TYPE :
 		    return ((WildcardBinding) otherType).boundCheck(this);
 
+		case Binding.INTERSECTION_TYPE18:
+			for (ReferenceBinding intersecting : ((IntersectionTypeBinding18) otherType).intersectingTypes) {
+				if (!isCompatibleWith(intersecting, captureScope))
+					return false;
+			}
+			return true;
+
 		case Binding.TYPE_PARAMETER :
 			// check compatibility with capture of ? super X
 			if (otherType.isCapture()) {
@@ -339,6 +346,12 @@
 			break;
 		case Binding.BASE_TYPE :
 			return false;
+		case Binding.INTERSECTION_TYPE18:
+			for (ReferenceBinding intersecting : ((IntersectionTypeBinding18) otherType).intersectingTypes) {
+				if (!isSubtypeOf(intersecting, simulatingBugJDK8026527))
+					return false;
+			}
+			return true;
 	}
 	switch (otherType.leafComponentType().id) {
 	    case TypeIds.T_JavaLangObject :
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
index 9061053..14b9e6b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
@@ -165,7 +165,7 @@
 		int count = 0;
 		for (int i = 0; i < this.unresolvedExports.length; i++) {
 			IPackageExport export = this.unresolvedExports[i];
-			PackageBinding declaredPackage = getVisiblePackage(CharOperation.splitOn('.', export.name()));
+			PackageBinding declaredPackage = forcedGetExportedPackage(CharOperation.splitOn('.', export.name()));
 			if (declaredPackage != null) {
 				this.exportedPackages[count++] = declaredPackage;
 				if (declaredPackage instanceof SplitPackageBinding)
@@ -174,8 +174,6 @@
 					declaredPackage.isExported = Boolean.TRUE;
 					recordExportRestrictions(declaredPackage, export.targets());
 				}
-			} else {
-				// TODO(SHMOD): report incomplete module path?
 			}
 		}
 		if (count < this.exportedPackages.length)
@@ -201,6 +199,23 @@
 			System.arraycopy(this.openedPackages, 0, this.openedPackages = new PackageBinding[count], 0, count);
 	}
 	
+	PackageBinding forcedGetExportedPackage(char[][] compoundName) {
+		// when resolving "exports" in a binary module we simply assume the package must exist,
+		// since this has been checked already when compiling that module.
+		PackageBinding binding = getVisiblePackage(compoundName);
+		if (binding != null)
+			return binding;
+		if (compoundName.length > 1) {
+			PackageBinding parent = forcedGetExportedPackage(CharOperation.subarray(compoundName, 0, compoundName.length-1));
+			binding = new PackageBinding(compoundName, parent, this.environment, this);
+			parent.addPackage(binding, this, true);
+			return binding;
+		}
+		binding = new PackageBinding(compoundName[0], this.environment, this);
+		addPackage(binding, true);
+		return binding;
+	}
+
 	@Override
 	public TypeBinding[] getUses() {
 		if (this.uses == null) {
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 67a161c..561f0a7 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
@@ -1138,7 +1138,7 @@
 										} else {
 											ReferenceBinding[] glbs = Scope.greaterLowerBound((ReferenceBinding[])upperBounds);
 											if (glbs == null) {
-												throw new UnsupportedOperationException("no glb for "+Arrays.asList(upperBounds)); //$NON-NLS-1$
+												return null;
 											} else if (glbs.length == 1) {
 												glb = glbs[0];
 											} else {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
index df5fcf1..e635e10 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
@@ -26,7 +26,15 @@
 import org.eclipse.jdt.internal.compiler.ast.Wildcard;
 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
 
-public class IntersectionTypeBinding18 extends ReferenceBinding { // abstraction used for intersection casts in Java 8 + type inference at 1.8+
+/**
+ * Abstraction used for intersection casts in Java 8 + and inferred types:
+ * <ul>
+ * <li>type inference at 1.8+</li>
+ * <li>lub at 1.8+</li>
+ * <li>projections for 'var' at 10+</li>
+ * </ul>
+ */
+public class IntersectionTypeBinding18 extends ReferenceBinding {
 
 	public ReferenceBinding [] intersectingTypes;
 	private ReferenceBinding javaLangObject;
@@ -118,6 +126,11 @@
 	
 	@Override
 	public char[] constantPoolName() {
+		TypeBinding erasure = erasure();
+		if (erasure != this) //$IDENTITY-COMPARISON$
+			return erasure.constantPoolName();
+		if (this.intersectingTypes[0].id == TypeIds.T_JavaLangObject && this.intersectingTypes.length > 1)
+			return this.intersectingTypes[1].constantPoolName(); // improve stack map
 		return this.intersectingTypes[0].constantPoolName();
 	}
 
@@ -209,6 +222,24 @@
 	}
 
 	@Override
+	public TypeBinding erasure() {
+		int classIdx = -1;
+		for (int i = 0; i < this.intersectingTypes.length; i++) {
+			if (this.intersectingTypes[i].isClass() && this.intersectingTypes[i].id != TypeIds.T_JavaLangObject) { // ignore j.l.Object to improve stack map
+				if (classIdx == -1) {
+					classIdx = i;
+				} else {
+					classIdx = Integer.MAX_VALUE;
+					break;
+				}
+			}
+		}
+		if (classIdx > -1 && classIdx < Integer.MAX_VALUE)
+			return this.intersectingTypes[classIdx];
+		return this;
+	}
+
+	@Override
 	public char[] qualifiedSourceName() {
 		StringBuffer qualifiedSourceName = new StringBuffer(16);
 		for (int i = 0; i < this.length; i++) {		
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
index 871d09d..8711b23 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
 import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.internal.compiler.ast.ASTNode;
 import org.eclipse.jdt.internal.compiler.ast.CaseStatement;
+import org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
 import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
 import org.eclipse.jdt.internal.compiler.ast.TypeReference;
 
@@ -63,6 +64,10 @@
 	if (methodBinding != null) {
 		this.enclosingMethod = methodBinding;
 	}
+	MethodScope lambdaScope = scope.enclosingLambdaScope();
+	if (lambdaScope != null) {
+		((LambdaExpression) lambdaScope.referenceContext).addLocalType(this);
+	}
 // :giro
   }
 // SH}
@@ -288,6 +293,17 @@
 	}
 }
 // SH}
+
+public void transferConstantPoolNameTo(TypeBinding substType) {
+	if (this.constantPoolName != null && substType instanceof LocalTypeBinding) {
+		LocalTypeBinding substLocalType = (LocalTypeBinding) substType;
+		if (substLocalType.constantPoolName == null) {
+			substLocalType.setConstantPoolName(this.constantPoolName);
+			this.scope.compilationUnitScope().constantPoolNameUsage.put(substLocalType.constantPoolName, substLocalType);
+		}
+	}
+}
+
 /*
  * Overriden for code assist. In this case, the constantPoolName() has not been computed yet.
  * Slam the source name so that the signature is syntactically correct.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
index d86888b..c6ad781 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
@@ -22,6 +22,9 @@
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.lookup;
 
+import java.util.HashSet;
+import java.util.Set;
+
 import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.internal.compiler.ast.ASTNode;
 import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
@@ -61,6 +64,8 @@
 
 	public FakedTrackingVariable closeTracker; // track closing of instances of type AutoCloseable, maybe null
 
+	public Set<MethodScope> uninitializedInMethod;
+
 	// for synthetic local variables
 	// if declaration slot is not positionned, the variable will not be listed in attribute
 	// note that the name of a variable should be chosen so as not to conflict with user ones (usually starting with a space char is all needed)
@@ -350,5 +355,16 @@
 	public void markReferenced() {
 		// Signal that the name is used - This is for extension in subclasses
 	}
-	
+
+	public boolean isUninitializedIn(Scope scope) {
+		if (this.uninitializedInMethod != null)
+			return this.uninitializedInMethod.contains(scope.methodScope());
+		return false;
+	}
+
+	public void markAsUninitializedIn(Scope scope) {
+		if (this.uninitializedInMethod == null)
+			this.uninitializedInMethod = new HashSet<>();
+		this.uninitializedInMethod.add(scope.methodScope());
+	}
 }
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 feacd6d..78086f7 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
@@ -911,6 +911,7 @@
 		case Binding.WILDCARD_TYPE :
 		case Binding.INTERSECTION_TYPE :
 		case Binding.TYPE_PARAMETER :
+		case Binding.INTERSECTION_TYPE18:
 			switch (type.erasure().id) {
 				case TypeIds.T_JavaLangBoolean :
 					return TypeBinding.BOOLEAN;
@@ -932,8 +933,6 @@
 			break;
 		case Binding.POLY_TYPE:
 			return ((PolyTypeBinding) type).computeBoxingType();
-		case Binding.INTERSECTION_TYPE18:
-			return computeBoxingType(type.getIntersectingTypes()[0]);
 	}
 	return type;
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
index e6a4de2..d1b6d7f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
@@ -875,7 +875,7 @@
 					} else if (match.declaringClass.isClass()) {
 						implementation = match;
 					}
-					if (interfaceMethod != null && implementation != null && !isAsVisible(implementation, interfaceMethod))
+					if (interfaceMethod != null && implementation != null && !implementation.isAbstract() && !isAsVisible(implementation, interfaceMethod))
 						problemReporter().inheritedMethodReducesVisibility(typeParameter, implementation, new MethodBinding [] {interfaceMethod});
 					
 					if (areReturnTypesCompatible(first, match)) continue;
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 c021086..e064675 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
@@ -61,6 +61,7 @@
 package org.eclipse.jdt.internal.compiler.lookup;
 
 import java.util.*;
+import java.util.function.Function;
 
 import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.internal.compiler.ast.*;
@@ -410,6 +411,7 @@
 	// 5.1.10
 	public static ReferenceBinding[] greaterLowerBound(ReferenceBinding[] types) {
 		if (types == null) return null;
+		types = filterValidTypes(types, ReferenceBinding[]::new);
 		int length = types.length;
 		if (length == 0) return null;
 		ReferenceBinding[] result = types;
@@ -448,6 +450,7 @@
 	// 5.1.10
 	public static TypeBinding[] greaterLowerBound(TypeBinding[] types, /*@Nullable*/ Scope scope, LookupEnvironment environment) {
 		if (types == null) return null;
+		types = filterValidTypes(types, TypeBinding[]::new);
 		int length = types.length;
 		if (length == 0) return null;
 		TypeBinding[] result = types;
@@ -522,6 +525,20 @@
 		return trimmedResult;
 	}
 
+	static <T extends TypeBinding> T[] filterValidTypes(T[] allTypes, Function<Integer,T[]> ctor) {
+		T[] valid = ctor.apply(allTypes.length);
+		int count = 0;
+		for (int i = 0; i < allTypes.length; i++) {
+			if (allTypes[i].isValidBinding())
+				valid[count++] = allTypes[i];
+		}
+		if (count == allTypes.length)
+			return allTypes;
+		if (count == 0 && allTypes.length > 0)
+			return Arrays.copyOf(allTypes, 1); // if all are invalid pick the first as a placeholder to prevent general glb failure
+		return Arrays.copyOf(valid, count);
+	}
+
 	static boolean isMalformedPair(TypeBinding t1, TypeBinding t2, Scope scope) {
 		// not spec-ed in JLS, but per email communication (2017-09-13) it should be
 		switch (t1.kind()) {
@@ -825,6 +842,10 @@
 		return false;
 	}
 
+	public boolean isModuleScope() {
+		return false;
+	}
+
 	/**
 	 * Finds the most specific compiler options
 	 */
@@ -4387,7 +4408,18 @@
 				otherBounds[rank++] = mec;
 			}
 		}
-		TypeBinding intersectionType = environment().createWildcard(null, 0, firstBound, otherBounds, Wildcard.EXTENDS);  // pass common null annotations by synthesized annotation bindings.
+		TypeBinding intersectionType;
+		if (environment().globalOptions.complianceLevel < ClassFileConstants.JDK1_8) {
+			intersectionType = environment().createWildcard(null, 0, firstBound, otherBounds, Wildcard.EXTENDS);
+		} else {
+			// It _should_ be safe to assume only ReferenceBindings at this point, because
+			// - base types are rejected in minimalErasedCandidates
+			// - arrays are peeled, different dims are rejected above ("not all types have same dimension")
+			ReferenceBinding[] intersectingTypes = new ReferenceBinding[otherBounds.length+1];
+			intersectingTypes[0] = (ReferenceBinding) firstBound;
+			System.arraycopy(otherBounds, 0, intersectingTypes, 1, otherBounds.length);
+			intersectionType = environment().createIntersectionType18(intersectingTypes);
+		}
 		return commonDim == 0 ? intersectionType : environment().createArrayType(intersectionType, commonDim);
 	}
 
@@ -5646,7 +5678,7 @@
 	}
 
 	public boolean validateNullAnnotation(long tagBits, TypeReference typeRef, Annotation[] annotations) {
-		if (typeRef == null)
+		if (typeRef == null || typeRef.resolvedType == null)
 			return true;
 		TypeBinding type = typeRef.resolvedType;
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
index fe85d0e..87a416f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
@@ -40,8 +40,6 @@
 	public void setRequires(ModuleBinding[] requires, ModuleBinding[] requiresTransitive) {
 		// TODO(SHMOD): it's a bit awkward that we may get called after applyModuleUpdates() has already worked.
 		ModuleBinding javaBase = this.environment.javaBaseModule();
-		if (javaBase.isUnnamed()) // happens when no java.base can be found in the name environment.
-			javaBase = null;
 		this.requires = merge(this.requires, requires, javaBase, ModuleBinding[]::new);
 		this.requiresTransitive = merge(this.requiresTransitive, requiresTransitive, null, ModuleBinding[]::new);
 	}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Substitution.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Substitution.java
index 3a896a3..745496f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Substitution.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Substitution.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,6 +19,36 @@
 public interface Substitution {
 
 	/**
+	 * Don't substitute any type variables.
+	 * Enables the use of {@link Scope.Substitutor} for other purposes.
+	 */
+	public static class NullSubstitution implements Substitution {
+		LookupEnvironment environment;
+
+		public NullSubstitution(LookupEnvironment environment) {
+			this.environment = environment;
+		}
+		@Override
+		public TypeBinding substitute(TypeVariableBinding typeVariable) {
+			return typeVariable;
+		}
+		@Override
+		public boolean isRawSubstitution() {
+			return false;
+		}
+		@Override
+		public LookupEnvironment environment() {
+			return this.environment;
+		}
+//{ObjectTeams:
+		@Override
+		public ITeamAnchor substituteAnchor(ITeamAnchor anchor, int rank) {
+			return anchor;
+		}
+// SH}
+	}
+
+	/**
 	 * Returns the type substitute for a given type variable, or itself
 	 * if no substitution got performed.
 	 */
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
index 7d55692..7de02ac 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -44,9 +44,6 @@
 	long HasUncheckedTypeArgumentForBoundCheck = ASTNode.Bit9;
 	
 	// local variable
-	long NotInitialized = ASTNode.Bit9;
-	
-	// local variable
 	long ForcedToBeRawType = ASTNode.Bit10;
 
 	// set when method has argument(s) that couldn't be resolved
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
index 7524c1e..7db4178 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
@@ -564,6 +564,20 @@
 				}
 			}
 			return this; // only occur if passed null declaringClass for arraylength
+		case Binding.INTERSECTION_TYPE18:
+			ReferenceBinding[] intersectingTypes = ((IntersectionTypeBinding18) this).getIntersectingTypes();
+			ReferenceBinding constantPoolType = intersectingTypes[0];
+			if (constantPoolType.id == TypeIds.T_JavaLangObject && intersectingTypes.length > 1)
+				constantPoolType = intersectingTypes[1];
+			if (constantPoolType.erasure().findSuperTypeOriginatingFrom(declaringClass) != null) {
+				return this; // no need for alternate receiver type
+			}
+			for (ReferenceBinding superBinding : intersectingTypes) {
+				if (superBinding.findSuperTypeOriginatingFrom(declaringClass) != null) {
+					return superBinding.getErasureCompatibleType(declaringClass);
+				}
+			}
+			return this; // should only occur if passed null declaringClass for arraylength
 		default :
 			return this;
 	}
@@ -1710,6 +1724,10 @@
 		return false;
 	if (that.id != TypeIds.NoId && that.id == other.id)
 		return true;
+	if (that instanceof LocalTypeBinding && other instanceof LocalTypeBinding) {
+		// while a lambda is being resolved, consider a local type as equal to its variant from another lambda copy
+		return ((LocalTypeBinding) that).sourceStart == ((LocalTypeBinding) other).sourceStart;
+	}
 	return false;
 }
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java
index 35b012c..2006074 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2015 GK Software AG and others.
+ * Copyright (c) 2013, 2018 GK Software AG and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.lookup;
 
-import org.eclipse.jdt.core.compiler.CharOperation;
 
 /**
  * Implementation of 18.1.3 in JLS8
@@ -38,7 +37,7 @@
 	
 	TypeBound(InferenceVariable inferenceVariable, TypeBinding typeBinding, int relation, boolean isSoft) {
 		this.left = inferenceVariable;
-		this.right = safeType(typeBinding);
+		this.right = typeBinding;
 		if (((inferenceVariable.tagBits | this.right.tagBits) & TagBits.AnnotationNullMASK) != 0) {
 			if ((inferenceVariable.tagBits & TagBits.AnnotationNullMASK) == (this.right.tagBits & TagBits.AnnotationNullMASK)) {
 				// strip off identical nullness on both sides:
@@ -58,20 +57,6 @@
 		this.relation = relation;
 		this.isSoft = isSoft;
 	}
-	
-	private TypeBinding safeType(TypeBinding type) {
-		if (type != null && type.isLocalType()) {
-			MethodBinding enclosingMethod = ((LocalTypeBinding) type.original()).enclosingMethod;
-			if (enclosingMethod != null && CharOperation.prefixEquals(TypeConstants.ANONYMOUS_METHOD, enclosingMethod.selector)) {
-				// don't use local class inside lambda: lambda is copied, type will be re-created and thus is unmatchable
-				if (type.superclass().id == TypeIds.T_JavaLangObject && type.superInterfaces().length > 0)
-					return type.superInterfaces()[0];
-				return type.superclass();
-			}
-		}
-		return type;
-	}
-
 
 	/** distinguish bounds from dependencies. */
 	boolean isBound() {
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 33dd126..bd3949f 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
@@ -2084,14 +2084,19 @@
 }
 String deprecatedSinceValue(Supplier<AnnotationBinding[]> annotations) {
 	if (this.options != null && this.options.complianceLevel >= ClassFileConstants.JDK9) {
-		for (AnnotationBinding annotationBinding : annotations.get()) {
-			if (annotationBinding.getAnnotationType().id == TypeIds.T_JavaLangDeprecated) {
-				for (ElementValuePair elementValuePair : annotationBinding.getElementValuePairs()) {
-					if (CharOperation.equals(elementValuePair.getName(), TypeConstants.SINCE) && elementValuePair.value instanceof StringConstant)
-						return ((StringConstant) elementValuePair.value).stringValue();
+		ReferenceContext contextSave = this.referenceContext;
+		try {
+			for (AnnotationBinding annotationBinding : annotations.get()) {
+				if (annotationBinding.getAnnotationType().id == TypeIds.T_JavaLangDeprecated) {
+					for (ElementValuePair elementValuePair : annotationBinding.getElementValuePairs()) {
+						if (CharOperation.equals(elementValuePair.getName(), TypeConstants.SINCE) && elementValuePair.value instanceof StringConstant)
+							return ((StringConstant) elementValuePair.value).stringValue();
+					}
+					break;
 				}
-				break;
 			}
+		} finally {
+			this.referenceContext = contextSave;
 		}
 	}
 	return null;
@@ -9253,8 +9258,8 @@
 		nodeSourceStart(field, location),
 		nodeSourceEnd(field, location));
 }
-public void uninitializedLocalVariable(LocalVariableBinding binding, ASTNode location) {
-	binding.tagBits |= TagBits.NotInitialized;
+public void uninitializedLocalVariable(LocalVariableBinding binding, ASTNode location, Scope scope) {
+	binding.markAsUninitializedIn(scope);
 	String[] arguments = new String[] {new String(binding.readableName())};
 	this.handle(
 		methodHasMissingSwitchDefault() ? IProblem.UninitializedLocalVariableHintMissingDefault : IProblem.UninitializedLocalVariable,
@@ -14644,7 +14649,8 @@
 	char[][] annotationNames = (nullAnnotationTagBit == TagBits.AnnotationNonNull)
 			? this.options.nonNullAnnotationName
 			: this.options.nullableAnnotationName;
-	String[] args = new String[] { new String(annotationNames[annotationNames.length-1]), new String(type.getLastToken()) };
+	String typeName = new String(type.resolvedType.leafComponentType().readableName()); // use the actual name (accounting for 'var')
+	String[] args = new String[] { new String(annotationNames[annotationNames.length-1]), typeName };
 	Annotation annotation = findAnnotation(annotations, typeBit);
 	int start = annotation != null ? annotation.sourceStart : type.sourceStart;
 	int end = annotation != null ? annotation.sourceEnd : type.sourceEnd;
@@ -15378,7 +15384,6 @@
 	handle(IProblem.UnnamedPackageInNamedModule,
 			args,
 			args,
-			ProblemSeverities.Warning,
 			0,
 			0);
 }
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java
index c32455f..c7edcbe 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java
@@ -73,7 +73,7 @@
 		case Binding.LOCAL : // reading a local variable
 			LocalVariableBinding localBinding;
 			if (!flowInfo.isDefinitelyAssigned(localBinding = (LocalVariableBinding) this.binding)) {
-				currentScope.problemReporter().uninitializedLocalVariable(localBinding, this);
+				currentScope.problemReporter().uninitializedLocalVariable(localBinding, this, currentScope);
 			}
 			if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) {
 				localBinding.useFlag = LocalVariableBinding.USED;
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TextEditsBuilder.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TextEditsBuilder.java
index 8b40368..060df8d 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TextEditsBuilder.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/TextEditsBuilder.java
@@ -238,6 +238,10 @@
 				if (wrapPolicy.wrapMode != WrapMode.BLOCK_INDENT)
 					spaces += token.getIndent() - parentLineStart.getIndent();
 				token = parentLineStart;
+				if (wrapPolicy == token.getWrapPolicy()) {
+					assert wrapPolicy == WrapPolicy.FORCE_FIRST_COLUMN || wrapPolicy == WrapPolicy.DISABLE_WRAP;
+					break;
+				}
 				wrapPolicy = token.getWrapPolicy();
 			}
 		}
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java
index 293ead7..011b8cc 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * Copyright (c) 2014, 2018 Mateusz Matela and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
 import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_BLOCK;
 import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_JAVADOC;
 import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_LINE;
+import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameWHITESPACE;
 
 import java.util.ArrayDeque;
 import java.util.ArrayList;
@@ -334,7 +335,9 @@
 				// (these are currently in a future line comment but will be removed)
 				structure.addAll(this.nlsTags);
 
-				if (structure.isEmpty()) { // all the tags have been moved to other lines
+				if (structure.isEmpty()
+						|| (structure.size() == 1 && structure.get(0).tokenType == TokenNameWHITESPACE)) {
+					// all the tags have been moved to other lines
 					WrapExecutor.this.tm.remove(index);
 					structureChanged();
 				}
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java
index 5a44b8d..536675f 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2014, 2016 Mateusz Matela and others.
+ * Copyright (c) 2014, 2018 Mateusz Matela and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -27,6 +27,7 @@
 import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameRPAREN;
 import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameSEMICOLON;
 import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameStringLiteral;
+import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameenum;
 import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameextends;
 import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameimplements;
 import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameIdentifier;
@@ -332,7 +333,8 @@
 			for (EnumConstantDeclaration constant : enumConstants)
 				this.wrapIndexes.add(this.tm.firstIndexIn(constant, -1));
 			this.wrapParentIndex = (this.options.alignment_for_enum_constants & Alignment.M_INDENT_ON_COLUMN) > 0
-					? this.tm.firstIndexBefore(enumConstants.get(0), TokenNameLBRACE) : this.tm.firstIndexIn(node, -1);
+					? this.tm.firstIndexBefore(enumConstants.get(0), TokenNameLBRACE)
+					: this.tm.firstIndexIn(node, TokenNameenum);
 			this.wrapGroupEnd = constantsEnd = this.tm.lastIndexIn(enumConstants.get(enumConstants.size() - 1), -1);
 			handleWrap(this.options.alignment_for_enum_constants, node);
 		}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java
index 7c38d53..5629858 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java
@@ -617,7 +617,7 @@
 	 * In the latter case the corresponding module description of the
 	 * location referenced by that classpath entry is returned.
 	 * 
-	 * @return the <code>IModule</code> this project represents.
+	 * @return the <code>IModuleDescription</code> this project represents.
 	 * @exception JavaModelException if this element does not exist or if an
 	 *		exception occurs while accessing its corresponding resource
 	 * @since 3.14
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelCache.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelCache.java
index 10b8c79..119b169 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelCache.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelCache.java
@@ -16,7 +16,6 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.eclipse.jdt.core.IAccessRule;
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.IPackageFragment;
@@ -83,7 +82,7 @@
 	/**
 	 * Cache of access rules
 	 */
-	protected LRUCache<IAccessRule, IAccessRule> accessRuleCache;
+	protected LRUCache<ClasspathAccessRule, ClasspathAccessRule> accessRuleCache;
 
 
 	/**
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 e6e02d5..1fc724c 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
@@ -3837,7 +3837,7 @@
 		private IAccessRule loadAccessRule() throws IOException {
 			int problemId = loadInt();
 			IPath pattern = loadPath();
-			return getAccessRule(pattern, problemId);
+			return getAccessRuleForProblemId(pattern.toString().toCharArray(), problemId);
 		}
 
 		private IAccessRule[] loadAccessRules() throws IOException {
@@ -5659,8 +5659,20 @@
 	 * @return an access rule
 	 */
 	public IAccessRule getAccessRule(IPath filePattern, int kind) {
-		IAccessRule rule = new ClasspathAccessRule(filePattern, kind);
-		IAccessRule cachedRule = this.cache.accessRuleCache.get(rule);
+		ClasspathAccessRule rule = new ClasspathAccessRule(filePattern, kind);
+		return getFromCache(rule);
+	}
+
+	/**
+	 * Used only for loading rules from disk.
+	 */
+	public ClasspathAccessRule getAccessRuleForProblemId(char [] filePattern, int problemId) {
+		ClasspathAccessRule rule = new ClasspathAccessRule(filePattern, problemId);
+		return getFromCache(rule);
+	}
+
+	private ClasspathAccessRule getFromCache(ClasspathAccessRule rule) {
+		ClasspathAccessRule cachedRule = this.cache.accessRuleCache.get(rule);
 		if (cachedRule != null) {
 			return cachedRule;
 		}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
index 7449924..d49b14f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
@@ -571,6 +571,47 @@
 				} else {
 					rootIDs.add(rootID);
 				}
+			} else {
+				if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
+					computeExpandedClasspathFromModularProject(rootIDs, accumulatedEntries, excludeTestCode, workspaceRoot);
+				}
+			}
+		}
+	}
+
+	private void computeExpandedClasspathFromModularProject(HashSet rootIDs,
+			ObjectVector accumulatedEntries, boolean excludeTestCode, IWorkspaceRoot workspaceRoot)
+			throws JavaModelException {
+		IModuleDescription referring = this.getModuleDescription();
+		if (referring == null)
+			return;
+		IClasspathEntry[] resolvedClasspath = getResolvedClasspath();
+		for (IClasspathEntry iEntry : resolvedClasspath) {
+			ClasspathEntry entry = (ClasspathEntry) iEntry;
+			if (iEntry.getEntryKind() == IClasspathEntry.CPE_PROJECT && entry.isModular()) {
+				String rootID = entry.rootID();
+				if (rootIDs.contains(rootID)) {
+					continue;
+				}
+				rootIDs.add(rootID);
+				IModuleDescription referred = null;
+				IResource member = workspaceRoot.findMember(iEntry.getPath());
+				JavaProject referredProject = null;
+				if (member != null && member.getType() == IResource.PROJECT) {
+					IProject projRsc = (IProject) member;
+					referredProject = (JavaProject) JavaCore.create(projRsc);
+					referred = referredProject.getModuleDescription();
+					if (referred != null) {
+						IModule module = NameLookup.getModuleDescriptionInfo(referring);
+						IModuleReference[] requires = module.requires();
+						for (IModuleReference req : requires) {
+							if (CharOperation.equals(req.name(), referred.getElementName().toCharArray())) {
+								accumulatedEntries.add(entry);
+							}
+						}
+					}
+					referredProject.computeExpandedClasspathFromModularProject(rootIDs, accumulatedEntries, excludeTestCode, workspaceRoot);
+				}
 			}
 		}
 	}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java
index d6605be..ac576b2 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java
@@ -16,7 +16,6 @@
 
 import org.eclipse.core.resources.*;
 import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.core.compiler.IProblem;
 import org.eclipse.jdt.internal.compiler.env.AccessRuleSet;
@@ -456,12 +455,12 @@
 	int length = in.readInt();
 	if (length == 0) return null; // no restriction specified
 	AccessRule[] accessRules = new AccessRule[length];
+	JavaModelManager manager = JavaModelManager.getJavaModelManager();
 	for (int i = 0; i < length; i++) {
 		char[] pattern = readName(in);
 		int problemId = in.readInt();
-		accessRules[i] = (AccessRule) JavaCore.newAccessRule(new Path(new String(pattern)), problemId);
+		accessRules[i] = manager.getAccessRuleForProblemId(pattern,problemId);
 	}
-	JavaModelManager manager = JavaModelManager.getJavaModelManager();
 	return new AccessRuleSet(accessRules, in.readByte(), manager.intern(in.readUTF()));
 }
 
diff --git a/org.eclipse.jdt.core/pom.xml b/org.eclipse.jdt.core/pom.xml
index 9a3835a..10fad74 100644
--- a/org.eclipse.jdt.core/pom.xml
+++ b/org.eclipse.jdt.core/pom.xml
@@ -14,11 +14,11 @@
   <parent>
     <artifactId>eclipse.jdt.core</artifactId>
     <groupId>eclipse.jdt.core</groupId>
-    <version>4.8.0-SNAPSHOT</version>
+    <version>4.9.0-SNAPSHOT</version>
   </parent>
   <groupId>org.eclipse.jdt</groupId>
   <artifactId>org.eclipse.jdt.core</artifactId>
-  <version>3.14.0-SNAPSHOT</version>
+  <version>3.14.100-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <properties>
diff --git a/org.eclipse.jdt.core/scripts/about.html b/org.eclipse.jdt.core/scripts/about.html
index 4602330..164f781 100644
--- a/org.eclipse.jdt.core/scripts/about.html
+++ b/org.eclipse.jdt.core/scripts/about.html
@@ -2,27 +2,35 @@
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
 <title>About</title>
 </head>
 <body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>June 2, 2006</p>	
-<h3>License</h3>
+	<h2>About This Content</h2>
 
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+	<p>November 30, 2017</p>
+	<h3>License</h3>
 
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content.  Check the Redistributor's license that was 
-provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+	<p>
+		The Eclipse Foundation makes available all content in this plug-in
+		(&quot;Content&quot;). Unless otherwise indicated below, the Content
+		is provided to you under the terms and conditions of the Eclipse
+		Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
+		available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
+		For purposes of the EPL, &quot;Program&quot; will mean the Content.
+	</p>
+
+	<p>
+		If you did not receive this Content directly from the Eclipse
+		Foundation, the Content is being redistributed by another party
+		(&quot;Redistributor&quot;) and different terms and conditions may
+		apply to your use of any object code in the Content. Check the
+		Redistributor's license that was provided with the Content. If no such
+		license exists, contact the Redistributor. Unless otherwise indicated
+		below, the terms and conditions of the EPL still apply to any source
+		code in the Content and such source code may be obtained at <a
+			href="http://www.eclipse.org/">http://www.eclipse.org</a>.
+	</p>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java
index 90c5f4c..f88ea99 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
 package org.eclipse.jdt.internal.core.index;
 
 import java.io.*;
+import java.util.regex.Pattern;
 
 import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.core.search.*;
@@ -63,6 +64,9 @@
 			return patternLength == wordLength && CharOperation.equals(pattern, word, false);
 		case SearchPattern.R_PREFIX_MATCH :
 			return patternLength <= wordLength && CharOperation.prefixEquals(pattern, word, false);
+		case SearchPattern.R_REGEXP_MATCH :
+			Pattern regexPattern = Pattern.compile(new String(pattern));
+			return regexPattern.matcher(new String(word)).matches();
 		case SearchPattern.R_PATTERN_MATCH :
 			return CharOperation.match(pattern, word, false);
 		case SearchPattern.R_CAMELCASE_MATCH:
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 f499b83..73ecb57 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
@@ -1036,7 +1036,9 @@
 }
 public void scheduleDocumentIndexing(final SearchDocument searchDocument, IPath container, final IndexLocation indexLocation, final SearchParticipant searchParticipant) {
 	IPath targetLocation = JavaIndex.getLocationForPath(new Path(searchDocument.getPath()));
-	this.indexer.makeDirty(targetLocation);
+	if (targetLocation != null) {
+		this.indexer.makeDirty(targetLocation);
+	}
 	request(new IndexRequest(container, this) {
 		@Override
 		public boolean execute(IProgressMonitor progressMonitor) {