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);
+	}
+}