Update jdt.core from origin BETA_JAVA8 with
b6bc90c50286b74cfcc0b4c67c3ded3be552505d upto
ca551e9f50d120a7df024c143f37ec7681949c67
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java
index 22ef5a5..0b4c6cd 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java
@@ -1206,4 +1206,404 @@
 				expectedReplacedSource,
 				"diet ast");
 }
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735() {
+	String string = 
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"public class X {\n" +
+			"	void test1 (List<Person> people) {\n" +
+			"		people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
+			"	}\n" +
+			"}\n";
+
+			String completeBehind = "p.";
+			int cursorLocation = string.lastIndexOf(completeBehind) + completeBehind.length() - 1;
+
+			String expectedCompletionNodeToString = "<CompleteOnName:p.>";
+			String expectedParentNodeToString = "System.out.println(<CompleteOnName:p.>)";
+			String completionIdentifier = "";
+			String expectedReplacedSource = "p.";
+			String expectedUnitDisplayString =
+					"import java.util.List;\n" + 
+					"class Person {\n" + 
+					"  Person() {\n" + 
+					"  }\n" + 
+					"  String getLastName() {\n" + 
+					"  }\n" + 
+					"}\n" + 
+					"public class X {\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  void test1(List<Person> people) {\n" + 
+					"    people.stream().forEach((<no type> p) -> System.out.println(<CompleteOnName:p.>));\n" + 
+					"  }\n" + 
+					"}\n";
+
+			checkMethodParse(
+				string.toCharArray(),
+				cursorLocation,
+				expectedCompletionNodeToString,
+				expectedParentNodeToString,
+				expectedUnitDisplayString,
+				completionIdentifier,
+				expectedReplacedSource,
+				"diet ast");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735a() {
+	String string = 
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"public class X {\n" +
+			"	void test1 (List<Person> people) {\n" +
+			"		people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
+			"	}\n" +
+			"   void test2(List<Person> people) {\n" +
+			"       people.sort((x,y) -> x.|);  // OK\n" +
+			"   }\n" +
+			"}\n";
+
+			String completeBehind = "x.";
+			int cursorLocation = string.lastIndexOf(completeBehind) + completeBehind.length() - 1;
+
+			String expectedCompletionNodeToString = "<CompleteOnName:x.>";
+			String expectedParentNodeToString = "<NONE>";
+			String completionIdentifier = "";
+			String expectedReplacedSource = "x.";
+			String expectedUnitDisplayString =
+					"import java.util.List;\n" + 
+					"class Person {\n" + 
+					"  Person() {\n" + 
+					"  }\n" + 
+					"  String getLastName() {\n" + 
+					"  }\n" + 
+					"}\n" + 
+					"public class X {\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  void test1(List<Person> people) {\n" + 
+					"  }\n" + 
+					"  void test2(List<Person> people) {\n" + 
+					"    people.sort((<no type> x, <no type> y) -> <CompleteOnName:x.>);\n" + 
+					"  }\n" + 
+					"}\n";
+
+			checkMethodParse(
+				string.toCharArray(),
+				cursorLocation,
+				expectedCompletionNodeToString,
+				expectedParentNodeToString,
+				expectedUnitDisplayString,
+				completionIdentifier,
+				expectedReplacedSource,
+				"diet ast");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735b() {
+	String string = 
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"public class X {\n" +
+			"	void test1 (List<Person> people) {\n" +
+			"		people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
+			"	}\n" +
+			"   void test2(List<Person> people) {\n" +
+			"       people.sort((x,y) -> x.getLastName().compareTo(y.));\n" + 
+			"   }\n" +
+			"}\n";
+
+			String completeBehind = "y.";
+			int cursorLocation = string.lastIndexOf(completeBehind) + completeBehind.length() - 1;
+
+			String expectedCompletionNodeToString = "<CompleteOnName:y.>";
+			String expectedParentNodeToString = "x.getLastName().compareTo(<CompleteOnName:y.>)";
+			String completionIdentifier = "";
+			String expectedReplacedSource = "y.";
+			String expectedUnitDisplayString =
+					"import java.util.List;\n" + 
+					"class Person {\n" + 
+					"  Person() {\n" + 
+					"  }\n" + 
+					"  String getLastName() {\n" + 
+					"  }\n" + 
+					"}\n" + 
+					"public class X {\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  void test1(List<Person> people) {\n" + 
+					"  }\n" + 
+					"  void test2(List<Person> people) {\n" + 
+					"    people.sort((<no type> x, <no type> y) -> x.getLastName().compareTo(<CompleteOnName:y.>));\n" + 
+					"  }\n" + 
+					"}\n";
+
+			checkMethodParse(
+				string.toCharArray(),
+				cursorLocation,
+				expectedCompletionNodeToString,
+				expectedParentNodeToString,
+				expectedUnitDisplayString,
+				completionIdentifier,
+				expectedReplacedSource,
+				"diet ast");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735c() {
+	String string = 
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"public class X {\n" +
+			"	void test1 (List<Person> people) {\n" +
+			"		people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
+			"	}\n" +
+			"   void test2(List<Person> people) {\n" +
+			"       people.sort((x,y) -> x.getLastName() + y.);\n" + 
+			"   }\n" +
+			"}\n";
+
+			String completeBehind = "y.";
+			int cursorLocation = string.lastIndexOf(completeBehind) + completeBehind.length() - 1;
+
+			String expectedCompletionNodeToString = "<CompleteOnName:y.>";
+			String expectedParentNodeToString = "(x.getLastName() + <CompleteOnName:y.>)";
+			String completionIdentifier = "";
+			String expectedReplacedSource = "y.";
+			String expectedUnitDisplayString =
+					"import java.util.List;\n" + 
+					"class Person {\n" + 
+					"  Person() {\n" + 
+					"  }\n" + 
+					"  String getLastName() {\n" + 
+					"  }\n" + 
+					"}\n" + 
+					"public class X {\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  void test1(List<Person> people) {\n" + 
+					"  }\n" + 
+					"  void test2(List<Person> people) {\n" + 
+					"    people.sort((<no type> x, <no type> y) -> (x.getLastName() + <CompleteOnName:y.>));\n" + 
+					"  }\n" + 
+					"}\n";
+
+			checkMethodParse(
+				string.toCharArray(),
+				cursorLocation,
+				expectedCompletionNodeToString,
+				expectedParentNodeToString,
+				expectedUnitDisplayString,
+				completionIdentifier,
+				expectedReplacedSource,
+				"diet ast");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735d() {
+	String string = 
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"public class X {\n" +
+			"	void test1 (List<Person> people) {\n" +
+			"		people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
+			"	}\n" +
+			"   void test2(List<Person> people) {\n" +
+			"       people.sort((x,y) -> \"\" + x.); \n" + 
+			"   }\n" +
+			"}\n";
+
+			String completeBehind = "x.";
+			int cursorLocation = string.lastIndexOf(completeBehind) + completeBehind.length() - 1;
+
+			String expectedCompletionNodeToString = "<CompleteOnName:x.>";
+			String expectedParentNodeToString = "(\"\" + <CompleteOnName:x.>)";
+			String completionIdentifier = "";
+			String expectedReplacedSource = "x.";
+			String expectedUnitDisplayString =
+					"import java.util.List;\n" + 
+					"class Person {\n" + 
+					"  Person() {\n" + 
+					"  }\n" + 
+					"  String getLastName() {\n" + 
+					"  }\n" + 
+					"}\n" + 
+					"public class X {\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  void test1(List<Person> people) {\n" + 
+					"  }\n" + 
+					"  void test2(List<Person> people) {\n" + 
+					"    people.sort((<no type> x, <no type> y) -> (\"\" + <CompleteOnName:x.>));\n" + 
+					"  }\n" + 
+					"}\n";
+
+			checkMethodParse(
+				string.toCharArray(),
+				cursorLocation,
+				expectedCompletionNodeToString,
+				expectedParentNodeToString,
+				expectedUnitDisplayString,
+				completionIdentifier,
+				expectedReplacedSource,
+				"diet ast");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735e() { // field
+	String string = 
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"interface I {\n" +
+			"	int foo(Person p, Person q);\n" +
+			"}\n" +
+			"public class X {\n" +
+			"	I i =  (x, y) -> 10 + x.getLastName().compareTo(y.get);\n" +
+			"}\n";
+
+			String completeBehind = "y.get";
+			int cursorLocation = string.lastIndexOf(completeBehind) + completeBehind.length() - 1;
+
+			String expectedCompletionNodeToString = "<CompleteOnName:y.get>";
+			String expectedParentNodeToString = "x.getLastName().compareTo(<CompleteOnName:y.get>)";
+			String completionIdentifier = "get";
+			String expectedReplacedSource = "y.get";
+			String expectedUnitDisplayString =
+					"class Person {\n" + 
+					"  Person() {\n" + 
+					"  }\n" + 
+					"  String getLastName() {\n" + 
+					"  }\n" + 
+					"}\n" + 
+					"interface I {\n" + 
+					"  int foo(Person p, Person q);\n" + 
+					"}\n" + 
+					"public class X {\n" + 
+					"  I i = (<no type> x, <no type> y) -> (10 + x.getLastName().compareTo(<CompleteOnName:y.get>));\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"}\n";
+
+			checkMethodParse(
+				string.toCharArray(),
+				cursorLocation,
+				expectedCompletionNodeToString,
+				expectedParentNodeToString,
+				expectedUnitDisplayString,
+				completionIdentifier,
+				expectedReplacedSource,
+				"diet ast");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735f() { // local
+	String string = 
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"interface I {\n" +
+			"	int foo(Person p, Person q);\n" +
+			"}\n" +
+			"public class X {\n" +
+			"   void foo() {\n" +
+			"	    I i =  (x, y) -> 10 + x.getLastName().compareTo(y.get);\n" +
+			"   }\n" +
+			"}\n";
+
+			String completeBehind = "y.get";
+			int cursorLocation = string.lastIndexOf(completeBehind) + completeBehind.length() - 1;
+
+			String expectedCompletionNodeToString = "<CompleteOnName:y.get>";
+			String expectedParentNodeToString = "x.getLastName().compareTo(<CompleteOnName:y.get>)";
+			String completionIdentifier = "get";
+			String expectedReplacedSource = "y.get";
+			String expectedUnitDisplayString =
+					"class Person {\n" + 
+					"  Person() {\n" + 
+					"  }\n" + 
+					"  String getLastName() {\n" + 
+					"  }\n" + 
+					"}\n" + 
+					"interface I {\n" + 
+					"  int foo(Person p, Person q);\n" + 
+					"}\n" + 
+					"public class X {\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"  void foo() {\n" + 
+					"    I i = (<no type> x, <no type> y) -> (10 + x.getLastName().compareTo(<CompleteOnName:y.get>));\n" + 
+					"  }\n" + 
+					"}\n";
+
+			checkMethodParse(
+				string.toCharArray(),
+				cursorLocation,
+				expectedCompletionNodeToString,
+				expectedParentNodeToString,
+				expectedUnitDisplayString,
+				completionIdentifier,
+				expectedReplacedSource,
+				"diet ast");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735g() { // initializer block
+	String string = 
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"interface I {\n" +
+			"	int foo(Person p, Person q);\n" +
+			"}\n" +
+			"public class X {\n" +
+			"   List<Person> people;\n" +
+			"   {\n" +
+			"       people.sort((x,y) -> \"\" + x.); \n" + 
+			"   }\n" +
+			"}\n";
+
+			String completeBehind = "x.";
+			int cursorLocation = string.lastIndexOf(completeBehind) + completeBehind.length() - 1;
+
+			String expectedCompletionNodeToString = "<CompleteOnName:x.>";
+			String expectedParentNodeToString = "(\"\" + <CompleteOnName:x.>)";
+			String completionIdentifier = "";
+			String expectedReplacedSource = "x.";
+			String expectedUnitDisplayString =
+					"import java.util.List;\n" + 
+					"class Person {\n" + 
+					"  Person() {\n" + 
+					"  }\n" + 
+					"  String getLastName() {\n" + 
+					"  }\n" + 
+					"}\n" + 
+					"interface I {\n" + 
+					"  int foo(Person p, Person q);\n" + 
+					"}\n" + 
+					"public class X {\n" + 
+					"  List<Person> people;\n" + 
+					"  {\n" + 
+					"    people.sort((<no type> x, <no type> y) -> (\"\" + <CompleteOnName:x.>));\n" + 
+					"  }\n" + 
+					"  public X() {\n" + 
+					"  }\n" + 
+					"}\n";
+
+			checkMethodParse(
+				string.toCharArray(),
+				cursorLocation,
+				expectedCompletionNodeToString,
+				expectedParentNodeToString,
+				expectedUnitDisplayString,
+				completionIdentifier,
+				expectedReplacedSource,
+				"diet ast");
+}
 }
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 beba0a3..868d590 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
@@ -105,7 +105,7 @@
 				"	public java.util.Comparator<*> reverseOrder() { return null;}\n" +
 				"	public java.util.Comparator<*> reversed() { return null;}\n" +
 				"	public java.util.Comparator<*> thenComparing(java.util.Comparator<? super *> other) { return null;}\n" +
-				"	public <% extends java.lang.Comparable<? super %>> java.util.Comparator<*> thenComparing(java.util.function.Function<? super *, ? extends %> keyExtractor, java.util.Comparator<? super %> keyComparator) { return null;}\n" +
+				"	public <%> java.util.Comparator<*> thenComparing(java.util.function.Function<? super *, ? extends %> keyExtractor, java.util.Comparator<? super %> keyComparator) { return null;}\n" +
 				"	public <% extends java.lang.Comparable<? super %>> java.util.Comparator<*> thenComparing(java.util.function.Function<? super *, ? extends %> keyExtractor) { return null;}\n" +
 				"	public java.util.Comparator<*> thenComparingInt(java.util.function.ToIntFunction<? super *> keyExtractor) { return null;}\n" +
 				"	public java.util.Comparator<*> thenComparingLong(java.util.function.ToLongFunction<? super *> keyExtractor) { return null;}\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
index 0c3c554..d4dd135 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
@@ -1,12 +1,18 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2011 IBM Corporation and others.
+ * Copyright (c) 2003, 2014 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Stephan Herrmann - Contributions for 
+ *								Bug 428274 - [1.8] [compiler] Cannot cast from Number to double
  *******************************************************************************/
 package org.eclipse.jdt.core.tests.compiler.regression;
 
@@ -36,6 +42,9 @@
 	return buildAllCompliancesTestSuite(testClass());
 }
 
+static {
+//	TESTS_NAMES = new String[] { "test428388d" };
+}
 /*
  * check extra checkcast (interface->same interface)
  */
@@ -2471,6 +2480,623 @@
 			"SUCCESS"
 		);
 }
+
+public void testBug428274() {
+	String source = 
+			"public class Junk4 {\n" + 
+			"    static void setValue(Number n) {\n" + 
+			"        int rounded = (int) Math.round((double) n);\n" +
+			"		System.out.println(rounded);\n" + 
+			"    }\n" +
+			"	public static void main(String[] args) {\n" +
+			"		setValue(Double.valueOf(3.3));\n" +
+			"		setValue(Double.valueOf(3.7));\n" +
+			"	}\n" + 
+			"}\n";
+	if (this.complianceLevel < ClassFileConstants.JDK1_7) {
+		runNegativeTest(
+			new String[] {
+				"Junk4.java",
+				source
+			},
+			"----------\n" + 
+			"1. ERROR in Junk4.java (at line 3)\n" + 
+			"	int rounded = (int) Math.round((double) n);\n" + 
+			"	                               ^^^^^^^^^^\n" + 
+			"Cannot cast from Number to double\n" + 
+			"----------\n");
+	} else {
+		runConformTest(
+			new String[] {
+				"Junk4.java",
+				source
+			},
+			"3\n4");
+	}
+}
+public void testBug428274b() {
+	if (this.complianceLevel < ClassFileConstants.JDK1_5)
+		return; // uses generics
+	String source = 
+			"public class Junk4<T> {\n" + 
+			"    void setValue(T n) {\n" + 
+			"        int rounded = (int) Math.round((double) n);\n" +
+			"		System.out.println(rounded);\n" + 
+			"    }\n" +
+			"	public static void main(String[] args) {\n" +
+			"		Junk4<Number> j = new Junk4<Number>();\n" +
+			"		j.setValue(Double.valueOf(3.3));\n" +
+			"		j.setValue(Double.valueOf(3.7));\n" +
+			"	}\n" + 
+			"}\n";
+	if (this.complianceLevel < ClassFileConstants.JDK1_7) {
+		runNegativeTest(
+			new String[] {
+				"Junk4.java",
+				source
+			},
+			"----------\n" + 
+			"1. ERROR in Junk4.java (at line 3)\n" + 
+			"	int rounded = (int) Math.round((double) n);\n" + 
+			"	                               ^^^^^^^^^^\n" + 
+			"Cannot cast from T to double\n" + 
+			"----------\n");
+	} else {
+		runConformTest(
+			new String[] {
+				"Junk4.java",
+				source
+			},
+			"3\n4");
+	}
+}
+// note: spec allows all reference types, but neither javac nor common sense accept arrays :)
+public void testBug428274c() {
+	String source = 
+			"public class Junk4 {\n" + 
+			"    static void setValue(Object[] n) {\n" + 
+			"        int rounded = (int) Math.round((double) n);\n" +
+			"		System.out.println(rounded);\n" + 
+			"    }\n" +
+			"	public static void main(String[] args) {\n" +
+			"		setValue(new Double[] { Double.valueOf(3.3) });\n" +
+			"	}\n" + 
+			"}\n";
+	runNegativeTest(
+		new String[] {
+			"Junk4.java",
+			source
+		},
+		"----------\n" + 
+		"1. ERROR in Junk4.java (at line 3)\n" + 
+		"	int rounded = (int) Math.round((double) n);\n" + 
+		"	                               ^^^^^^^^^^\n" + 
+		"Cannot cast from Object[] to double\n" + 
+		"----------\n");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
+public void test428388() {
+	runNegativeTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" +
+			"    public static void main(String[] args) {\n" +
+			"	int x = (int) \"Hello\";\n" +
+			"    }\n" +
+			"}\n"
+		},
+		"----------\n" + 
+		"1. ERROR in X.java (at line 3)\n" + 
+		"	int x = (int) \"Hello\";\n" + 
+		"	        ^^^^^^^^^^^^^\n" + 
+		"Cannot cast from String to int\n" + 
+		"----------\n");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
+public void test428388a() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_7)
+		return;
+	
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" + 
+			"    static void setValue(Number n) {\n" + 
+			"       int rounded = (int) Math.round((double) n);\n" +
+			"		System.out.println(rounded);\n" + 
+			"    }\n" +
+			"	public static void main(String[] args) {\n" +
+			"		setValue(Double.valueOf(3.3));\n" +
+			"		setValue(Double.valueOf(3.7));\n" +
+			"	}\n" + 
+			"}\n",
+		},
+		"3\n4");
+
+	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
+	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(new File(OUTPUT_DIR + File.separator  +"X.class"));
+	String actualOutput =
+		disassembler.disassemble(
+			classFileBytes,
+			"\n",
+			ClassFileBytesDisassembler.DETAILED);
+
+	String expectedOutput =
+			"  // Method descriptor #15 (Ljava/lang/Number;)V\n" + 
+			"  // Stack: 2, Locals: 2\n" + 
+			"  static void setValue(java.lang.Number n);\n" + 
+			"     0  aload_0 [n]\n" + 
+			"     1  checkcast java.lang.Double [16]\n" + 
+			"     4  invokevirtual java.lang.Double.doubleValue() : double [18]\n" + 
+			"     7  invokestatic java.lang.Math.round(double) : long [22]\n" + 
+			"    10  l2i\n" + 
+			"    11  istore_1 [rounded]\n" + 
+			"    12  getstatic java.lang.System.out : java.io.PrintStream [28]\n" + 
+			"    15  iload_1 [rounded]\n" + 
+			"    16  invokevirtual java.io.PrintStream.println(int) : void [34]\n" + 
+			"    19  return\n" + 
+			"      Line numbers:\n" + 
+			"        [pc: 0, line: 3]\n" + 
+			"        [pc: 12, line: 4]\n" + 
+			"        [pc: 19, line: 5]\n" + 
+			"      Local variable table:\n" + 
+			"        [pc: 0, pc: 20] local: n index: 0 type: java.lang.Number\n" + 
+			"        [pc: 12, pc: 20] local: rounded index: 1 type: int\n" + 
+			"  \n";
+	int index = actualOutput.indexOf(expectedOutput);
+	if (index == -1 || expectedOutput.length() == 0) {
+		System.out.println(Util.displayString(actualOutput, 2));
+	}
+	if (index == -1) {
+		assertEquals("Wrong contents", expectedOutput, actualOutput);
+	}
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
+public void test428388b() throws Exception {
+	this.runNegativeTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" + 
+			"    static void setValue(Number n) {\n" + 
+			"       char rounded = (char) n;\n" +
+			"		System.out.println(rounded);\n" + 
+			"    }\n" +
+			"	public static void main(String[] args) {\n" +
+			"		setValue(Double.valueOf(3.3));\n" +
+			"		setValue(Double.valueOf(3.7));\n" +
+			"	}\n" + 
+			"}\n",
+		},
+		"----------\n" + 
+		"1. ERROR in X.java (at line 3)\n" + 
+		"	char rounded = (char) n;\n" + 
+		"	               ^^^^^^^^\n" + 
+		"Cannot cast from Number to char\n" + 
+		"----------\n");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
+public void test428388c() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_7)
+		return;
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" + 
+			"    static void setValue(Number n) {\n" + 
+			"       try {\n" +		
+			"           byte rounded = (byte) n;\n" +
+			"		    System.out.println(rounded);\n" +
+			"       } catch (ClassCastException c) {\n" +
+			"           System.out.println(\"CCE\");\n" +
+			"       }\n" +
+			"    }\n" +
+			"	public static void main(String[] args) {\n" +
+			"		setValue(Double.valueOf(3.3));\n" +
+			"		setValue(Double.valueOf(3.7));\n" +
+			"	}\n" + 
+			"}\n",
+		},
+		"CCE\nCCE");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
+public void test428388d() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_7)
+		return;
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"import java.io.Serializable;\n" +
+			"public class X implements Serializable {\n" +
+			"	static int test(Serializable v) {\n" +
+			"       try {\n" +
+			"		    return (int)v;\n" +
+			"       } catch (ClassCastException c) {\n" +
+			"           System.out.println(\"CCE\");\n" +
+			"       }\n" +
+			"       return -1;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		int i = test(new X());\n" +
+			"		System.out.println(i);\n" +
+			"	}\n" +
+			"}\n",
+		},
+		"CCE\n-1");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
+public void test428388e() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_7)
+		return;
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"import java.io.Serializable;\n" +
+			"public class X implements Serializable {\n" +
+			"	static int test(Serializable v) {\n" +
+			"       try {\n" +
+			"		    return (int)v;\n" +
+			"       } catch (ClassCastException c) {\n" +
+			"           System.out.println(\"CCE\");\n" +
+			"       }\n" +
+			"       return -1;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		int i = test(new Long(1234));\n" +
+			"		System.out.println(i);\n" +
+			"	}\n" +
+			"}\n",
+		},
+		"CCE\n-1");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
+public void test428388f() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_7)
+		return;
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"import java.io.Serializable;\n" +
+			"public class X implements Serializable {\n" +
+			"	static int test(Serializable v) {\n" +
+			"       try {\n" +
+			"		    return (int)v;\n" +
+			"       } catch (ClassCastException c) {\n" +
+			"           System.out.println(\"CCE\");\n" +
+			"       }\n" +
+			"       return -1;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		int i = test(new Integer(1234));\n" +
+			"		System.out.println(i);\n" +
+			"	}\n" +
+			"}\n",
+		},
+		"1234");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
+public void test428388g() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_7)
+		return;
+	this.runNegativeTest(
+		new String[] {
+			"X.java",
+			"import java.io.Serializable;\n" +
+			"public class X implements Serializable {\n" +
+			"  static <S extends Boolean & Serializable>int test(S b) {\n" +
+			"    return (int) b;\n" +
+			"  }\n" +
+			"\n" +
+			"  public static void main(String[] args) {\n" +
+			"    int i = test(Boolean.TRUE);\n" +
+			"    System.out.println(i);\n" +
+			"  }\n" +
+			"}\n",
+		},
+		"----------\n" + 
+		"1. WARNING in X.java (at line 2)\n" + 
+		"	public class X implements Serializable {\n" + 
+		"	             ^\n" + 
+		"The serializable class X does not declare a static final serialVersionUID field of type long\n" + 
+		"----------\n" + 
+		"2. WARNING in X.java (at line 3)\n" + 
+		"	static <S extends Boolean & Serializable>int test(S b) {\n" + 
+		"	                  ^^^^^^^\n" + 
+		"The type parameter S should not be bounded by the final type Boolean. Final types cannot be further extended\n" + 
+		"----------\n" + 
+		"3. ERROR in X.java (at line 4)\n" + 
+		"	return (int) b;\n" + 
+		"	       ^^^^^^^\n" + 
+		"Cannot cast from S to int\n" + 
+		"----------\n");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
+public void test428388h() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_8)
+		return; // uses intersection cast
+	this.runNegativeTest(
+		new String[] {
+			"X.java",
+			"import java.io.Serializable;\n" +
+			"public class X implements Serializable {\n" +
+			"  static int test(Serializable b) {\n" +
+			"    return (int) (Boolean & Serializable) b;\n" +
+			"  }\n" +
+			"  public static void main(String[] args) {\n" +
+			"    int i = test(Boolean.TRUE);\n" +
+			"    System.out.println(i);\n" +
+			"  }\n" +
+			"}\n",
+		},
+		"----------\n" + 
+		"1. WARNING in X.java (at line 2)\n" + 
+		"	public class X implements Serializable {\n" + 
+		"	             ^\n" + 
+		"The serializable class X does not declare a static final serialVersionUID field of type long\n" + 
+		"----------\n" + 
+		"2. ERROR in X.java (at line 4)\n" + 
+		"	return (int) (Boolean & Serializable) b;\n" + 
+		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+		"Cannot cast from Boolean & Serializable to int\n" + 
+		"----------\n");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
+public void test428388i() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_7)
+		return;
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"import java.io.Serializable;\n" +
+			"public class X implements Serializable {\n" +
+			"	static int test(Serializable v) {\n" +
+			"       try {\n" +
+			"		    return (int)v;\n" +
+			"       } catch (ClassCastException c) {\n" +
+			"           System.out.println(\"CCE\");\n" +
+			"       }\n" +
+			"       return -1;\n" +
+			"	}\n" +
+			"	public static void main(String[] args) {\n" +
+			"		int i = test(new Integer(1234));\n" +
+			"		System.out.println(i);\n" +
+			"	}\n" +
+			"}\n",
+		},
+		"1234");
+	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
+	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(new File(OUTPUT_DIR + File.separator  +"X.class"));
+	String actualOutput =
+		disassembler.disassemble(
+			classFileBytes,
+			"\n",
+			ClassFileBytesDisassembler.DETAILED);
+
+	String expectedOutput =
+			"  // Method descriptor #17 (Ljava/io/Serializable;)I\n" + 
+			"  // Stack: 2, Locals: 2\n" + 
+			"  static int test(java.io.Serializable v);\n" + 
+			"     0  aload_0 [v]\n" + 
+			"     1  checkcast java.lang.Integer [18]\n" + 
+			"     4  invokevirtual java.lang.Integer.intValue() : int [20]\n" + 
+			"     7  ireturn\n" + 
+			"     8  astore_1 [c]\n" + 
+			"     9  getstatic java.lang.System.out : java.io.PrintStream [24]\n" + 
+			"    12  ldc <String \"CCE\"> [30]\n" + 
+			"    14  invokevirtual java.io.PrintStream.println(java.lang.String) : void [32]\n" + 
+			"    17  iconst_m1\n" + 
+			"    18  ireturn\n";
+	
+	int index = actualOutput.indexOf(expectedOutput);
+	if (index == -1 || expectedOutput.length() == 0) {
+		System.out.println(Util.displayString(actualOutput, 2));
+	}
+	if (index == -1) {
+		assertEquals("Wrong contents", expectedOutput, actualOutput);
+	}
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428388, [1.8][compiler] Casting to primitives is over tolerant - probable regression since bug 428274
+public void test428388j() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_8)
+		return; // uses intersection cast
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"import java.io.Serializable;\n" +
+			"public class X implements Serializable {\n" +
+			"  static int test(Serializable b) {\n" +
+			"    return (int) (Integer & Serializable) b;\n" +
+			"  }\n" +
+			"  public static void main(String[] args) {\n" +
+			"    int i = test(10101010);\n" +
+			"    System.out.println(i);\n" +
+			"  }\n" +
+			"}\n",
+		},
+		"10101010");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522,  [1.8] VerifyError when a non primitive type cast to primitive type 
+public void test428522() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_7)
+		return;
+	Map customOptions = getCompilerOptions();
+	customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" +
+			"    public static void main(String args[]) {\n" +
+			"    	long l = (long) ((Object) 100L);\n" +
+			"    	System.out.println(\"OK\");\n" +
+			"    }\n" +
+			"}\n",
+		},
+		"OK", customOptions);
+	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
+	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(new File(OUTPUT_DIR + File.separator  +"X.class"));
+	String actualOutput =
+		disassembler.disassemble(
+			classFileBytes,
+			"\n",
+			ClassFileBytesDisassembler.DETAILED);
+
+	String expectedOutput =
+			"  // Method descriptor #15 ([Ljava/lang/String;)V\n" + 
+			"  // Stack: 2, Locals: 1\n" + 
+			"  public static void main(java.lang.String[] args);\n" + 
+			"     0  ldc2_w <Long 100> [16]\n" + 
+			"     3  invokestatic java.lang.Long.valueOf(long) : java.lang.Long [18]\n" + 
+			"     6  checkcast java.lang.Long [19]\n" + 
+			"     9  invokevirtual java.lang.Long.longValue() : long [24]\n" + 
+			"    12  pop2\n" + 
+			"    13  getstatic java.lang.System.out : java.io.PrintStream [28]\n" + 
+			"    16  ldc <String \"OK\"> [34]\n" + 
+			"    18  invokevirtual java.io.PrintStream.println(java.lang.String) : void [36]\n" + 
+			"    21  return\n" + 
+			"      Line numbers:\n" + 
+			"        [pc: 0, line: 3]\n" + 
+			"        [pc: 13, line: 4]\n" + 
+			"        [pc: 21, line: 5]\n" + 
+			"      Local variable table:\n" + 
+			"        [pc: 0, pc: 22] local: args index: 0 type: java.lang.String[]\n" + 
+			"}";
+	int index = actualOutput.indexOf(expectedOutput);
+	if (index == -1 || expectedOutput.length() == 0) {
+		System.out.println(Util.displayString(actualOutput, 2));
+	}
+	if (index == -1) {
+		assertEquals("Wrong contents", expectedOutput, actualOutput);
+	}
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522,  [1.8] VerifyError when a non primitive type cast to primitive type 
+public void test428522a() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_7)
+		return;
+	Map customOptions = getCompilerOptions();
+	customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.PRESERVE);
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" +
+			"    public static void main(String args[]) {\n" +
+			"    	long l = (long) ((Object) 100L);\n" +
+			"    	System.out.println(\"OK\");\n" +
+			"    }\n" +
+			"}\n",
+		},
+		"OK", customOptions);
+	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
+	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(new File(OUTPUT_DIR + File.separator  +"X.class"));
+	String actualOutput =
+		disassembler.disassemble(
+			classFileBytes,
+			"\n",
+			ClassFileBytesDisassembler.DETAILED);
+
+	String expectedOutput =
+			"  // Method descriptor #15 ([Ljava/lang/String;)V\n" + 
+			"  // Stack: 2, Locals: 3\n" + 
+			"  public static void main(java.lang.String[] args);\n" + 
+			"     0  ldc2_w <Long 100> [16]\n" + 
+			"     3  invokestatic java.lang.Long.valueOf(long) : java.lang.Long [18]\n" + 
+			"     6  checkcast java.lang.Long [19]\n" + 
+			"     9  invokevirtual java.lang.Long.longValue() : long [24]\n" + 
+			"    12  lstore_1 [l]\n" + 
+			"    13  getstatic java.lang.System.out : java.io.PrintStream [28]\n" + 
+			"    16  ldc <String \"OK\"> [34]\n" + 
+			"    18  invokevirtual java.io.PrintStream.println(java.lang.String) : void [36]\n" + 
+			"    21  return\n" + 
+			"      Line numbers:\n" + 
+			"        [pc: 0, line: 3]\n" + 
+			"        [pc: 13, line: 4]\n" + 
+			"        [pc: 21, line: 5]\n" + 
+			"      Local variable table:\n" + 
+			"        [pc: 0, pc: 22] local: args index: 0 type: java.lang.String[]\n" + 
+			"        [pc: 13, pc: 22] local: l index: 1 type: long\n" + 
+			"}";
+	int index = actualOutput.indexOf(expectedOutput);
+	if (index == -1 || expectedOutput.length() == 0) {
+		System.out.println(Util.displayString(actualOutput, 2));
+	}
+	if (index == -1) {
+		assertEquals("Wrong contents", expectedOutput, actualOutput);
+	}
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522,  [1.8] VerifyError when a non primitive type cast to primitive type 
+public void test428522b() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_7)
+		return;
+	Map customOptions = getCompilerOptions();
+	customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" +
+			"    public static void main(String args[]) {\n" +
+			"       try {\n" +
+			"    	    int l = (int) ((Object) 100L);\n" +
+			"       } catch (ClassCastException c) {\n" +
+			"    	    System.out.println(\"CCE:OK\");\n" +
+			"       }\n" +
+			"    }\n" +
+			"}\n",
+		},
+		"CCE:OK", customOptions);
+
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428522,  [1.8] VerifyError when a non primitive type cast to primitive type 
+public void test428522c() throws Exception {
+	if (this.complianceLevel < ClassFileConstants.JDK1_7)
+		return;
+	Map customOptions = getCompilerOptions();
+	customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" +
+			"    public static void main(String args[]) {\n" +
+			"    	int l = (int) ((Object) 100);\n" +
+			"    	System.out.println(\"OK\");\n" +
+			"    }\n" +
+			"}\n",
+		},
+		"OK", customOptions);
+	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
+	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(new File(OUTPUT_DIR + File.separator  +"X.class"));
+	String actualOutput =
+		disassembler.disassemble(
+			classFileBytes,
+			"\n",
+			ClassFileBytesDisassembler.DETAILED);
+
+	String expectedOutput =
+			"  // Method descriptor #15 ([Ljava/lang/String;)V\n" + 
+			"  // Stack: 2, Locals: 1\n" + 
+			"  public static void main(java.lang.String[] args);\n" + 
+			"     0  bipush 100\n" + 
+			"     2  invokestatic java.lang.Integer.valueOf(int) : java.lang.Integer [16]\n" + 
+			"     5  checkcast java.lang.Integer [17]\n" + 
+			"     8  invokevirtual java.lang.Integer.intValue() : int [22]\n" + 
+			"    11  pop\n" + 
+			"    12  getstatic java.lang.System.out : java.io.PrintStream [26]\n" + 
+			"    15  ldc <String \"OK\"> [32]\n" + 
+			"    17  invokevirtual java.io.PrintStream.println(java.lang.String) : void [34]\n" + 
+			"    20  return\n" + 
+			"      Line numbers:\n" + 
+			"        [pc: 0, line: 3]\n" + 
+			"        [pc: 12, line: 4]\n" + 
+			"        [pc: 20, line: 5]\n" + 
+			"      Local variable table:\n" + 
+			"        [pc: 0, pc: 21] local: args index: 0 type: java.lang.String[]\n" + 
+			"}";
+	int index = actualOutput.indexOf(expectedOutput);
+	if (index == -1 || expectedOutput.length() == 0) {
+		System.out.println(Util.displayString(actualOutput, 2));
+	}
+	if (index == -1) {
+		assertEquals("Wrong contents", expectedOutput, actualOutput);
+	}
+}
+
 public static Class testClass() {
 	return CastTest.class;
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
index aec5f5d..af168b7 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
@@ -760,6 +760,7 @@
 		expectedProblemAttributes.put("LambdaExpressionNotBelow18", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
 		expectedProblemAttributes.put("LambdaRedeclaresArgument", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
 		expectedProblemAttributes.put("LambdaRedeclaresLocal", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+		expectedProblemAttributes.put("LambdaShapeComputationError", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
 		expectedProblemAttributes.put("LocalVariableCanOnlyBeNull", DEPRECATED);
 		expectedProblemAttributes.put("LocalVariableCannotBeNull", DEPRECATED);
 		expectedProblemAttributes.put("LocalVariableHidingField", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT));
@@ -1657,6 +1658,7 @@
 		expectedProblemAttributes.put("LambdaExpressionNotBelow18", SKIP);
 		expectedProblemAttributes.put("LambdaRedeclaresArgument", SKIP);
 		expectedProblemAttributes.put("LambdaRedeclaresLocal", SKIP);
+		expectedProblemAttributes.put("LambdaShapeComputationError", SKIP);
 		expectedProblemAttributes.put("LocalVariableCanOnlyBeNull", SKIP);
 		expectedProblemAttributes.put("LocalVariableCannotBeNull", SKIP);
 		expectedProblemAttributes.put("LocalVariableHidingField", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING));
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 d556474..1d5a346 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
@@ -11073,7 +11073,7 @@
 			"17. ERROR in X.java (at line 34)\n" +
 			"	target= value; // foo11 - wrong\n" +
 			"	        ^^^^^\n" +
-			"Type mismatch: cannot convert from MX<capture#8-of ? super String> to MX<? super Object>\n" +
+			"Type mismatch: cannot convert from MX<capture#7-of ? super String> to MX<? super Object>\n" +
 			"----------\n");
 	}
 	// check param type equivalences
@@ -16819,11 +16819,7 @@
 			"6. WARNING in X.java (at line 10)\n" + 
 			"	EnumSet<Enum> eSet = EnumSet.allOf(c);\n" + 
 			"	                                   ^\n" + 
-			(this.complianceLevel < ClassFileConstants.JDK1_8 ?
-			"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum>\n"
-			:
-			"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n"
-			) + 
+			"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum>\n" + 
 			"----------\n");
 	}
 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation
@@ -31955,11 +31951,7 @@
 		"5. WARNING in X.java (at line 7)\n" +
 		"	Comparable c = newInstance2(x);\n" +
 		"	                            ^\n" +
-		(this.complianceLevel < ClassFileConstants.JDK1_8 ?
-		"Type safety: The expression of type X needs unchecked conversion to conform to X<Comparable>\n"
-		:
-		"Type safety: The expression of type X needs unchecked conversion to conform to X<Comparable<Comparable<B>>>\n"
-		)+
+		"Type safety: The expression of type X needs unchecked conversion to conform to X<Comparable>\n" +
 		"----------\n" +
 		"6. ERROR in X.java (at line 9)\n" +
 		"	Zork z;\n" +
@@ -33323,11 +33315,7 @@
 			"4. WARNING in X.java (at line 9)\n" + 
 			"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + 
 			"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
-			(this.complianceLevel == ClassFileConstants.JDK1_7 ?
-			"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<Number>[]\n"
-			: // with unchecked conversion involved, 1.8 infers a weaker type:
-			"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<Object>[]\n"
-			)+ 
+			"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<Number>[]\n" +
 			"----------\n" + 
 			"5. ERROR in X.java (at line 14)\n" + 
 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + 
@@ -33465,7 +33453,7 @@
 			"4. WARNING in X.java (at line 9)\n" + 
 			"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" + 
 			"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
-			"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<? extends Object>[]\n" + 
+			"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<? extends Number>[]\n" + 
 			"----------\n" + 
 			"5. WARNING in X.java (at line 14)\n" + 
 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" + 
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java
index dedc670..160df38 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java
@@ -4182,8 +4182,6 @@
 }
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=428019, [1.8][compiler] Type inference failures with nested generic invocation.
 public void test428019() {
-	if (this.complianceLevel == ClassFileConstants.JDK1_8)
-		return;
 	runConformTest(
 		new String[] {
 			"X.java",
@@ -4206,5 +4204,45 @@
 		},
 		"put");
 }
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428285,  [1.8][compiler] ECJ fails to recognize ? super Object == { Object }
+public void test428285() {
+	runConformTest(
+		new String[] {
+			"X.java",
+			"class Reference<T> {\n" +
+			"	ReferenceQueue<? super T>  queue;\n" +
+			"}\n" +
+			"class ReferenceQueue<T> {\n" +
+			"}\n" +
+			"public class X {\n" +
+			"    public static void main(String args[]) {\n" +
+			"            Reference<Object> r = new Reference<Object>();\n" +
+			"            ReferenceQueue<Object> q = r.queue;\n" +
+			"            System.out.println(\"OK\");\n" +
+			"    }\n" +
+			"}\n"
+		},
+		"OK");
+}
+public void testBug428366() {
+	runNegativeTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" +
+			"	<T> void m(String s, int i) {}\n" +
+			"	<T> void m(String s1, String s2) {}\n" +
+			"	void test() {\n" +
+			"		m(\"1\", null);\n" +
+			"	}\n" +
+			"	Zork z;\n" +
+			"}\n"
+		},
+		"----------\n" + 
+		"1. ERROR in X.java (at line 7)\n" + 
+		"	Zork z;\n" + 
+		"	^^^^\n" + 
+		"Zork cannot be resolved to a type\n" + 
+		"----------\n");
+}
 }
 
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java
index 156f877..2d8f10d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java
@@ -1402,8 +1402,8 @@
 		"----------\n" + 
 		"5. ERROR in X.java (at line 17)\n" + 
 		"	X<Integer>.Y<String> y4 = new X<>(1).new Y<>(\"\",\"\");\n" + 
-		"	                          ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
-		"Cannot infer type arguments for Y<>\n" + 
+		"	                          ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+		"The constructor X<Integer>.Y<String>(String, String) is undefined\n" + 
 		"----------\n" + 
 		"6. ERROR in X.java (at line 19)\n" + 
 		"	X<Integer>.Y<String> y6 = new X<>().new Y<>(1,\"\");\n" + 
@@ -2589,7 +2589,59 @@
 			"----------\n"
 		));
 }
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428220, [1.8][compiler] Javadoc processing interferes with type inference. 
+public void test428220() {
+	Map customOptions = getCompilerOptions();
+	customOptions.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);
+	runNegativeTest(
+		new String[] {
+			"X.java",
+			"public class HashMap<K, V> {\n" +
+			"	static class Node<K, V> {\n" +
+			"		Node(int hash, K key, V value, Node<K, V> next) {}\n" +
+			"	}\n" +
+			"	/** @see #put(Object, Object) */\n" +
+			"	public V put(K key, V value) {	return null; }\n" +
+			"\n" +
+			"	Node<K, V> newNode(int hash, K key, V value, Node<K, V> next) {\n" +
+			"		return new Node<>(hash, key, value, next); // Error\n" +
+			"	}\n" +
+			"}\n"
+		},
+		"----------\n" + 
+		"1. ERROR in X.java (at line 1)\n" + 
+		"	public class HashMap<K, V> {\n" + 
+		"	             ^^^^^^^\n" + 
+		"The public type HashMap must be defined in its own file\n" + 
+		"----------\n", null, true, customOptions);
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428220, [1.8][compiler] Javadoc processing interferes with type inference. 
+public void test428220a() {
+	Map customOptions = getCompilerOptions();
+	customOptions.put(CompilerOptions.OPTION_Store_Annotations, CompilerOptions.ENABLED);
+	runNegativeTest(
+		new String[] {
+			"X.java",
+			"public class HashMap<K, V> {\n" +
+			"	static class Node<K, V> {\n" +
+			"		Node(int hash, K key, V value, Node<K, V> next) {}\n" +
+			"	}\n" +
+			"	/** @see #put(Object, Object) */\n" +
+			"	public V put(K key, V value) {	return null; }\n" +
+			"\n" +
+			"	Node<K, V> newNode(int hash, K key, V value, Node<K, V> next) {\n" +
+			"		return new Node<>(hash, key, value, next); // Error\n" +
+			"	}\n" +
+			"}\n"
+		},
+		"----------\n" + 
+		"1. ERROR in X.java (at line 1)\n" + 
+		"	public class HashMap<K, V> {\n" + 
+		"	             ^^^^^^^\n" + 
+		"The public type HashMap must be defined in its own file\n" + 
+		"----------\n", null, true, customOptions);
+}
 public static Class testClass() {
 	return GenericsRegressionTest_1_7.class;
 }
-}
+}
\ No newline at end of file
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 ffd521f..f366b75 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
@@ -23,7 +23,7 @@
 public class GenericsRegressionTest_1_8 extends AbstractRegressionTest {
 
 static {
-//	TESTS_NAMES = new String[] { "testBug428019" };
+//	TESTS_NAMES = new String[] { "testBug428198b" };
 //	TESTS_NUMBERS = new int[] { 40, 41, 43, 45, 63, 64 };
 //	TESTS_RANGE = new int[] { 11, -1 };
 }
@@ -213,7 +213,7 @@
 		"1. ERROR in Foo.java (at line 8)\n" + 
 		"	List<Consumer<E>> list2 = stream.gather(() -> new Stuff<>()).toList(); // ERROR\n" + 
 		"	                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
-		"Type mismatch: cannot convert from List<Foo<E>.Stuff<E>> to List<Consumer<E>>\n" + 
+		"Type mismatch: cannot convert from List<Foo.Stuff<E>> to List<Consumer<E>>\n" + 
 		"----------\n");
 }
 
@@ -2119,4 +2119,293 @@
             "}\n"
         });
 }
+public void testBug428198() {
+	runConformTest(
+		new String[] {
+			"Snippet.java",
+			"import java.util.*;\n" + 
+			"interface BundleRevision {}\n" + 
+			"interface BundleDescription extends BundleRevision {}\n" + 
+			"public class Snippet {\n" + 
+			"  static Collection<BundleRevision> test(BundleDescription[] triggers) {\n" + 
+			"    @SuppressWarnings(\"unchecked\")\n" + 
+			"    Collection<BundleRevision> triggerRevisions =\n" + 
+			"    //Type mismatch: cannot convert from Collection<Object> to Collection<BundleRevision>\n" + 
+			"      Collections\n" + 
+			"        .unmodifiableCollection(triggers == null ? Collections.EMPTY_LIST\n" + 
+			"        : Arrays.asList((BundleRevision[]) triggers));\n" + 
+			"    return triggerRevisions;\n" + 
+			"  }\n" + 
+			"}\n"
+		});
+}
+public void testBug428198b() {
+	runConformTest(
+		new String[] {
+			"Snippet.java",
+			"import java.util.*;\n" + 
+			"interface BundleRevision {}\n" + 
+			"interface BundleDescription extends BundleRevision {}\n" + 
+			"public class Snippet {\n" + 
+			"  static Collection<BundleRevision> test(BundleDescription[] triggers) {\n" + 
+			"    @SuppressWarnings(\"unchecked\")\n" + 
+			"    Collection<BundleRevision> triggerRevisions =\n" + 
+			"      Collections\n" + 
+			"        .unmodifiableCollection(triggers == null ? Collections.emptyList()\n" + 
+			"        : Arrays.asList((BundleRevision[]) triggers));\n" + 
+			"    return triggerRevisions;\n" + 
+			"  }\n" + 
+			"}\n"
+		});
+}
+public void testBug428264() {
+	runConformTest(
+		new String[] {
+			"Y.java",
+			"import java.util.function.*;\n" + 
+			"import java.util.Optional;\n" + 
+			"\n" + 
+			"interface I<E,F> {}\n" + 
+			"class A<G> implements I<G, Optional<G>> {}\n" + 
+			"\n" + 
+			"public class Y<S,T> {\n" + 
+			"    Y(T o, Predicate<T> p, Supplier<I<S,T>> s) {}\n" + 
+			"\n" + 
+			"    static <Z> Y<Z, Optional<Z>> m() {\n" + 
+			"        return new Y<>(Optional.empty(), Optional::isPresent, A::new);\n" + 
+			"    }\n" + 
+			"}\n"
+		});
+}
+public void testBug428294() {
+	runConformTest(
+		new String[] {
+			"Junk5.java",
+			"import java.util.Collection;\n" + 
+			"import java.util.List;\n" + 
+			"import java.util.stream.Collectors;\n" + 
+			"\n" + 
+			"\n" + 
+			"public class Junk5 {\n" + 
+			"\n" + 
+			"    class TestTouchDevice {\n" + 
+			"        public Object [] points;\n" + 
+			"    }\n" + 
+			"    \n" + 
+			"    public static List<TestTouchDevice> getTouchDevices() {\n" + 
+			"        return null;\n" + 
+			"    }\n" + 
+			"\n" + 
+			"    public static Collection<Object[]> getTouchDeviceParameters2(int minPoints) {\n" + 
+			"        Collection c = getTouchDevices().stream()\n" + 
+			"                .filter(d -> d.points.length >= minPoints)\n" + 
+			"                .map(d -> new Object[] { d })\n" + 
+			"                .collect(Collectors.toList());\n" + 
+			"         return c;\n" + 
+			"    }\n" + 
+			"    \n" + 
+			"    public static Collection<Object[]> getTouchDeviceParameters3(int minPoints) {\n" + 
+			"        return getTouchDevices().stream()\n" + 
+			"                .filter(d -> d.points.length >= minPoints)\n" + 
+			"                .map(d -> new Object[] { d })\n" + 
+			"                .collect(Collectors.toList());\n" + 
+			"    }\n" + 
+			"}\n"
+		});
+}
+public void testBug428291() {
+	runConformTest(
+		new String[] {
+			"AC3.java",
+			"import java.util.List;\n" + 
+			"\n" + 
+			"interface I0<T> { }\n" + 
+			"\n" + 
+			"interface I1 { }\n" + 
+			"interface I1List<E> extends List<E>, I1 {}\n" + 
+			"interface I2<T> extends I1 {\n" + 
+			"	void foo(I0<? super T> arg1);\n" + 
+			"	void bar(I0<? super T> arg2);\n" + 
+			"}\n" + 
+			"interface I3<T> extends I2<T> {}\n" + 
+			"interface I4<T> extends I2<T> { }\n" + 
+			"interface I3List<E> extends I3<I1List<E>>, I1List<E> {}\n" + 
+			"abstract class AC1<E> implements I3List<E> { }\n" + 
+			"\n" + 
+			"abstract class AC2<E>  {\n" + 
+			"    public static <E> AC2<E> bork(AC2<E> f1, I3List<E> i3l, I0<? super I1List<E>> i1l) {\n" + 
+			"        return null;\n" + 
+			"    }\n" + 
+			"    public static <E> AC2<E> garp(AC2<E> f2, I0<? super I1List<E>> i1l) {\n" + 
+			"        return null;\n" + 
+			"    }\n" + 
+			"}\n" + 
+			"\n" + 
+			"public abstract class AC3<E> extends AC1<E> implements I4<I1List<E>> {\n" + 
+			"\n" + 
+			"    AC2<E> f = null;\n" + 
+			"\n" + 
+			"    @Override\n" + 
+			"    public void foo(I0<? super I1List<E>> arg1) {\n" + 
+			"        f = AC2.bork(f, this, arg1);\n" + 
+			"    }\n" + 
+			"\n" + 
+			"    @Override\n" + 
+			"    public void bar(I0<? super I1List<E>> arg2) {\n" + 
+			"        f = AC2.garp(f, arg2);\n" + 
+			"    }\n" + 
+			"}\n"
+		});
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428275,  [1.8][compiler] CCE in InferenceContext18.varArgTypes 
+public void testBug428275() {
+	runConformTest(
+		new String[] {
+			"p1/C1.java",
+			"package p1;\n" + 
+			"\n" + 
+			"import java.util.List;\n" + 
+			"\n" + 
+			"public class C1<T1> {\n" + 
+			"\n" + 
+			"	public static class CInner<T2A,T2B> {\n" + 
+			"		public CInner(T2A a, T2B b) {}\n" + 
+			"	}\n" + 
+			"	\n" + 
+			"	public static class CInner2<T3A,T3B> {\n" + 
+			"		public CInner2(String n, List<CInner<T3A,T3B>> arg) {}\n" + 
+			"	}\n" + 
+			"	\n" + 
+			"    public static <E> List<E> getList1(E... items) {\n" + 
+			"    	return null;\n" + 
+			"    }\n" + 
+			"}\n",
+			"Test.java",
+			"import java.util.List;\n" + 
+			"\n" + 
+			"import p1.C1;\n" + 
+			"\n" + 
+			"public class Test {\n" + 
+			"	void test2(List<C1.CInner2> l) {\n" + 
+			"		l.add(\n" + 
+			"			new C1.CInner2<>(\"a\",\n" + 
+			"				C1.getList1(new C1.CInner<>(\"b\", 13))\n" + 
+			"			)\n" + 
+			"		);\n" + 
+			"	}\n" + 
+			"}\n"
+		});
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428352, [1.8][compiler] NPE in AllocationExpression.analyseCode when trying to pass Consumer as Function 
+public void test428352() {
+	runNegativeTest(
+		new String[] {
+			"OperationsPile.java",
+			"import java.util.Collection;\n" +
+			"import java.util.List;\n" +
+			"import java.util.function.Consumer;\n" +
+			"import java.util.function.Function;\n" +
+			"\n" +
+			"class OperationsPile<B> {\n" +
+			"  OperationsPile(Function<B, ?> handler) {}\n" +
+			"\n" +
+			"  private static <T> void addAll3(Collection<T> c, T t) {}\n" +
+			"\n" +
+			"  static <S> void adaad3(List<OperationsPile<?>> combined, Consumer<S> handler) {\n" +
+			"    addAll3(combined, new OperationsPile<>(null));\n" +
+			"    addAll3(combined, new OperationsPile<>(handler));\n" +
+			"  }\n" +
+			"}\n"
+		},
+		"----------\n" + 
+		"1. ERROR in OperationsPile.java (at line 13)\n" + 
+		"	addAll3(combined, new OperationsPile<>(handler));\n" + 
+		"	                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
+		"Cannot infer type arguments for OperationsPile<>\n" + 
+		"----------\n");
+}
+public void test428352b() {
+	runConformTest(
+		new String[] {
+			"OperationsPile.java",
+			"import java.util.Collection;\n" +
+			"import java.util.List;\n" +
+			"import java.util.function.Consumer;\n" +
+			"import java.util.function.Function;\n" +
+			"\n" +
+			"public class OperationsPile<B> {\n" +
+			"  OperationsPile(Function<B, ?> handler) {}\n" +
+			"\n" +
+			"  private static <T> void addAll3(Collection<T> c, T t) {}\n" +
+			"\n" +
+			"  static <S> void adaad3(List<OperationsPile<?>> combined, Consumer<S> handler) {\n" +
+			"    addAll3(combined, new OperationsPile<>(null));\n" +
+			"  }\n" +
+			"	public static void main(String[] args) {\n" +
+			"		adaad3(null, null);\n" +
+			"		System.out.println(13);\n" +
+			"	}\n" +
+			"}\n"
+		},
+		"13");
+}
+public void testBug428307() {
+	runConformTest(
+		new String[] {
+			"X.java",
+			"import java.util.*;\n" + 
+			"import java.util.function.Function;\n" + 
+			"import java.util.stream.*;\n" + 
+			"\n" + 
+			"interface Bar {\n" + 
+			"	Class<? extends Bar> type();\n" + 
+			"}\n" + 
+			"public class X {\n" + 
+			" \n" + 
+			"    <T extends Bar> T[] test(Class<T> barClass, Stream<Bar> bars) {\n" + 
+			"        return get(bars.\n" + 
+			"                    collect(Collectors.toMap(Bar::type,\n" + 
+			"                                             Function.identity(),\n" + 
+			"                                             ((first,second) -> first),\n" + 
+			"                                             HashMap::new)),\n" + 
+			"                            barClass);\n" + 
+			"    }\n" + 
+			"    \n" + 
+			"    <A extends Bar> A[] get(Map<Class<? extends Bar>,Bar> m, Class<A> c) {\n" + 
+			"    	return null;\n" + 
+			"    }\n" + 
+			"}\n"
+		});
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428524, [1.8][compiler] NPE when using JSE8 Class Constructor ref "TheClass::new" and "TheClass" is using default no-arg constructor 
+public void test428524() {
+	runConformTest(
+		new String[] {
+			"X.java",
+			"import java.util.function.Supplier;\n" +
+			"public class X {\n" +
+			"	public static void main(String[] args) {\n" +
+			"		Supplier<WithNoArgConstructor> works = WithNoArgConstructor::new;\n" +
+			"		System.out.println(works.get());\n" +
+			"		Supplier<WithoutNoArgConstructor> error = WithoutNoArgConstructor::new;\n" +
+			"		System.out.println(error.get());\n" +
+			"		\n" +
+			"	}\n" +
+			"	private static class WithNoArgConstructor {\n" +
+			"		public WithNoArgConstructor() {\n" +
+			"		}\n" +
+			"       public String toString() {\n" +
+			"           return(\"WithNoArgConstructor\");\n" +
+			"       }\n" +
+			"	}\n" +
+			"	private static class WithoutNoArgConstructor {\n" +
+			"       public String toString() {\n" +
+			"           return(\"WithOutNoArgConstructor\");\n" +
+			"       }\n" +
+			"	}\n" +
+			"}\n"
+		}, 
+		"WithNoArgConstructor\n" + 
+		"WithOutNoArgConstructor");
+}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
index 0bcc21e..9a802a3 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
@@ -3259,6 +3259,175 @@
 			"de"
 			);
 }
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428003, [1.8][compiler] Incorrect error on lambda expression when preceded by another explicit lambda expression
+public void test428003() { // extracted small test
+	this.runConformTest(
+			new String[] {
+				"X.java",
+				"import java.util.Arrays;\n" +
+				"public class X {\n" +
+				"    public static void main(String[] args) {\n" +
+				"        Arrays.sort(args, (String x, String y) -> x.length() - y.length());\n" +
+				"        Arrays.sort(args, (x, y) -> Integer.compare(x.length(), y.length()));\n" +
+				"    }\n" +
+				"}\n"
+			},
+			""
+			);
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428003, [1.8][compiler] Incorrect error on lambda expression when preceded by another explicit lambda expression
+public void test428003a() { // full test case
+	this.runConformTest(
+			new String[] {
+				"X.java",
+				"import java.util.Arrays;\n" +
+				"public class X {\n" +
+				"    public static void main(String[] args) {\n" +
+				"        String[] words = {\"java\", \"interface\", \"lambda\", \"expression\" };\n" +
+				"        Arrays.sort(words, (String word1, String word2) -> {\n" +
+				"                    if (word1.length() < word2.length())\n" +
+				"                        return -1;\n" +
+				"                    else if (word1.length() > word2.length())\n" +
+				"                        return 1;\n" +
+				"                    else\n" +
+				"                        return 0;\n" +
+				"                  });\n" +
+				"        for (String word : words)\n" +
+				"            System.out.println(word);\n" +
+				"        words = new String [] {\"java\", \"interface\", \"lambda\", \"expression\" };\n" +
+				"        Arrays.sort(words, (word1, word2) -> Integer.compare(word1.length(), word2.length()));\n" +
+				"        for (String word : words)\n" +
+				"            System.out.println(word);\n" +
+				"        words = new String [] {\"java\", \"interface\", \"lambda\", \"expression\" };\n" +
+				"        Arrays.sort(words, (String word1, String word2) -> Integer.compare(word1.length(), word2.length()));\n" +
+				"        for (String word : words)\n" +
+				"            System.out.println(word);\n" +
+				"      }\n" +
+				"  }\n"
+			},
+			"java\n" +
+			"lambda\n" +
+			"interface\n" +
+			"expression\n" +
+			"java\n" +
+			"lambda\n" +
+			"interface\n" +
+			"expression\n" +
+			"java\n" +
+			"lambda\n" +
+			"interface\n" +
+			"expression"
+			);
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428261, [1.8][compiler] Incorrect error: No enclosing instance of the type X is accessible in scope
+public void test428261() {
+	this.runConformTest(
+			new String[] {
+				"X.java",
+				"interface I {\n" +
+				"	X foo(int a);\n" +
+				"}\n" +
+				"public class X {\n" +
+				"	public static void main(String[] args) {\n" +
+				"		String s = \"Blah\";\n" +
+				"		class Local extends X {\n" +
+				"			Local(int a) {\n" +
+				"				System.out.println(a);\n" +
+				"				System.out.println(s);\n" +
+				"			}\n" +
+				"		}\n" +
+				"		I i = Local::new; // Incorrect error here.\n" +
+				"       i.foo(10);\n" +
+				"	}\n" +
+				"}\n"
+			},
+			"10\n" +
+			"Blah"
+			);
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428261, [1.8][compiler] Incorrect error: No enclosing instance of the type X is accessible in scope
+public void test428261a() {
+	this.runConformTest(
+			new String[] {
+				"X.java",
+				"interface I {\n" +
+				"	X foo(int a);\n" +
+				"}\n" +
+				"public class X {\n" +
+				"	void goo() {\n" +
+				"		class Local extends X {\n" +
+				"			Local(int a) {\n" +
+				"				System.out.println(a);\n" +
+				"			}\n" +
+				"		}\n" +
+				"		I i = Local::new;\n" +
+				"       i.foo(10);\n" +
+				"	}\n" +
+				"   public static void main(String [] args) {\n" +
+				"        new X().goo();\n" +
+				"   }\n" +
+				"}\n"
+			},
+			"10");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428552,  [1.8][compiler][codegen] Serialization does not work for method references
+public void test428552() {
+	this.runConformTest(
+			new String[] {
+				"X.java",
+				"import java.io.*;\n" +
+				"public class X {\n" +
+				"	interface Example extends Serializable {\n" +
+				"		String convert(Object o);\n" +
+				"	}\n" +
+				"	public static void main(String[] args) throws IOException {\n" +
+				"		Example e=Object::toString;\n" +
+				"		try(ObjectOutputStream os=new ObjectOutputStream(new ByteArrayOutputStream())) {\n" +
+				"			os.writeObject(e);\n" +
+				"		}\n" +
+				"       System.out.println(\"No exception !\");\n" +
+				"	}\n" +
+				"}\n"
+			},
+			"No exception !",
+			null,
+			true,
+			new String [] { "-Ddummy" }); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.);
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428642, [1.8][compiler] java.lang.IllegalArgumentException: Invalid lambda deserialization exception
+public void test428642() {
+	this.runConformTest(
+			new String[] {
+				"QuickSerializedLambdaTest.java",
+				"import java.io.*;\n" +
+				"import java.util.function.IntConsumer;\n" +
+				"public class QuickSerializedLambdaTest {\n" +
+				"	interface X extends IntConsumer,Serializable{}\n" +
+				"	public static void main(String[] args) throws IOException, ClassNotFoundException {\n" +
+				"		X x1 = i -> System.out.println(i);// lambda expression\n" +
+				"		X x2 = System::exit; // method reference\n" +
+				"		ByteArrayOutputStream debug=new ByteArrayOutputStream();\n" +
+				"		try(ObjectOutputStream oo=new ObjectOutputStream(debug))\n" +
+				"		{\n" +
+				"			oo.writeObject(x1);\n" +
+				"			oo.writeObject(x2);\n" +
+				"		}\n" +
+				"		try(ObjectInputStream oi=new ObjectInputStream(new ByteArrayInputStream(debug.toByteArray())))\n" +
+				"		{\n" +
+				"			X x=(X)oi.readObject();\n" +
+				"			x.accept(42);// shall print 42\n" +
+				"			x=(X)oi.readObject();\n" +
+				"			x.accept(0);// shall exit\n" +
+				"		}\n" +
+				"		throw new AssertionError(\"should not reach this point\");\n" +
+				"	}\n" +
+				"}\n"
+			},
+			"42",
+			null,
+			true,
+			new String [] { "-Ddummy" }); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.);
+}
 public static Class testClass() {
 	return LambdaExpressionsTest.class;
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java
index ba24442..97bf50b 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java
@@ -3659,7 +3659,7 @@
 			"1. ERROR in X.java (at line 3)\n" + 
 			"	I<?, ?, ?> i = (String p) -> { return null; };\n" + 
 			"	                ^^^^^^\n" + 
-			"Lambda expression\'s parameter p is expected to be of type List<? extends List<?>>[]\n" + 
+			"Lambda expression\'s parameter p is expected to be of type List<? extends List<ParameterType>>[]\n" + 
 			"----------\n");
 }
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3700,7 +3700,7 @@
 			"1. ERROR in X.java (at line 3)\n" + 
 			"	I<? extends p.ParameterType, ? extends p.ExceptionType, ? extends p.ReturnType> i = (String p) -> { return null; };\n" + 
 			"	                                                                                     ^^^^^^\n" + 
-			"Lambda expression\'s parameter p is expected to be of type List<? extends List<? extends ParameterType>>[]\n" + 
+			"Lambda expression\'s parameter p is expected to be of type List<? extends List<ParameterType>>[]\n" + 
 			"----------\n");
 }
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3862,7 +3862,7 @@
 			"2. ERROR in X.java (at line 6)\n" + 
 			"	I<? super P, ? super T, ? super R> i = (String p) -> { return null; };\n" + 
 			"	                                        ^^^^^^\n" + 
-			"Lambda expression\'s parameter p is expected to be of type List<? extends List<? super P>>[]\n" + 
+			"Lambda expression\'s parameter p is expected to be of type List<? extends List<P>>[]\n" + 
 			"----------\n");
 }
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -3916,8 +3916,8 @@
 			"----------\n" + 
 			"2. ERROR in X.java (at line 6)\n" + 
 			"	I<?, ?, ?> i = (String p) -> { return null; };\n" + 
-			"	                ^^^^^^\n" + 
-			"Lambda expression\'s parameter p is expected to be of type List<? extends List<?>>[]\n" + 
+			"	               ^^^^^^^^^^^^^\n" + 
+			"The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" + 
 			"----------\n");
 }
 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=400556, [1.8][compiler] Visibility checks are missing for lambda/reference expressions
@@ -8475,6 +8475,116 @@
 		"Y cannot be resolved to a type\n" + 
 		"----------\n");
 }
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428300, - [1.8] Map.computeIfAbsent fails with array value types
+public void test428300() {
+	runNegativeTest(
+		new String[] {
+			"X.java",
+			"import java.util.concurrent.ConcurrentHashMap;\n" +
+			"public class X {\n" +
+			"	public static void main(String[] args) {\n" +
+			"		ConcurrentHashMap<String, String[]> map = new ConcurrentHashMap<>();\n" +
+			"		map.computeIfAbsent(\"doo\", e -> new String[] {});\n" +
+			"	}\n" +
+			"}\n"
+		},
+		"");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428300, - [1.8] Map.computeIfAbsent fails with array value types
+public void test428300a() {
+	runNegativeTest(
+		new String[] {
+			"X.java",
+			"import java.util.concurrent.ConcurrentHashMap;\n" +
+			"import java.util.function.Function;\n" +
+			"public class X {\n" +
+			"	public static void main(String[] args) {\n" +
+			"		ConcurrentHashMap<String, String[]> map = new ConcurrentHashMap<>();\n" +
+			"		Function<String, String[]> f = e -> new String[] {};\n" +
+			"		map.computeIfAbsent(\"doo\", f);\n" +
+			"	}\n" +
+			"}\n"
+		},
+		"");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428177, - [1.8][compiler] Insistent capture issues
+public void _test428177() {
+	runNegativeTest(
+		new String[] {
+			"X.java",
+			"import java.io.IOException;\n" +
+			"import java.nio.file.Path;\n" +
+			"import java.util.ArrayList;\n" +
+			"import java.util.List;\n" +
+			"import java.util.function.Function;\n" +
+			"import java.util.jar.JarEntry;\n" +
+			"import java.util.jar.JarFile;\n" +
+			"import java.util.stream.Collectors;\n" +
+			"import java.util.stream.Stream;\n" +
+			"class InsistentCapture {\n" +
+			"  static void processJar(Path plugin) throws IOException {\n" +
+			"    try(JarFile jar = new JarFile(plugin.toFile())) {\n" +
+			"      try(Stream<JarEntry> entries = jar.stream()) {\n" +
+			"        Function<? super JarEntry, ? extends String> toName =\n" +
+			"          entry -> entry.getName();\n" +
+			"        Stream<? extends String> stream = entries.map(toName).distinct(); // Ok\n" +
+			"        withWildcard(entries.map(toName).distinct()); // Ok\n" +
+			"        withWildcard(stream); // Ok\n" +
+			"        Stream<String> stream2 = entries.map(toName).distinct(); // ERROR\n" +
+			"        withoutWildcard(entries.map(toName).distinct()); // ERROR\n" +
+			"        withoutWildcard(stream); // ERROR\n" +
+			"        withoutWildcard(stream2); // Ok\n" +
+			"        withoutWildcard(coerce(stream)); // Ok\n" +
+			"        withoutWildcard(stream.map((String v1) -> { // ERROR\n" +
+			"          String r = \"\" + v1; // Hover on v: Ok\n" +
+			"          return r;\n" +
+			"        }));\n" +
+			"        withoutWildcard(stream.map((v2) -> { // Ok\n" +
+			"          String r = \"\" + v2; // Hover on v: NOT OK\n" +
+			"          return r;\n" +
+			"        }));\n" +
+			"      }\n" +
+			"    }\n" +
+			"  }\n" +
+			"  private static Stream<String> coerce(Stream<? extends String> stream) {\n" +
+			"    if(\"1\" == \"\") { return stream.collect(Collectors.toList()).stream(); // ERROR\n" +
+			"    }\n" +
+			"    return stream.collect(Collectors.toList()); // NO ERROR\n" +
+			"  }\n" +
+			"  private static void withWildcard(Stream<? extends String> distinct) {\n" +
+			"    distinct.forEach(s1 -> System.out.println(s1)); // hover on s: NOT OK\n" +
+			"  }\n" +
+			"  private static void withoutWildcard(Stream<String> distinct) {\n" +
+			"    distinct.forEach(s2 -> System.out.println(s2)); // hover on s: Ok\n" +
+			"  }\n" +
+			"}\n"
+		},
+		"valid error messages go here - some are expected since javac also complains");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428795, - [1.8]Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.ast.MessageSend.analyseCode
+public void test428795() {
+	runNegativeTest(
+		new String[] {
+			"X.java",
+			"import java.net.NetworkInterface;\n" +
+			"import java.util.Optional;\n" +
+			"public class X {\n" +
+			"  public static void main( String[] args ) {\n" +
+			"    Optional.ofNullable( NetworkInterface.getByIndex( 2 ) ).ifPresent( ni -> {\n" +
+			"      Optional.ofNullable( ni.getDisplayName() ).ifPresent( name ->\n" +
+			"        System.out.println( name.get().toUpperCase() )\n" +
+			"      );\n" +
+			"    });\n" +
+			"  }\n" +
+			"}\n"
+		},
+		"----------\n" + 
+		"1. ERROR in X.java (at line 7)\n" + 
+		"	System.out.println( name.get().toUpperCase() )\n" + 
+		"	                         ^^^\n" + 
+		"The method get() is undefined for the type String\n" + 
+		"----------\n");
+}
 public static Class testClass() {
 	return NegativeLambdaExpressionsTest.class;
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java
index 73d5d84..6f58202 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java
@@ -4653,4 +4653,110 @@
 		options
 		);
 }
+// normal java.util.stream.Stream doesn't hold on to any resources
+public void testStream1() {
+	if (this.complianceLevel < ClassFileConstants.JDK1_8)
+		return; // uses JRE 8 API
+	Map options = getCompilerOptions();
+	options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
+	options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
+	runConformTest(
+		new String[] {
+			"A.java",
+			"import java.util.*;\n" +
+			"import java.util.stream.Stream;\n" + 
+			"class A {\n" + 
+			"  long test(List<String> ss) {\n" + 
+			"    Stream<String> stream = ss.stream();\n" + 
+			"    return stream.count();\n" + 
+			"  }\n" + 
+			"}"
+		},
+		options
+		);
+}
+// Functions java.nio.file.Files.x() returning *Stream* do produce a resource needing closing
+public void testStream2() {
+	if (this.complianceLevel < ClassFileConstants.JDK1_8)
+		return; // uses JRE 8 API
+	Map options = getCompilerOptions();
+	options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
+	options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
+	runNegativeTest(
+		new String[] {
+			"A.java",
+			"import java.util.stream.Stream;\n" + 
+			"import java.nio.file.*;\n" + 
+			"class A {\n" + 
+			"  long test(Path start, FileVisitOption... options) throws java.io.IOException {\n" + 
+			"    Stream<Path> stream = Files.walk(start, options);\n" + 
+			"    return stream.count();\n" + 
+			"  }\n" + 
+			"}"
+		},
+		"----------\n" + 
+		"1. ERROR in A.java (at line 5)\n" + 
+		"	Stream<Path> stream = Files.walk(start, options);\n" + 
+		"	             ^^^^^^\n" + 
+		"Resource leak: \'stream\' is never closed\n" + 
+		"----------\n",
+		null,
+		true,
+		options
+		);
+}
+// closeable, but Stream, but produced by Files.m, but only potentially closed:
+public void testStream3() {
+	if (this.complianceLevel < ClassFileConstants.JDK1_8)
+		return; // uses JRE 8 API
+	Map options = getCompilerOptions();
+	options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
+	options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
+	runNegativeTest(
+		new String[] {
+			"A.java",
+			"import java.util.stream.Stream;\n" + 
+			"import java.nio.file.*;\n" + 
+			"class A {\n" + 
+			"  void test(Path file) throws java.io.IOException {\n" + 
+			"    Stream<String> lines = Files.lines(file);\n" +
+			"    if (lines.count() > 0)" + 
+			"    	lines.close();\n" + 
+			"  }\n" + 
+			"}"
+		},
+		"----------\n" + 
+		"1. ERROR in A.java (at line 5)\n" + 
+		"	Stream<String> lines = Files.lines(file);\n" + 
+		"	               ^^^^^\n" + 
+		"Potential resource leak: \'lines\' may not be closed\n" + 
+		"----------\n",
+		null,
+		true,
+		options
+		);
+}
+// special stream from Files.m is properly handled by t-w-r
+public void testStream4() {
+	if (this.complianceLevel < ClassFileConstants.JDK1_8)
+		return; // uses JRE 8 API
+	Map options = getCompilerOptions();
+	options.put(CompilerOptions.OPTION_ReportPotentiallyUnclosedCloseable, CompilerOptions.ERROR);
+	options.put(CompilerOptions.OPTION_ReportUnclosedCloseable, CompilerOptions.ERROR);
+	runConformTest(
+		new String[] {
+			"A.java",
+			"import java.util.stream.Stream;\n" + 
+			"import java.nio.file.*;\n" + 
+			"class A {\n" + 
+			"  void test(Path dir) throws java.io.IOException {\n" + 
+			"    try (Stream<Path> list = Files.list(dir)) {\n" +
+			"    	list.forEach(child -> System.out.println(child));\n" + 
+			"    }\n" + 
+			"  }\n" + 
+			"}"
+		},
+		options
+		);
+}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java
index d65bd02..4ff3d2f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java
@@ -1096,6 +1096,114 @@
 		String data = printBootstrapMethodsAttribute(OUTPUT_DIR + File.separator + "X.class");
 		checkExpected(expectedOutput,data);
 	}
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428552,  [1.8][compiler][codegen] Serialization does not work for method references
+	public void test428552() throws Exception {
+		this.runConformTest(
+				new String[]{
+					"X.java",
+					"import java.io.*;\n" +
+					"public class X {\n" +
+					"	interface Example extends Serializable {\n" +
+					"		String convert(X o);\n" +
+					"	}\n" +
+					"	public static void main(String[] args) throws IOException {\n" +
+					"		Example e=X::toString;\n" +
+					"       util.Helper.write(e);\n"+
+					"       e = (Example)util.Helper.read();\n"+
+					"       System.out.println(e.convert(new X()));\n"+
+					"	}\n" +
+					"   public String toString() {\n" +
+					"       return \"XItIs\";\n" +
+					"   }\n" +
+					"}\n",
+					"Helper.java",HELPER_CLASS,
+					},
+					"XItIs",
+					null,
+					true,
+					new String [] { "-Ddummy" }); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
+	}
+	
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428642
+	public void test428642() throws Exception {
+		this.runConformTest(
+				new String[]{
+					"QuickSerializedLambdaTest.java",
+					"import java.io.*;\n"+
+					"import java.util.function.IntConsumer;\n"+
+					"\n"+
+					"public class QuickSerializedLambdaTest {\n"+
+					"	interface X extends IntConsumer,Serializable{}\n"+
+					"	public static void main(String[] args) throws IOException, ClassNotFoundException {\n"+
+					"		X x2 = System::exit; // method reference\n"+
+					"		ByteArrayOutputStream debug=new ByteArrayOutputStream();\n"+
+					"		try(ObjectOutputStream oo=new ObjectOutputStream(debug))\n"+
+					"		{\n"+
+					"			oo.writeObject(x2);\n"+
+					"		}\n"+
+					"		try(ObjectInputStream oi=new ObjectInputStream(new ByteArrayInputStream(debug.toByteArray())))\n"+
+					"		{\n"+
+					"			X x=(X)oi.readObject();\n"+
+					"			x.accept(0);// shall exit\n"+
+					"		}\n"+
+					"		throw new AssertionError(\"should not reach this point\");\n"+
+					"	}\n"+
+					"}\n",
+					"Helper.java",
+					"public class Helper {\n"+
+					"  public static String tostring(java.lang.invoke.SerializedLambda sl) {\n"+
+					"    return sl.toString();\n"+
+					"  }\n"+
+					"}"
+				},
+				"",
+				null,true,
+				new String[]{"-Ddummy"}); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
+	}
+	
+	public void test428642_2() throws Exception {
+		this.runConformTest(
+				new String[]{
+					"Helper.java",
+					"public class Helper {\n"+
+					"  public static String tostring(java.lang.invoke.SerializedLambda sl) {\n"+
+					"    return sl.toString();\n"+
+					"  }\n"+
+					"  public static void main(String[]argv) throws Exception {\n"+
+					"    foo.QuickSerializedLambdaTest.main(argv);\n"+
+					"  }\n"+
+					"}",
+					"QuickSerializedLambdaTest.java",
+					"package foo;\n"+
+					"import java.io.*;\n"+
+					"import java.util.function.IntConsumer;\n"+
+					"\n"+
+					"public class QuickSerializedLambdaTest {\n"+
+					"	interface X extends IntConsumer,Serializable{}\n"+
+					"	public static void main(String[] args) throws IOException, ClassNotFoundException {\n"+
+					"		X x1 = i -> System.out.println(i);// lambda expression\n"+
+					"		X x2 = System::exit; // method reference\n"+
+					"		ByteArrayOutputStream debug=new ByteArrayOutputStream();\n"+
+					"		try(ObjectOutputStream oo=new ObjectOutputStream(debug))\n"+
+					"		{\n"+
+					"			oo.writeObject(x1);\n"+
+					"			oo.writeObject(x2);\n"+
+					"		}\n"+
+					"		try(ObjectInputStream oi=new ObjectInputStream(new ByteArrayInputStream(debug.toByteArray())))\n"+
+					"		{\n"+
+					"			X x=(X)oi.readObject();\n"+
+					"			x.accept(42);// shall print \"42\"\n"+
+					"			x=(X)oi.readObject();\n"+
+					"			x.accept(0);// shall exit\n"+
+					"		}\n"+
+					"		throw new AssertionError(\"should not reach this point\");\n"+
+					"	}\n"+
+					"}\n"
+				},
+				"42",
+				null,true,
+				new String[]{"-Ddummy"}); // Not sure, unless we force the VM to not be reused by passing dummy vm argument, the generated program aborts midway through its execution.
+	}
 	
 	
 	// ---
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java
index b03a2ed..9fe7cfe 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java
@@ -6242,7 +6242,6 @@
 			checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
 	}
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=419331, [1.8][compiler] Weird error on forward reference to type annotations from type parameter declarations
-	// ENCODES WRONG BEHAVIOR - FIX TEST ALONG WITH FIX
 	public void testForwardReference() {
 		this.runNegativeTest(
 			new String[] {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
index 39f2ca7..4b85cca 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
@@ -4223,4 +4223,73 @@
 		assertEquals("Incorrect no of dimensions", 1, dims);
 
 	}
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428526, [1.8] API to get the single abstract method in a functional interface
+	public void test428526() throws JavaModelException {
+		String contents =
+				"interface Foo<T, N extends Number> {\n" +
+				"    void m(T arg);\n" +
+				"    void m(N arg);\n" +
+				"}\n" +
+				"interface Baz extends Foo<Integer, Integer> {}\n";
+		
+		this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
+		ASTNode node = buildAST(contents, this.workingCopy);
+		assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
+		CompilationUnit compilationUnit = (CompilationUnit) node;
+		assertProblemsSize(compilationUnit, 0);
+		
+		TypeDeclaration type = (TypeDeclaration) getASTNode(compilationUnit, 0);
+		assertEquals("Not a Type declaration", ASTNode.TYPE_DECLARATION, type.getNodeType());
+		ITypeBinding binding = type.resolveBinding();
+		assertNotNull("Binding should not be null", binding);
+		IMethodBinding functionalInterfaceMethod = binding.getFunctionalInterfaceMethod();
+		assertNull("Should not be a functional interface", functionalInterfaceMethod);
+		
+		type = (TypeDeclaration) getASTNode(compilationUnit, 1);
+		assertEquals("Not a Type declaration", ASTNode.TYPE_DECLARATION, type.getNodeType());
+		binding = type.resolveBinding();
+		assertNotNull("Binding should not be null", binding);
+		functionalInterfaceMethod = binding.getFunctionalInterfaceMethod();
+		assertNotNull("Should be a functional interface", functionalInterfaceMethod);
+		ITypeBinding declaringClass = functionalInterfaceMethod.getDeclaringClass();
+		assertEquals("Foo<Integer,Integer>", declaringClass.getName());
+	}
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428526, [1.8] API to get the single abstract method in a functional interface
+	public void test428526a() throws JavaModelException {
+		String contents =
+				"interface I { X foo(); }\n" +
+				"interface J { Y foo(); }\n" +
+				"interface K extends I, J {}\n" +
+				"class X {}\n" +
+				"class Y extends X {}\n";
+		
+		this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
+		ASTNode node = buildAST(contents, this.workingCopy);
+		assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
+		CompilationUnit compilationUnit = (CompilationUnit) node;
+		assertProblemsSize(compilationUnit, 0);
+		
+		TypeDeclaration type = (TypeDeclaration) getASTNode(compilationUnit, 0);
+		assertEquals("Not a Type declaration", ASTNode.TYPE_DECLARATION, type.getNodeType());
+		ITypeBinding binding = type.resolveBinding();
+		assertNotNull("Binding should not be null", binding);
+		IMethodBinding functionalInterfaceMethod = binding.getFunctionalInterfaceMethod();
+		assertNotNull("Should not be a functional interface", functionalInterfaceMethod);
+		
+		type = (TypeDeclaration) getASTNode(compilationUnit, 1);
+		assertEquals("Not a Type declaration", ASTNode.TYPE_DECLARATION, type.getNodeType());
+		binding = type.resolveBinding();
+		assertNotNull("Binding should not be null", binding);
+		functionalInterfaceMethod = binding.getFunctionalInterfaceMethod();
+		assertNotNull("Should be a functional interface", functionalInterfaceMethod);
+		
+		type = (TypeDeclaration) getASTNode(compilationUnit, 2);
+		assertEquals("Not a Type declaration", ASTNode.TYPE_DECLARATION, type.getNodeType());
+		binding = type.resolveBinding();
+		assertNotNull("Binding should not be null", binding);
+		functionalInterfaceMethod = binding.getFunctionalInterfaceMethod();
+		assertNotNull("Should be a functional interface", functionalInterfaceMethod);
+		ITypeBinding returnType = functionalInterfaceMethod.getReturnType();
+		assertEquals("Y", returnType.getName());
+	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java
index 04d12d2..dedb23a 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java
@@ -1131,4 +1131,162 @@
 	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
 	assertResults("Annotation[TYPE_REF]{Annotation, , LAnnotation;, null, null, null, null, [138, 141], 47}", requestor.getResults());
 }
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735() throws JavaModelException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy(
+			"/Completion/src/X.java",
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"public class X {\n" +
+			"	void test1 (List<Person> people) {\n" +
+			"		people.stream().forEach(p -> System.out.println(p.get)); // NOK\n" +
+			"	}\n" +
+			"}\n");
+
+	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, true, true, false);
+	requestor.allowAllRequiredProposals();
+	String str = this.workingCopies[0].getSource();
+	String completeBehind = "p.get";
+	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+	assertResults("getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, null, null, getClass, null, [186, 189], 35}\n" +
+                  "getLastName[METHOD_REF]{getLastName(), LPerson;, ()Ljava.lang.String;, null, null, getLastName, null, [186, 189], 35}", requestor.getResults());
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735a() throws JavaModelException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy(
+			"/Completion/src/X.java",
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"public class X {\n" +
+			"	void test1 (List<Person> people) {\n" +
+			"		people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
+			"	}\n" +
+			"   void test2(List<Person> people) {\n" +
+			"       people.sort((x,y) -> x.get);  // OK\n" +
+			"   }\n" +
+			"}\n");
+
+	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, true, true, false);
+	requestor.allowAllRequiredProposals();
+	String str = this.workingCopies[0].getSource();
+	String completeBehind = "x.get";
+	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+	assertResults("getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, null, null, getClass, null, [267, 270], 35}\n" +
+                  "getLastName[METHOD_REF]{getLastName(), LPerson;, ()Ljava.lang.String;, null, null, getLastName, null, [267, 270], 35}", requestor.getResults());
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735b() throws JavaModelException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy(
+			"/Completion/src/X.java",
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"public class X {\n" +
+			"	void test1 (List<Person> people) {\n" +
+			"		people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
+			"	}\n" +
+			"   void test2(List<Person> people) {\n" +
+			"       people.sort((x,y) -> x.getLastName().compareTo(y.get));\n" + 
+			"   }\n" +
+			"}\n");
+
+	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, true, true, false);
+	requestor.allowAllRequiredProposals();
+	String str = this.workingCopies[0].getSource();
+	String completeBehind = "y.get";
+	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+	assertResults("getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, null, null, getClass, null, [293, 296], 35}\n" +
+                  "getLastName[METHOD_REF]{getLastName(), LPerson;, ()Ljava.lang.String;, null, null, getLastName, null, [293, 296], 35}", requestor.getResults());
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735c() throws JavaModelException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy(
+			"/Completion/src/X.java",
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"public class X {\n" +
+			"	void test1 (List<Person> people) {\n" +
+			"		people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
+			"	}\n" +
+			"   void test2(List<Person> people) {\n" +
+			"       people.sort((x,y) -> x.getLastName() + y.get);\n" + 
+			"   }\n" +
+			"}\n");
+
+	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, true, true, false);
+	requestor.allowAllRequiredProposals();
+	String str = this.workingCopies[0].getSource();
+	String completeBehind = "y.get";
+	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+	assertResults("getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, null, null, getClass, null, [285, 288], 35}\n" +
+                  "getLastName[METHOD_REF]{getLastName(), LPerson;, ()Ljava.lang.String;, null, null, getLastName, null, [285, 288], 65}", requestor.getResults());
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735d() throws JavaModelException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy(
+			"/Completion/src/X.java",
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"public class X {\n" +
+			"	void test1 (List<Person> people) {\n" +
+			"		people.stream().forEach(p -> System.out.println(p.)); // NOK\n" +
+			"	}\n" +
+			"   void test2(List<Person> people) {\n" +
+			"       people.sort((x,y) -> \"\" + x.get); \n" + 
+			"   }\n" +
+			"}\n");
+
+	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, true, true, false);
+	requestor.allowAllRequiredProposals();
+	String str = this.workingCopies[0].getSource();
+	String completeBehind = "x.get";
+	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+	assertResults("getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, null, null, getClass, null, [272, 275], 35}\n" +
+                  "getLastName[METHOD_REF]{getLastName(), LPerson;, ()Ljava.lang.String;, null, null, getLastName, null, [272, 275], 65}", requestor.getResults());
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=428735,  [1.8][assist] Missing completion proposals inside lambda body expression - other than first token
+public void test428735e() throws JavaModelException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy(
+			"/Completion/src/X.java",
+			"import java.util.List;\n" +
+			"class Person {\n" +
+			"   String getLastName() { return null; }\n" +
+			"}\n" +
+			"public class X {\n" +
+			"   void test2(List<Person> people) {\n" +
+			"       people.sort((x,y) -> {\n" +
+			"              if (true) return \"\" + x.get); \n" +
+			"              else return \"\";\n" +
+			"   }\n" +
+			"}\n");
+
+	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, true, true, false);
+	requestor.allowAllRequiredProposals();
+	String str = this.workingCopies[0].getSource();
+	String completeBehind = "x.get";
+	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+	assertResults("getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, null, null, getClass, null, [203, 206], 35}\n" +
+               "getLastName[METHOD_REF]{getLastName(), LPerson;, ()Ljava.lang.String;, null, null, getLastName, null, [203, 206], 65}", requestor.getResults());
+}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java
index 267ac14..ad9fa38 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java
@@ -3128,7 +3128,7 @@
 		buf= new StringBuffer();
 		buf.append("package test1;\n");
 		buf.append("class E {\n");
-		buf.append("    public void foo(@X\n    @A int a, @B2 int b, @X\n    int c, @X int d, @X\n    int e) {\n");
+		buf.append("    public void foo(@X @A int a, @B2 int b, @X int c, @X int d, @X int e) {\n");
 		buf.append("    }\n");
 		buf.append("}\n");
 		assertEqualString(preview, buf.toString());
@@ -3803,6 +3803,33 @@
 		buf.append("@interface Marker {}\n");
 
 		assertEqualString(preview, buf.toString());
+		
+		// still no new line if new line after annotation on parameter is enabled:
+		this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, JavaCore.INSERT);
+		
+		preview= evaluateRewrite(cu, rewrite);
+		assertEqualString(preview, buf.toString());
+		
+		// do insert new line if new line after type annotation is enabled:
+		this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, JavaCore.DO_NOT_INSERT);
+		this.project1.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_TYPE_ANNOTATION, JavaCore.INSERT);
+		
+		preview= evaluateRewrite(cu, rewrite);
+		
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.lang.annotation.*;\n");
+		buf.append("public abstract class E {\n");
+		buf.append("    public void test() throws @Marker\n");
+		buf.append("    MyException{}\n");
+		buf.append("    class MyException extends Throwable {\n");
+		buf.append("     private static final long serialVersionUID=-3045365361549263819L;");
+		buf.append("    }\n");
+		buf.append("}\n");
+		buf.append("@Target (Element.TYPE_USE);\n");
+		buf.append("@interface Marker {}\n");
+		
+		assertEqualString(preview, buf.toString());
 	}
 	
 	public void testBug427622b_since_8() throws Exception {
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test575/A_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test575/A_out.java
index 48040a2..a9e67a9 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test575/A_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test575/A_out.java
@@ -1,6 +1,5 @@
 public class A {
-	public Object foo(@Ann("parameter")
-	Object parameter) {
+	public Object foo(@Ann("parameter") Object parameter) {
 		return parameter;
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test701/X_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test701/X_out.java
index a9acf9f..8feea5d 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test701/X_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test701/X_out.java
@@ -2,10 +2,7 @@
 
 	@Deprecated
 	@SuppressWarnings("unused")
-	public void setFoo(@Required
-	String name, @NotNull
-	int value, @Required
-	int start, @Required
-	int length) {
+	public void setFoo(@Required String name, @NotNull int value,
+			@Required int start, @Required int length) {
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test703/X_in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test703/X_in.java
index 8209310..d4f1376 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test703/X_in.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test703/X_in.java
@@ -1,4 +1,4 @@
 public class X {
-	@Deprecated public void bar(@SuppressWarnings("unused") int i) {
+	@Deprecated public void bar(@SuppressWarnings("unused") final int i) {
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test703/X_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test703/X_out.java
index 946bdd2..e0c676e 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test703/X_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test703/X_out.java
@@ -1,6 +1,6 @@
 public class X {
 	@Deprecated
 	public void bar(@SuppressWarnings("unused")
-	int i) {
+	final int i) {
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test704/X_in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test704/X_in.java
index 8209310..d4f1376 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test704/X_in.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test704/X_in.java
@@ -1,4 +1,4 @@
 public class X {
-	@Deprecated public void bar(@SuppressWarnings("unused") int i) {
+	@Deprecated public void bar(@SuppressWarnings("unused") final int i) {
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test704/X_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test704/X_out.java
index f42abe0..718acab 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test704/X_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test704/X_out.java
@@ -1,5 +1,5 @@
 public class X {
 	@Deprecated public void bar(@SuppressWarnings("unused")
-	int i) {
+	final int i) {
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test706/X_in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test706/X_in.java
index b41cb10..4a06f15 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test706/X_in.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test706/X_in.java
@@ -24,7 +24,7 @@
 
 	}
 
-	@OnMember public void bar(@OnParameter("unused value") int i, @OnParameter("unused value") String s) {
+	@OnMember public void bar(@OnParameter("unused value") final int i, @OnParameter("unused value") String s) {
 		@OnLocalVariable @Retention String localString = "string";
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test706/X_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test706/X_out.java
index 5712346..1d8f100 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test706/X_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test706/X_out.java
@@ -34,8 +34,7 @@
 	}
 
 	@OnMember public void bar(@OnParameter("unused value")
-	int i, @OnParameter("unused value")
-	String s) {
+	final int i, @OnParameter("unused value") String s) {
 		@OnLocalVariable @Retention String localString = "string";
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test707/X_in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test707/X_in.java
index b41cb10..4a06f15 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test707/X_in.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test707/X_in.java
@@ -24,7 +24,7 @@
 
 	}
 
-	@OnMember public void bar(@OnParameter("unused value") int i, @OnParameter("unused value") String s) {
+	@OnMember public void bar(@OnParameter("unused value") final int i, @OnParameter("unused value") String s) {
 		@OnLocalVariable @Retention String localString = "string";
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test707/X_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test707/X_out.java
index 789c106..a0d7bf9 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test707/X_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test707/X_out.java
@@ -44,8 +44,7 @@
 
 	@OnMember
 	public void bar(@OnParameter("unused value")
-	int i, @OnParameter("unused value")
-	String s) {
+	final int i, @OnParameter("unused value") String s) {
 		@OnLocalVariable @Retention String localString = "string";
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test708/X_in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test708/X_in.java
index b41cb10..4a06f15 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test708/X_in.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test708/X_in.java
@@ -24,7 +24,7 @@
 
 	}
 
-	@OnMember public void bar(@OnParameter("unused value") int i, @OnParameter("unused value") String s) {
+	@OnMember public void bar(@OnParameter("unused value") final int i, @OnParameter("unused value") String s) {
 		@OnLocalVariable @Retention String localString = "string";
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test708/X_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test708/X_out.java
index 05944e3..306a00c 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test708/X_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test708/X_out.java
@@ -43,7 +43,7 @@
 	}
 
 	@OnMember
-	public void bar(@OnParameter("unused value") int i,
+	public void bar(@OnParameter("unused value") final int i,
 			@OnParameter("unused value") String s) {
 		@OnLocalVariable @Retention String localString = "string";
 	}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test709/X_in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test709/X_in.java
index b41cb10..4a06f15 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test709/X_in.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test709/X_in.java
@@ -24,7 +24,7 @@
 
 	}
 
-	@OnMember public void bar(@OnParameter("unused value") int i, @OnParameter("unused value") String s) {
+	@OnMember public void bar(@OnParameter("unused value") final int i, @OnParameter("unused value") String s) {
 		@OnLocalVariable @Retention String localString = "string";
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test709/X_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test709/X_out.java
index f21995d..72ab12d 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test709/X_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test709/X_out.java
@@ -33,7 +33,7 @@
 
 	}
 
-	@OnMember public void bar(@OnParameter("unused value") int i,
+	@OnMember public void bar(@OnParameter("unused value") final int i,
 			@OnParameter("unused value") String s) {
 		@OnLocalVariable @Retention String localString = "string";
 	}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test710/X_in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test710/X_in.java
index b41cb10..4a06f15 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test710/X_in.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test710/X_in.java
@@ -24,7 +24,7 @@
 
 	}
 
-	@OnMember public void bar(@OnParameter("unused value") int i, @OnParameter("unused value") String s) {
+	@OnMember public void bar(@OnParameter("unused value") final int i, @OnParameter("unused value") String s) {
 		@OnLocalVariable @Retention String localString = "string";
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test710/X_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test710/X_out.java
index 426f0e6..d268e68 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test710/X_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test710/X_out.java
@@ -34,8 +34,7 @@
 	}
 
 	@OnMember public void bar(@OnParameter("unused value")
-	int i, @OnParameter("unused value")
-	String s) {
+	final int i, @OnParameter("unused value") String s) {
 		@OnLocalVariable
 		@Retention
 		String localString = "string";
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test711/X_in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test711/X_in.java
index b41cb10..4a06f15 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test711/X_in.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test711/X_in.java
@@ -24,7 +24,7 @@
 
 	}
 
-	@OnMember public void bar(@OnParameter("unused value") int i, @OnParameter("unused value") String s) {
+	@OnMember public void bar(@OnParameter("unused value") final int i, @OnParameter("unused value") String s) {
 		@OnLocalVariable @Retention String localString = "string";
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test711/X_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test711/X_out.java
index 4c1388d..230924a 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test711/X_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test711/X_out.java
@@ -33,7 +33,7 @@
 
 	}
 
-	@OnMember public void bar(@OnParameter("unused value") int i,
+	@OnMember public void bar(@OnParameter("unused value") final int i,
 			@OnParameter("unused value") String s) {
 		@OnLocalVariable
 		@Retention
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test712/X_in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test712/X_in.java
index b41cb10..4a06f15 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test712/X_in.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test712/X_in.java
@@ -24,7 +24,7 @@
 
 	}
 
-	@OnMember public void bar(@OnParameter("unused value") int i, @OnParameter("unused value") String s) {
+	@OnMember public void bar(@OnParameter("unused value") final int i, @OnParameter("unused value") String s) {
 		@OnLocalVariable @Retention String localString = "string";
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test712/X_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test712/X_out.java
index 0f1da7f..aebb082 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test712/X_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test712/X_out.java
@@ -43,7 +43,7 @@
 	}
 
 	@OnMember
-	public void bar(@OnParameter("unused value") int i,
+	public void bar(@OnParameter("unused value") final int i,
 			@OnParameter("unused value") String s) {
 		@OnLocalVariable
 		@Retention
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java
index f159de0..3e0fec2 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java
@@ -1,10 +1,14 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
  * http://www.eclipse.org/legal/epl-v10.html
  * 
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -66,7 +70,7 @@
 		}
 		this.resolvedType = ((SingleTypeReference) this.type).resolveTypeEnclosing(scope, (ReferenceBinding) enclosingType);
 		if (isDiamond && (this.resolvedType instanceof ParameterizedTypeBinding)) {
-			TypeBinding [] inferredTypes = inferElidedTypes(((ParameterizedTypeBinding) this.resolvedType).genericType(), null, argumentTypes, scope);
+			TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, null, argumentTypes, scope);
 			if (inferredTypes != null) {
 				this.resolvedType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) this.resolvedType).genericType(), inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType());
 			} else {
@@ -81,7 +85,7 @@
 	} else {
 	 	this.resolvedType = this.type.resolveType(scope, true /* check bounds*/);
 	 	if (isDiamond && (this.resolvedType instanceof ParameterizedTypeBinding)) {
-			TypeBinding [] inferredTypes = inferElidedTypes(((ParameterizedTypeBinding) this.resolvedType).genericType(), null, argumentTypes, scope);
+			TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, null, argumentTypes, scope);
 			if (inferredTypes != null) {
 				this.resolvedType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) this.resolvedType).genericType(), inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType());
 			} else {
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
index 3d9f299..719c7c2 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
@@ -261,6 +261,14 @@
 public char[] assistIdentifier(){
 	return ((CompletionScanner)this.scanner).completionIdentifier;
 }
+@Override
+protected ASTNode assistNodeParent() {
+	return this.assistNodeParent;
+}
+@Override
+protected ASTNode enclosingNode() {
+	return this.enclosingNode;
+}
 protected void attachOrphanCompletionNode(){
 	if(this.assistNode == null || this.isAlreadyAttached) return;
 
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
index bbb178e..fb5eedc 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
@@ -21,6 +21,8 @@
  *
  */
 
+import java.util.HashSet;
+
 import org.eclipse.jdt.internal.compiler.ast.ASTNode;
 import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
 import org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration;
@@ -54,6 +56,7 @@
 import org.eclipse.jdt.internal.compiler.parser.RecoveredField;
 import org.eclipse.jdt.internal.compiler.parser.RecoveredInitializer;
 import org.eclipse.jdt.internal.compiler.parser.RecoveredMethod;
+import org.eclipse.jdt.internal.compiler.parser.RecoveredStatement;
 import org.eclipse.jdt.internal.compiler.parser.RecoveredType;
 import org.eclipse.jdt.internal.compiler.parser.RecoveredUnit;
 import org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
@@ -63,6 +66,7 @@
 import org.eclipse.objectteams.otdt.internal.core.compiler.ast.AbstractMethodMappingDeclaration;
 import org.eclipse.objectteams.otdt.internal.core.compiler.ast.ParameterMapping;
 
+@SuppressWarnings({"rawtypes"})
 public abstract class AssistParser extends Parser {
 	public ASTNode assistNode;
 	public boolean isOrphanCompletionNode;
@@ -478,12 +482,39 @@
 	
 	if (lambdaClosed && this.currentElement != null) {
 		this.restartRecovery = true;
-		if (!(statement instanceof AbstractVariableDeclaration)) // added already as part of standard recovery since these contribute a name to the scope prevailing at the cursor.
+		if (!(statement instanceof AbstractVariableDeclaration)) { // added already as part of standard recovery since these contribute a name to the scope prevailing at the cursor.
+			/* See if CompletionParser.attachOrphanCompletionNode has already added bits and pieces of AST to the recovery tree. If so, we want to
+			   replace those fragments with the fuller statement that provides target type for the lambda that got closed just now. There is prior
+			   art/precedent in the Java 7 world to this: Search for recoveredBlock.statements[--recoveredBlock.statementCount] = null;
+			   See also that this concern does not arise in the case of field/local initialization since the initializer is replaced with full tree by consumeExitVariableWithInitialization.
+			*/
+			ASTNode assistNodeParent = this.assistNodeParent();
+			ASTNode enclosingNode = this.enclosingNode();
+			if (assistNodeParent != null || enclosingNode != null) {
+				RecoveredBlock recoveredBlock = (RecoveredBlock) (this.currentElement instanceof RecoveredBlock ? this.currentElement : 
+													(this.currentElement.parent instanceof RecoveredBlock) ? this.currentElement.parent : null);
+				if (recoveredBlock != null) {
+					RecoveredStatement recoveredStatement = recoveredBlock.statementCount > 0 ? recoveredBlock.statements[recoveredBlock.statementCount - 1] : null;
+					ASTNode parseTree = recoveredStatement != null ? recoveredStatement.updatedStatement(0, new HashSet()) : null;
+					if (parseTree == assistNodeParent || parseTree == enclosingNode) {
+						recoveredBlock.statements[--recoveredBlock.statementCount] = null;
+						this.currentElement = recoveredBlock;
+					}
+				}
+			}
 			this.currentElement.add(statement, 0);
+		}
 	}
 	this.snapShot = null;
 	return lambdaClosed;
 }
+protected ASTNode assistNodeParent() {
+	return null;
+}
+protected ASTNode enclosingNode() {
+	return null;
+}
+
 //{ObjectTeams: make public (was protected)
 public boolean isAssistParser() {
 //SH}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
index 8e781a6..c120854 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
@@ -1814,6 +1814,9 @@
 
 	/** @since 3.9 BETA_JAVA8 */
 	int GenericInferenceError = 1100; 	// FIXME: This is just a stop-gap measure, be more specific via https://bugs.eclipse.org/404675
+	
+	/** @since 3.9 BETA_JAVA8 */
+	int LambdaShapeComputationError = 1101;
 
 //{ObjectTeams:
 	int OTJ_RELATED = 1000000;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
index b9cf1d1..a5a3cc9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
@@ -32,6 +32,7 @@
  *								Bug 426366 - [1.8][compiler] Type inference doesn't handle multiple candidate target types in outer overload context
  *								Bug 427282 - [1.8][compiler] AIOOB (-1) at org.eclipse.jdt.internal.compiler.ClassFile.traverse(ClassFile.java:6209)
  *								Bug 427483 - [Java 8] Variables in lambdas sometimes can't be resolved
+ *								Bug 428352 - [1.8][compiler] Resolution errors don't always surface
  *     Jesper S Moller - Contributions for
  *								bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
  *								bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
@@ -704,8 +705,9 @@
 	 * @param methodBinding the method produced by lookup (possibly involving type inference).
 	 * @param argumentTypes the argument types as collected from first resolving the invocation arguments and as used for
 	 * 	the method lookup.
+	 * @param scope scope for error reporting
 	 */
-	public static void resolvePolyExpressionArguments(Invocation invocation, MethodBinding methodBinding, TypeBinding[] argumentTypes) {
+	public static void resolvePolyExpressionArguments(Invocation invocation, MethodBinding methodBinding, TypeBinding[] argumentTypes, Scope scope) {
 		if (!invocation.innersNeedUpdate())
 			return;
 		int problemReason = 0;
@@ -759,7 +761,7 @@
 
 				if (argument instanceof Invocation) {
 					Invocation innerInvocation = (Invocation)argument;
-					MethodBinding binding = innerInvocation.binding(parameterType);
+					MethodBinding binding = innerInvocation.binding(parameterType, true, scope);
 					if (binding instanceof ParameterizedGenericMethodBinding) {
 						ParameterizedGenericMethodBinding parameterizedMethod = (ParameterizedGenericMethodBinding) binding;
 						InferenceContext18 innerContext = innerInvocation.getInferenceContext(parameterizedMethod);
@@ -771,7 +773,7 @@
 									innerContext.reportInvalidInvocation(innerInvocation, improvedBinding);
 								}
 								if (innerInvocation.updateBindings(improvedBinding, parameterType)) {
-									resolvePolyExpressionArguments(innerInvocation, improvedBinding);
+									resolvePolyExpressionArguments(innerInvocation, improvedBinding, scope);
 								}
 							} else if (innerContext.stepCompleted < InferenceContext18.BINDINGS_UPDATED) {
 								innerContext.rebindInnerPolies(parameterizedMethod, innerInvocation);
@@ -786,7 +788,7 @@
 					if (infCtx != null && infCtx.stepCompleted == InferenceContext18.BINDINGS_UPDATED)
 						updatedArgumentType = argument.resolvedType; // in this case argument was already resolved via InferenceContext18.acceptPendingPolyArguments()
 					else
-						updatedArgumentType = argument.checkAgainstFinalTargetType(parameterType);
+						updatedArgumentType = argument.checkAgainstFinalTargetType(parameterType, scope);
 
 					if (problemReason == ProblemReasons.NoError // preserve errors
 							&& updatedArgumentType != null					// do we have a relevant update? ...
@@ -802,7 +804,7 @@
 		invocation.innerUpdateDone();
 	}
 
-	public static void resolvePolyExpressionArguments(Invocation invocation, MethodBinding methodBinding) {
+	public static void resolvePolyExpressionArguments(Invocation invocation, MethodBinding methodBinding, Scope scope) {
 		TypeBinding[] argumentTypes = null;
 		Expression[] innerArguments = invocation.arguments();
 		if (innerArguments != null) {
@@ -810,7 +812,7 @@
 			for (int i = 0; i < innerArguments.length; i++)
 				argumentTypes[i] = innerArguments[i].resolvedType;
 		}
-		resolvePolyExpressionArguments(invocation, methodBinding, argumentTypes);
+		resolvePolyExpressionArguments(invocation, methodBinding, argumentTypes, scope);
 	}
 
 	public static void resolveAnnotations(BlockScope scope, Annotation[] sourceAnnotations, Binding recipient) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
index eb7dd1b..3636792 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
@@ -38,6 +38,8 @@
  *							Bug 424930 - [1.8][compiler] Regression: "Cannot infer type arguments" error from compiler.
  *							Bug 427483 - [Java 8] Variables in lambdas sometimes can't be resolved
  *							Bug 427438 - [1.8][compiler] NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
+ *							Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()? 
+ *							Bug 428352 - [1.8][compiler] Resolution errors don't always surface
  *     Jesper S Moller <jesper@selskabet.org> - Contributions for
  *							bug 378674 - "The method can be declared as static" is wrong
  *     Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
@@ -58,7 +60,6 @@
 import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
 import org.eclipse.jdt.internal.compiler.impl.Constant;
 import org.eclipse.jdt.internal.compiler.lookup.*;
-import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
 import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
 import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
 import org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies;
@@ -118,6 +119,7 @@
 		boolean argsContainCast;
 		boolean cannotInferDiamond; // request the an error be reported in due time
 		TypeBinding[] argumentTypes;
+		boolean hasReportedError;
 
 		ResolutionState(BlockScope scope, boolean isDiamond, boolean diamonNeedsDeferring,
 				boolean argsContainCast, TypeBinding[] argumentTypes)
@@ -505,7 +507,7 @@
 			}
 			argument.setExpressionContext(INVOCATION_CONTEXT);
 			if (this.arguments[i].resolvedType != null) 
-				this.arguments[i].unresolve(); // some cleanup before second attempt
+				scope.problemReporter().genericInferenceError("Argument was unexpectedly found resolved", this); //$NON-NLS-1$
 			if ((argumentTypes[i] = argument.resolveType(scope)) == null) {
 				argHasError = true;
 			}
@@ -574,10 +576,11 @@
 	// TODO: all information persisted during this method may need to be stored per targetType?
 	if (state.isDiamond) {
 		ReferenceBinding genericType = ((ParameterizedTypeBinding) this.resolvedType).genericType();
-		TypeBinding [] inferredTypes = inferElidedTypes(genericType, genericType.enclosingType(), state.argumentTypes, state.scope);
+		TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, this.resolvedType.enclosingType(), state.argumentTypes, state.scope);
 		if (inferredTypes == null) {
 			if (!state.diamondNeedsDeferring) {
 				state.scope.problemReporter().cannotInferElidedTypes(this);
+				state.hasReportedError = true;
 				this.resolvedType = null;
 			} else {
 				state.cannotInferDiamond = true; // defer reporting
@@ -605,6 +608,8 @@
 
 /** Final part of resolving (once): check and report various error conditions. */
 TypeBinding resolvePart3(ResolutionState state) {
+	if (this.suspendedResolutionState != null && this.suspendedResolutionState.hasReportedError)
+		return this.resolvedType;
 	this.suspendedResolutionState = null;
 	if (state.cannotInferDiamond) {
 		state.scope.problemReporter().cannotInferElidedTypes(this);
@@ -711,7 +716,7 @@
 	}
 }
 
-public TypeBinding[] inferElidedTypes(ReferenceBinding allocationType, ReferenceBinding enclosingType, TypeBinding[] argumentTypes, final BlockScope scope) {
+public TypeBinding[] inferElidedTypes(ParameterizedTypeBinding allocationType, ReferenceBinding enclosingType, TypeBinding[] argumentTypes, final BlockScope scope) {
 	/* Given the allocation type and the arguments to the constructor, see if we can synthesize a generic static factory
 	   method that would, given the argument types and the invocation site, manufacture a parameterized object of type allocationType.
 	   If we are successful then by design and construction, the parameterization of the return type of the factory method is identical
@@ -738,8 +743,7 @@
 }
 
 public void checkTypeArgumentRedundancy(ParameterizedTypeBinding allocationType, ReferenceBinding enclosingType, TypeBinding[] argumentTypes, final BlockScope scope) {
-	ProblemReporter reporter = scope.problemReporter();
-	if ((reporter.computeSeverity(IProblem.RedundantSpecificationOfTypeArguments) == ProblemSeverities.Ignore) || scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_7) return;
+	if ((scope.problemReporter().computeSeverity(IProblem.RedundantSpecificationOfTypeArguments) == ProblemSeverities.Ignore) || scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_7) return;
 	if (allocationType.arguments == null) return;  // raw binding
 	if (this.genericTypeArguments != null) return; // diamond can't occur with explicit type args for constructor
 	if (argumentTypes == Binding.NO_PARAMETERS && this.typeExpected instanceof ParameterizedTypeBinding) {
@@ -753,7 +757,7 @@
 					break;
 			}
 			if (i == allocationType.arguments.length) {
-				reporter.redundantSpecificationOfTypeArguments(this.type, allocationType.arguments);
+				scope.problemReporter().redundantSpecificationOfTypeArguments(this.type, allocationType.arguments);
 				return;
 			}	
 		}
@@ -764,7 +768,7 @@
 		// checking for redundant type parameters must fake a diamond, 
 		// so we infer the same results as we would get with a diamond in source code:
 		this.type.bits |= IsDiamond;
-		inferredTypes = inferElidedTypes(allocationType.genericType(), enclosingType, argumentTypes, scope);
+		inferredTypes = inferElidedTypes(allocationType, enclosingType, argumentTypes, scope);
 	} finally {
 		// reset effects of inference
 		this.type.bits = previousBits;
@@ -776,7 +780,7 @@
 		if (TypeBinding.notEquals(inferredTypes[i], allocationType.arguments[i]))
 			return;
 	}
-	reporter.redundantSpecificationOfTypeArguments(this.type, allocationType.arguments);
+	scope.problemReporter().redundantSpecificationOfTypeArguments(this.type, allocationType.arguments);
 }
 
 //{ObjectTeams: replace with and resolved role creation expression:
@@ -912,20 +916,34 @@
 }
 
 //-- interface Invocation: --
-public MethodBinding binding(TypeBinding targetType) {
+public MethodBinding binding(TypeBinding targetType, boolean reportErrors, Scope scope) {
 	if (this.suspendedResolutionState != null && targetType != null) {
 		setExpectedType(targetType);
-		if (!resolvePart2(this.suspendedResolutionState))
+		if (!resolvePart2(this.suspendedResolutionState)) {
+			if (reportErrors && !this.suspendedResolutionState.hasReportedError) {
+				if (this.suspendedResolutionState.cannotInferDiamond)
+					scope.problemReporter().cannotInferElidedTypes(this);
+				else
+					scope.problemReporter().genericInferenceError("constructor is unexpectedly unresolved", this); //$NON-NLS-1$
+				this.suspendedResolutionState.hasReportedError = true;
+			}
 			return null;
+		}
+	}
+	if (reportErrors && this.binding != null && !this.binding.isValidBinding()) {
+		if (this.binding.declaringClass == null)
+			this.binding.declaringClass = (ReferenceBinding) this.resolvedType;
+		scope.problemReporter().invalidConstructor(this, this.binding);
+		this.suspendedResolutionState.hasReportedError = true;
 	}
 	return this.binding;
 }
-public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType) {
+public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType, Scope scope) {
 	if (this.suspendedResolutionState != null) {
 		return resolvePart3(this.suspendedResolutionState);
 		// also: should this trigger any propagation to inners, too?
 	}
-	return super.checkAgainstFinalTargetType(targetType);
+	return super.checkAgainstFinalTargetType(targetType, scope);
 }
 public Expression[] arguments() {
 	return this.arguments;
@@ -933,8 +951,8 @@
 
 public boolean updateBindings(MethodBinding updatedBinding, TypeBinding targetType) {
 	boolean hasUpdate = this.binding != updatedBinding;
-	if (this.inferenceContexts != null) {
-		InferenceContext18 ctx = (InferenceContext18)this.inferenceContexts.removeKey(this.binding);
+	if (this.inferenceContexts != null && this.binding.original() == updatedBinding.original()) {
+		InferenceContext18 ctx = (InferenceContext18)this.inferenceContexts.get(this.binding);
 		if (ctx != null && updatedBinding instanceof ParameterizedGenericMethodBinding) {
 			this.inferenceContexts.put(updatedBinding, ctx);
 			// solution may have come from an outer inference, mark now that this (inner) is done (but not deep inners):
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
index 3843d9c..beb4953 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
@@ -560,7 +560,16 @@
 	if (valueRequired) {
 		codeStream.generateImplicitConversion(this.implicitConversion);
 	} else if (needRuntimeCheckcast) {
-		codeStream.pop();
+		boolean isUnboxing = (this.implicitConversion & TypeIds.UNBOXING) != 0;
+		switch (isUnboxing ? postConversionType(currentScope).id : this.resolvedType.id) {
+			case T_long :
+			case T_double :
+				codeStream.pop2();
+				break;
+			default :
+				codeStream.pop();
+				break;
+		}
 	}
 	codeStream.recordPositionsFrom(pc, this.sourceStart);
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
index 5ac8a85..d457308 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
@@ -27,6 +27,7 @@
  *							Bug 426078 - [1.8] VerifyError when conditional expression passed as an argument
  *							Bug 427438 - [1.8][compiler] NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
  *							Bug 418537 - [1.8][null] Fix null type annotation analysis for poly conditional expressions
+ *							Bug 428352 - [1.8][compiler] Resolution errors don't always surface
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.ast;
 
@@ -717,12 +718,12 @@
 		return this.expressionContext;
 	}
 	
-	public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType) {
+	public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType, Scope scope) {
 		// in 1.8 if treated as a poly expression:
 		if (isPolyExpression()) {
 			targetType = targetType.uncapture(this.polyExpressionScope);
-			this.originalValueIfTrueType = this.valueIfTrue.checkAgainstFinalTargetType(targetType);
-			this.originalValueIfFalseType = this.valueIfFalse.checkAgainstFinalTargetType(targetType);
+			this.originalValueIfTrueType = this.valueIfTrue.checkAgainstFinalTargetType(targetType, scope);
+			this.originalValueIfFalseType = this.valueIfFalse.checkAgainstFinalTargetType(targetType, scope);
 			computeConversions(this.polyExpressionScope, targetType);
 			this.resolvedType = targetType;
 		}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
index 4c3086a..f5bcc23 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
@@ -29,6 +29,7 @@
  *								Bug 426290 - [1.8][compiler] Inference + overloading => wrong method resolution ?
  *								Bug 427483 - [Java 8] Variables in lambdas sometimes can't be resolved
  *								Bug 427438 - [1.8][compiler] NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
+ *								Bug 428352 - [1.8][compiler] Resolution errors don't always surface
  *        Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
  *                          Bug 409245 - [1.8][compiler] Type annotations dropped when call is routed through a synthetic bridge method
  *******************************************************************************/
@@ -863,7 +864,13 @@
 	}
 
 	// -- interface Invocation: --
-	public MethodBinding binding(TypeBinding targetType) {
+	public MethodBinding binding(TypeBinding targetType, boolean reportErrors, Scope scope) {
+		if (reportErrors) {
+			if (this.binding == null)
+				scope.problemReporter().genericInferenceError("constructor is unexpectedly unresolved", this); //$NON-NLS-1$
+			else if (!this.binding.isValidBinding())
+				scope.problemReporter().invalidConstructor(this, this.binding);
+		}
 		return this.binding;
 	}
 	public Expression[] arguments() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
index f5c38be..9c4cf0f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
@@ -29,6 +29,9 @@
  *								Bug 426792 - [1.8][inference][impl] generify new type inference engine
  *								Bug 423505 - [1.8] Implement "18.5.4 More Specific Method Inference"
  *								Bug 427438 - [1.8][compiler] NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
+ *								Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()?
+ *								Bug 428274 - [1.8] [compiler] Cannot cast from Number to double
+ *								Bug 428352 - [1.8][compiler] Resolution errors don't always surface
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.ast;
 
@@ -421,8 +424,10 @@
 				return true;
 
 			}
-		} else if (use17specifics && expressionType.id == TypeIds.T_JavaLangObject){
-			// cast from Object to base type allowed from 1.7, see JLS $5.5
+		} else if (use17specifics && castType.isPrimitiveType() && expressionType instanceof ReferenceBinding && 
+				!expressionType.isBoxedPrimitiveType() && checkCastTypesCompatibility(scope, scope.boxing(castType), expressionType, expression)) {
+			// cast from any reference type (other than boxing types) to base type allowed from 1.7, see JLS $5.5
+			// by our own interpretation (in accordance with javac) we reject arays, though.
 			return true;
 		} else if (use15specifics
 							&& scope.environment().computeBoxingType(expressionType).isCompatibleWith(castType)) { // unboxing - only widening match is allowed
@@ -841,7 +846,10 @@
 	int compileTimeTypeID, runtimeTypeID;
 	if ((compileTimeTypeID = compileTimeType.id) >= TypeIds.T_LastWellKnownTypeId) { // e.g. ? extends String  ==> String (103227); >= TypeIds.T_LastWellKnownTypeId implies TypeIds.NoId
 		compileTimeTypeID = compileTimeType.erasure().id == TypeIds.T_JavaLangString ? TypeIds.T_JavaLangString : TypeIds.T_JavaLangObject;
+	} else if (runtimeType.isPrimitiveType() && compileTimeType instanceof ReferenceBinding && !compileTimeType.isBoxedPrimitiveType()) {
+		compileTimeTypeID = TypeIds.T_JavaLangObject; // treatment is the same as for jlO.
 	}
+
 	switch (runtimeTypeID = runtimeType.id) {
 		case T_byte :
 		case T_short :
@@ -1138,11 +1146,6 @@
 public boolean isPertinentToApplicability(TypeBinding targetType, MethodBinding method) {
 	return true;
 }
-// call this before resolving an expression for the second time.
-// FIXME: we should find a better strategy, see LambdaExpressionsTest.testLambdaInference1() f. for tests that currently need this.
-void unresolve() {
-	this.resolvedType = null;
-}
 /**
  * Returns the type of the expression after required implicit conversions. When expression type gets promoted
  * or inserted a generic cast, the converted type will differ from the resolved type (surface side-effects from
@@ -1247,8 +1250,9 @@
  * Once outer contexts have finalized the target type for this expression,
  * perform any checks that might have been delayed previously.
  * @param targetType the final target type (aka expectedType) for this expression.
+ * @param scope scope for error reporting
  */
-public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType) {
+public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType, Scope scope) {
 	return this.resolvedType; // subclasses may choose to do real stuff here
 }
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java
index 49cfc04..23e15bc 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java
@@ -29,6 +29,7 @@
 import org.eclipse.jdt.internal.compiler.lookup.Binding;
 import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
 import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
+import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
 import org.eclipse.jdt.internal.compiler.lookup.MethodScope;
 import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
 import org.eclipse.jdt.internal.compiler.lookup.Scope;
@@ -390,8 +391,8 @@
 	}
 
 	/** 
-	 * Check if the rhs of an assignment or local declaration is an (Auto)Closeable.
-	 * If so create or re-use a tracking variable, and wire and initialize everything.
+	 * Given the rhs of an assignment or local declaration has a (Auto)Closeable type (or null), setup for leak analysis now:
+	 * Create or re-use a tracking variable, and wire and initialize everything.
 	 * @param scope scope containing the assignment
 	 * @param upstreamInfo info without analysis of the rhs, use this to determine the status of a resource being disconnected
 	 * @param flowInfo info with analysis of the rhs, use this for recording resource status because this will be passed downstream
@@ -513,6 +514,17 @@
 				break;
 		}
 
+		boolean isResourceProducer = false;
+		if (expression.resolvedType instanceof ReferenceBinding) {
+			ReferenceBinding resourceType = (ReferenceBinding) expression.resolvedType;
+			if (resourceType.hasTypeBit(TypeIds.BitResourceFreeCloseable)) {
+				if (isBlacklistedMethod(expression))
+					isResourceProducer = true;
+				else
+					return null; // (a) resource-free closeable: -> null
+			}
+		}
+
 		// analyze by node type:
 		if (expression instanceof AllocationExpression) {
 			// allocation expressions already have their tracking variables analyzed by analyseCloseableAllocation(..)
@@ -527,7 +539,8 @@
 		{
 			// we *might* be responsible for the resource obtained
 			FakedTrackingVariable tracker = new FakedTrackingVariable(local, location, flowInfo, flowContext, FlowInfo.POTENTIALLY_NULL); // shed some doubt
-			tracker.globalClosingState |= SHARED_WITH_OUTSIDE;
+			if (!isResourceProducer)
+				tracker.globalClosingState |= SHARED_WITH_OUTSIDE;
 			return tracker;
 		} else if (
 				(expression.bits & RestrictiveFlagMASK) == Binding.FIELD
@@ -541,13 +554,6 @@
 			return tracker;			
 		}
 
-		if (expression.resolvedType instanceof ReferenceBinding) {
-			ReferenceBinding resourceType = (ReferenceBinding) expression.resolvedType;
-			if (resourceType.hasTypeBit(TypeIds.BitResourceFreeCloseable)) {
-				// (a) resource-free closeable: -> null
-				return null;
-			}
-		}
 		if (local.closeTracker != null)
 			// (c): inner has already been analyzed: -> re-use track var
 			return local.closeTracker;
@@ -559,6 +565,16 @@
 		return newTracker;
 	}
 
+	private static boolean isBlacklistedMethod(Expression expression) {
+		if (expression instanceof MessageSend) {
+			MethodBinding method = ((MessageSend) expression).binding;
+			if (method != null && method.isValidBinding())
+				// for all methods in java.nio.file.Files that return a resource (Stream) it really needs closing
+				return CharOperation.equals(method.declaringClass.compoundName, TypeConstants.JAVA_NIO_FILE_FILES);
+		}
+		return false;
+	}
+
 	public static void cleanUpAfterAssignment(BlockScope currentScope, int lhsBits, Expression expression) {
 		// remove all remaining track vars with no original binding
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
index 56aee47..7b393ab 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
@@ -22,6 +22,7 @@
  *							Bug 425156 - [1.8] Lambda as an argument is flagged with incompatible error
  *							Bug 424403 - [1.8][compiler] Generic method call with method reference argument fails to resolve properly.
  *							Bug 427438 - [1.8][compiler] NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
+ *							Bug 428352 - [1.8][compiler] Resolution errors don't always surface
  *     Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
  *                          Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
  *******************************************************************************/
@@ -180,7 +181,7 @@
 		return null;
 	}
 
-	public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType) {
+	public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType, Scope scope) {
 		targetType = targetType.uncapture(this.enclosingScope);
 		return resolveTypeExpecting(this.enclosingScope, targetType);
 	}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Invocation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Invocation.java
index 02609f8..d3fce06 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Invocation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Invocation.java
@@ -19,6 +19,7 @@
 import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
 import org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding;
 import org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding;
+import org.eclipse.jdt.internal.compiler.lookup.Scope;
 import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
 
 /**
@@ -35,8 +36,12 @@
 	/**
 	 * Answer the resolved method binding of this invocation.
 	 * If a target type is given, the invocation gets a chance to do repeated method lookup.
+	 * @param targetType the target type of this invocation or null if not yet known
+	 * @param reportErrors if true then this is the last call, if no valid binding can be answered we should report an error
+	 * @param scope if reportErrors is true then this scope can be used for error reporting
+	 * 
 	 */
-	MethodBinding binding(TypeBinding targetType);
+	MethodBinding binding(TypeBinding targetType, boolean reportErrors, Scope scope);
 
 	/**
 	 * Register the given inference context, which produced the given method as its intermediate result.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
index 2dae958..6c7b57d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
@@ -30,6 +30,7 @@
  *							Bug 426563 - [1.8] AIOOBE when method with error invoked with lambda expression as argument
  *							Bug 420525 - [1.8] [compiler] Incorrect error "The type Integer does not define sum(Object, Object) that is applicable here"
  *							Bug 427438 - [1.8][compiler] NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
+ *							Bug 428294 - [1.8][compiler] Type mismatch: cannot convert from List<Object> to Collection<Object[]>
  *     Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
  *                          Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
  *******************************************************************************/
@@ -426,7 +427,7 @@
 				}
 			} else {
 				// non-wildcard parameterization (9.8) of the target type
-				TypeBinding[] types = withWildCards.getNonWildcardParameterization();
+				TypeBinding[] types = withWildCards.getNonWildcardParameterization(blockScope);
 				if (types == null)
 					return null;
 				return blockScope.environment().createParameterizedType(genericType, types, genericType.enclosingType());
@@ -440,9 +441,14 @@
 	}
 
 	private boolean doesNotCompleteNormally() {
-		return this.body.analyseCode(this.scope, 
+		try {
+			return this.body.analyseCode(this.scope, 
 									 new ExceptionHandlingFlowContext(null, this, Binding.NO_EXCEPTIONS, null, this.scope, FlowInfo.DEAD_END), 
-									 UnconditionalFlowInfo.fakeInitializedFlowInfo(this.scope.outerMostMethodScope().analysisIndex, this.scope.referenceType().maxFieldCount)) == FlowInfo.DEAD_END; 
+									 UnconditionalFlowInfo.fakeInitializedFlowInfo(this.scope.outerMostMethodScope().analysisIndex, this.scope.referenceType().maxFieldCount)) == FlowInfo.DEAD_END;
+		} catch (RuntimeException e) {
+			this.scope.problemReporter().lambdaShapeComputationError(this);
+			return this.valueCompatible;
+		}
 	}
 	public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, final FlowInfo flowInfo) {
 		
@@ -1031,6 +1037,13 @@
 				return;
 			default: 
 				this.original.hasIgnoredMandatoryErrors = true;
+				MethodScope enclosingLambdaScope = this.scope == null ? null : this.scope.enclosingLambdaScope();
+				while (enclosingLambdaScope != null) {
+					LambdaExpression enclosingLambda = (LambdaExpression) enclosingLambdaScope.referenceContext;
+					if (enclosingLambda.original != enclosingLambda)
+						enclosingLambda.original.hasIgnoredMandatoryErrors = true;
+					enclosingLambdaScope = enclosingLambdaScope.enclosingLambdaScope();
+				}
 				return;
 		}
 	}
@@ -1183,7 +1196,7 @@
 			TypeBinding[] intersectionTypes = ((IntersectionCastTypeBinding)this.expectedType).intersectingTypes;
 			for (int i = 0,max = intersectionTypes.length; i < max; i++) {
 				TypeBinding typeBinding = intersectionTypes[i];
-				MethodBinding methodBinding = typeBinding.getSingleAbstractMethod(this.scope, false);
+				MethodBinding methodBinding = typeBinding.getSingleAbstractMethod(this.scope, true);
 				// Why doesn't getSingleAbstractMethod do as the javadoc says, and return null
 				// when it is not a SAM type
 				if (!(methodBinding instanceof ProblemMethodBinding && ((ProblemMethodBinding)methodBinding).problemId()==ProblemReasons.NoSuchSingleAbstractMethod)) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
index 18e069a..1d08057 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
@@ -50,6 +50,8 @@
  *								Bug 426290 - [1.8][compiler] Inference + overloading => wrong method resolution ?
  *								Bug 427483 - [Java 8] Variables in lambdas sometimes can't be resolved
  *								Bug 427438 - [1.8][compiler] NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
+ *								Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()? 
+ *								Bug 428352 - [1.8][compiler] Resolution errors don't always surface
  *     Jesper S Moller - Contributions for
  *								Bug 378674 - "The method can be declared as static" is wrong
  *        Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
@@ -800,7 +802,7 @@
 //{ObjectTeams: FIXME: stale comment regarding removed code: "receiver may already be resolved, keep that result:"
 // orig:
 	if (this.receiver.resolvedType != null)
-		this.receiver.unresolve(); // some cleanup before second attempt
+		scope.problemReporter().genericInferenceError("Receiver was unexpectedly found resolved", this); //$NON-NLS-1$
 	this.actualReceiverType = this.receiver.resolveType(scope);
 // :giro
   /*orig:
@@ -853,7 +855,7 @@
 		  if (!this.isGenerated)
 // SH}
 			if (this.arguments[i].resolvedType != null) 
-				this.arguments[i].unresolve(); // some cleanup before second attempt
+				scope.problemReporter().genericInferenceError("Argument was unexpectedly found resolved", this); //$NON-NLS-1$
 			if (argument instanceof CastExpression) {
 				argument.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on
 				argsContainCast = true;
@@ -1288,7 +1290,7 @@
 	this.binding = this.receiver.isImplicitThis()
 			? scope.getImplicitMethod(this.selector, argumentTypes, this)
 			: scope.getMethod(this.actualReceiverType, this.selector, argumentTypes, this);
-		resolvePolyExpressionArguments(this, this.binding, argumentTypes);
+	resolvePolyExpressionArguments(this, this.binding, argumentTypes, scope);
 }
 
 //{ObjectTeams: utils:
@@ -1451,6 +1453,21 @@
 }
 // SH}
 
+@Override
+public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType, Scope scope) {
+	if (this.binding instanceof ParameterizedGenericMethodBinding) {
+		InferenceContext18 ctx = getInferenceContext((ParameterizedMethodBinding) this.binding);
+		if (ctx != null && ctx.stepCompleted < InferenceContext18.TYPE_INFERRED) {
+			this.expectedType = targetType;
+			MethodBinding updatedBinding = ctx.inferInvocationType(this, (ParameterizedGenericMethodBinding) this.binding);
+			if (updateBindings(updatedBinding, targetType)) {
+				ASTNode.resolvePolyExpressionArguments(this, updatedBinding, scope);
+			}
+		}
+	}
+	return this.resolvedType;
+}
+
 public void setActualReceiverType(ReferenceBinding receiverType) {
 	if (receiverType == null) return; // error scenario only
 	this.actualReceiverType = receiverType;
@@ -1547,7 +1564,13 @@
 	return this.receiver.isImplicitThis();
 }
 // -- interface Invocation: --
-public MethodBinding binding(TypeBinding targetType) {
+public MethodBinding binding(TypeBinding targetType, boolean reportErrors, Scope scope) {
+	if (reportErrors) {
+		if (this.binding == null)
+			scope.problemReporter().genericInferenceError("method is unexpectedly unresolved", this); //$NON-NLS-1$
+		else if (!this.binding.isValidBinding())
+			scope.problemReporter().invalidMethod(this, this.binding);
+	}
 	return this.binding;
 }
 public Expression[] arguments() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NameReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NameReference.java
index ea43bb6..0ddd492 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NameReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NameReference.java
@@ -16,6 +16,7 @@
  *     Stephan Herrmann - Contribution for
  *								bug 331649 - [compiler][null] consider null annotations for fields
  *								Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
+ *								Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()? 
  *     Jesper S Moller - Contributions for
  *							bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
  *******************************************************************************/
@@ -150,12 +151,6 @@
 		}
 	}
 }
-void unresolve() {
-	this.resolvedType = null;
-	this.actualReceiverType = null;
-	this.bits &= ~RestrictiveFlagMASK;
-	this.bits |= Binding.TYPE | Binding.VARIABLE;
-}
 //{ObjectTeams: hook after this reference has been fully resolved
 public void resolveFinished() { /* noop  */ }
 // SH}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
index 15e6774..ef08395 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
@@ -561,7 +561,7 @@
 				return this.resolvedType = receiverType;
 			}
 			if (isDiamond) {
-				TypeBinding [] inferredTypes = inferElidedTypes(((ParameterizedTypeBinding) receiverType).genericType(), receiverType.enclosingType(), argumentTypes, scope);
+				TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) receiverType, receiverType.enclosingType(), argumentTypes, scope);
 				if (inferredTypes == null) {
 					scope.problemReporter().cannotInferElidedTypes(this);
 					return this.resolvedType = null;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
index 9bc5a0a..de28ffa 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
@@ -27,6 +27,7 @@
  *							Bug 424403 - [1.8][compiler] Generic method call with method reference argument fails to resolve properly.
  *							Bug 427196 - [1.8][compiler] Compiler error for method reference to overloaded method
  *							Bug 427438 - [1.8][compiler] NPE at org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
+ *							Bug 428264 - [1.8] method reference of generic class causes problems (wrong inference result or NPE)
  *        Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contribution for
  *                          Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
  *******************************************************************************/
@@ -52,6 +53,7 @@
 import org.eclipse.jdt.internal.compiler.lookup.Binding;
 import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
 import org.eclipse.jdt.internal.compiler.lookup.InferenceContext18;
+import org.eclipse.jdt.internal.compiler.lookup.IntersectionCastTypeBinding;
 import org.eclipse.jdt.internal.compiler.lookup.InvocationSite;
 import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
 import org.eclipse.jdt.internal.compiler.lookup.PolyTypeBinding;
@@ -59,6 +61,7 @@
 import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
 import org.eclipse.jdt.internal.compiler.lookup.Scope;
 import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
+import org.eclipse.jdt.internal.compiler.lookup.SyntheticArgumentBinding;
 import org.eclipse.jdt.internal.compiler.lookup.SyntheticMethodBinding;
 import org.eclipse.jdt.internal.compiler.lookup.TagBits;
 import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
@@ -152,12 +155,25 @@
 		} finally {
 			currentScope.problemReporter().switchErrorHandlingPolicy(oldPolicy);
 		}
+		SyntheticArgumentBinding[] outerLocals = this.receiverType.syntheticOuterLocalVariables();
+		for (int i = 0, length = outerLocals == null ? 0 : outerLocals.length; i < length; i++)
+			implicitLambda.addSyntheticArgument(outerLocals[i].actualOuterLocalVariable);
+		
 		implicitLambda.generateCode(currentScope, codeStream, valueRequired);
 	}	
 	
+	private boolean shouldGenerateImplicitLambda(BlockScope currentScope) {
+		// these cases are either too complicated, impossible to handle or result in significant code duplication 
+		return (this.binding.isVarargs() || 
+				(isConstructorReference() && this.receiverType.syntheticOuterLocalVariables() != null && currentScope.methodScope().isStatic) ||
+				this.expectedType instanceof IntersectionCastTypeBinding || // marker interfaces require alternate meta factory.
+				this.expectedType.findSuperTypeOriginatingFrom(currentScope.getJavaIoSerializable()) != null); // serialization support.
+	}
+	
 	public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {
 		this.actualMethodBinding = this.binding; // grab before synthetics come into play.
-		if (this.binding.isVarargs()) {
+		// Handle some special cases up front and transform them into implicit lambdas.
+		if (shouldGenerateImplicitLambda(currentScope)) {
 			generateImplicitLambda(currentScope, codeStream, valueRequired);
 			return;
 		}
@@ -220,6 +236,8 @@
 									true /* disallow instance reference in explicit constructor call */);
 							codeStream.generateOuterAccess(emulationPath, this, syntheticArgumentType, currentScope);
 						}
+					} else {
+						enclosingInstances = Binding.NO_REFERENCE_TYPES;
 					}
 					// Reject types that capture outer local arguments, these cannot be manufactured by the metafactory.
 					if (nestedType.syntheticOuterLocalVariables() != null) {
@@ -743,6 +761,10 @@
 	}
 
 	public boolean isCompatibleWith(TypeBinding left, Scope scope) {
+		if (this.binding != null && this.binding.isValidBinding() // binding indicates if full resolution has already happened
+				&& this.resolvedType != null && this.resolvedType.isValidBinding()) {
+			return this.resolvedType.isCompatibleWith(left, scope);
+		}
 		// 15.28.2
 		left = left.uncapture(this.enclosingScope);
 		final MethodBinding sam = left.getSingleAbstractMethod(this.enclosingScope, true);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
index c2600d3..4f21480 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
@@ -33,6 +33,7 @@
  *								Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
  *								Bug 424415 - [1.8][compiler] Eventual resolution of ReferenceExpression is not seen to be happening.
  *								Bug 418537 - [1.8][null] Fix null type annotation analysis for poly conditional expressions
+ *								Bug 428352 - [1.8][compiler] Resolution errors don't always surface
  *        Andy Clement - Contributions for
  *                          Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
  *                          Bug 409250 - [1.8][compiler] Various loose ends in 308 code generation
@@ -445,7 +446,7 @@
  */
 protected MethodBinding findConstructorBinding(BlockScope scope, Invocation site, ReferenceBinding receiverType, TypeBinding[] argumentTypes) {
 	MethodBinding ctorBinding = scope.getConstructor(receiverType, argumentTypes, site);
-	resolvePolyExpressionArguments(site, ctorBinding, argumentTypes);
+	resolvePolyExpressionArguments(site, ctorBinding, argumentTypes, scope);
 	return ctorBinding;
 }
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
index cea9a5f..77ebd50 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
@@ -153,17 +153,15 @@
 			if (method != null && method.receiver != null && TypeBinding.equalsEquals(method.receiver, this.resolvedType))
 				this.resolvedType = method.receiver;
 		}
-//{ObjectTeams: only implicit this returned directly:
-	  if (isImplicitThis())
-// orig:
-		return this.resolvedType = enclosingReceiverType;
-// : giro
-		this.resolvedType = RoleTypeCreator.maybeWrapUnqualifiedRoleType(
-                scope.enclosingReceiverType(),
+//{ObjectTeams: wrap explicit this:
+		if (!isImplicitThis()) {
+			this.resolvedType = RoleTypeCreator.maybeWrapUnqualifiedRoleType(
+                this.resolvedType,
                 scope,
-                this);
-        return this.resolvedType;
+                this);	
+		}
 // SH}
+		return this.resolvedType;
 	}
 
 	public void traverse(ASTVisitor visitor, BlockScope blockScope) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
index 6ef56b1..e860cca 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
@@ -2593,7 +2593,7 @@
  */
 public void generateSyntheticBodyForDeserializeLambda(SyntheticMethodBinding methodBinding,SyntheticMethodBinding[] syntheticMethodBindings) {
 	initializeMaxLocals(methodBinding);
-	
+
 	// Compute the list of the serializable lambdas from the full set of synthetic method bindings
 	// Also compute a map of hashcodes to a list of serializable lambdas whose names share a hashcode 
 	List syntheticsForSerializableLambdas = new ArrayList();	
@@ -2720,7 +2720,14 @@
 		aload_0();
 		invoke(Opcodes.OPC_invokevirtual, 1, 1, ConstantPool.JavaLangInvokeSerializedLambdaConstantPoolName, 
 				ConstantPool.GetFunctionalInterfaceClass, ConstantPool.GetFunctionalInterfaceClassSignature);
-		ldc(new String(CharOperation.concatWith(lambdaEx.descriptor.declaringClass.compoundName,'/'))); // e.g. "com/foo/X$Foo"
+		String functionalInterface = null;
+		final TypeBinding expectedType = lambdaEx.expectedType();
+		if (expectedType instanceof IntersectionCastTypeBinding) {
+			functionalInterface = new String(((IntersectionCastTypeBinding)expectedType).getSAMType(scope).constantPoolName());
+		} else {
+			functionalInterface = new String(expectedType.constantPoolName());
+		}
+		ldc(functionalInterface);// e.g. "com/foo/X$Foo"
 		invokeObjectEquals();
 		ifeq(errorLabel);
 		
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
index b75e7f6..2b5ddc6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
@@ -28,6 +28,7 @@
  *								Bug 415043 - [1.8][null] Follow-up re null type annotations after bug 392099
  *								Bug 415850 - [1.8] Ensure RunJDTCoreTests can cope with null annotations enabled
  *								Bug 417295 - [1.8[[null] Massage type annotated null analysis to gel well with deep encoded type bindings.
+ *								Bug 427199 - [1.8][resource] avoid resource leak warnings on Streams that have no resource
  *    Jesper Steen Moller - Contributions for
  *								Bug 412150 [1.8] [compiler] Enable reflected parameter names during annotation processing
  *								Bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
@@ -2115,7 +2116,7 @@
 	}
 	this.typeBits |= (this.superclass.typeBits & TypeIds.InheritableBits);
 	if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()! 
-		this.typeBits |= applyCloseableWhitelists();
+		this.typeBits |= applyCloseableClassWhitelists();
 	return this.superclass;
 }
 //{ObjectTeams:
@@ -2160,6 +2161,8 @@
 			}	
 		}
 		this.typeBits |= (this.superInterfaces[i].typeBits & TypeIds.InheritableBits);
+		if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()! 
+			this.typeBits |= applyCloseableInterfaceWhitelists();
 	}
 	this.tagBits &= ~TagBits.HasUnresolvedSuperinterfaces;
 	return this.superInterfaces;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
index d2591a1..0423c8d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
@@ -63,6 +63,7 @@
 
 	// Shared binding collections
 	public static final TypeBinding[] NO_TYPES = new TypeBinding[0];
+	public static final ReferenceBinding[] NO_REFERENCE_TYPES = new ReferenceBinding[0];
 	public static final TypeBinding[] NO_PARAMETERS = new TypeBinding[0];
 	public static final ReferenceBinding[] NO_EXCEPTIONS = new ReferenceBinding[0];
 	public static final ReferenceBinding[] ANY_EXCEPTION = new ReferenceBinding[] { null }; // special handler for all exceptions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java
index 559c2ed..d72e586 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java
@@ -631,7 +631,7 @@
 	}
 
 	private ConstraintFormula[] typeArgumentEqualityConstraints(TypeBinding s, TypeBinding t, boolean isSoft) {
-		if (!(s instanceof ParameterizedTypeBinding) || !(t instanceof ParameterizedTypeBinding))
+		if (s == null || s.kind() != Binding.PARAMETERIZED_TYPE || t == null || t.kind() != Binding.PARAMETERIZED_TYPE)
 			return null;
 		if (TypeBinding.equalsEquals(s, t)) // don't create useless constraints
 			return null;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
index f19f35f..7ed17ec 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
@@ -22,6 +22,7 @@
  *							Bug 395977 - [compiler][resource] Resource leak warning behavior possibly incorrect for anonymous inner class
  *							Bug 395002 - Self bound generic class doesn't resolve bounds properly for wildcards for certain parametrisation.
  *							Bug 416176 - [1.8][compiler][null] null type annotations cause grief on type variables
+ *							Bug 427199 - [1.8][resource] avoid resource leak warnings on Streams that have no resource
  *        Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
  *                          Bug 415821 - [1.8][compiler] CLASS_EXTENDS target type annotation missing for anonymous classes
  *******************************************************************************/
@@ -665,8 +666,8 @@
 
 		SourceTypeBinding sourceType = this.referenceContext.binding;
 		environment().setAccessRestriction(sourceType, accessRestriction);
-		checkAndSetModifiers();
-		buildTypeVariables(); // do this before adding the type to avoid race: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=428247
+		TypeParameter[] typeParameters = this.referenceContext.typeParameters;
+		sourceType.typeVariables = typeParameters == null || typeParameters.length == 0 ? Binding.NO_TYPE_VARIABLES : null;
 		sourceType.fPackage.addType(sourceType);
 //{ObjectTeams: ROFI
 		if (isRoleFile) {
@@ -701,6 +702,8 @@
 			this.environment().getTeamMethodGenerator().registerOOTeamClass(sourceType);
 		}
 // SH}
+		checkAndSetModifiers();
+		buildTypeVariables();
 		buildMemberTypes(accessRestriction);
 //{ObjectTeams: setup cache for known role files:
 		if (this.referenceContext.isTeam())
@@ -1612,7 +1615,7 @@
 				sourceType.typeBits |= (superclass.typeBits & TypeIds.InheritableBits);
 				// further analysis against white lists for the unlikely case we are compiling java.io.*:
 				if ((sourceType.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0)
-					sourceType.typeBits |= sourceType.applyCloseableWhitelists();
+					sourceType.typeBits |= sourceType.applyCloseableClassWhitelists();
 				return true;
 			}
 		}
@@ -2097,6 +2100,9 @@
 			}
 			// only want to reach here when no errors are reported
 			sourceType.typeBits |= (superInterface.typeBits & TypeIds.InheritableBits);
+			// further analysis against white lists for the unlikely case we are compiling java.util.stream.Stream:
+			if ((sourceType.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0)
+				sourceType.typeBits |= sourceType.applyCloseableInterfaceWhitelists();
 			interfaceBindings[count++] = superInterface;
 		}
 		// hold onto all correctly resolved superinterfaces
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
index 0b22e1d..1478331 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
@@ -60,6 +60,7 @@
 
 	public Object reduce(InferenceContext18 inferenceContext) throws InferenceFailureException {
 		// JLS 18.2.1
+		proper:
 		if (this.right.isProperType(true)) {
 			TypeBinding exprType = this.left.resolvedType;
 			if (exprType == null) {
@@ -80,8 +81,18 @@
 				return TRUE;
 			} else if (this.left instanceof AllocationExpression && this.left.isPolyExpression()) {
 				// half-resolved diamond has a resolvedType, but that may not be the final word, try one more step of resolution:
-            	MethodBinding binding = ((AllocationExpression) this.left).binding(this.right);
-            	return (binding != null && binding.declaringClass.isCompatibleWith(this.right)) ? TRUE : FALSE;
+            	MethodBinding binding = ((AllocationExpression) this.left).binding(this.right, false, null);
+            	return (binding != null && binding.declaringClass.isCompatibleWith(this.right, inferenceContext.scope)) ? TRUE : FALSE;
+            } else if (this.left instanceof Invocation && this.left.isPolyExpression()) {
+            	Invocation invoc = (Invocation) this.left;
+            	MethodBinding binding = invoc.binding(this.right, false, null);
+            	if (binding instanceof ParameterizedGenericMethodBinding) {
+            		ParameterizedGenericMethodBinding method = (ParameterizedGenericMethodBinding) binding;
+					InferenceContext18 leftCtx = invoc.getInferenceContext(method);
+            		if (leftCtx.stepCompleted < InferenceContext18.TYPE_INFERRED) {
+            			break proper; // fall through into nested inference below (not explicit in the spec!)
+            		}
+            	}
             }
 			return FALSE;
 		}
@@ -95,7 +106,7 @@
 			// - parenthesized expression : these are transparent in our AST
 			if (this.left instanceof Invocation) {
 				Invocation invocation = (Invocation) this.left;
-				MethodBinding previousMethod = invocation.binding(this.right);
+				MethodBinding previousMethod = invocation.binding(this.right, false, null);
 				if (previousMethod == null)  	// can happen, e.g., if inside a copied lambda with ignored errors
 					return null; 				// -> proceed with no new constraints
 				MethodBinding method = previousMethod;
@@ -335,7 +346,11 @@
 				// spec says erasure, but we don't really have compatibility rules for erasure, use raw type instead:
 				TypeBinding erasure = inferenceContext.environment.convertToRawType(returnType, false);
 				ConstraintTypeFormula newConstraint = new ConstraintTypeFormula(erasure, targetType, COMPATIBLE);
-				return inferenceContext.reduceAndIncorporate(newConstraint);
+				if (!inferenceContext.reduceAndIncorporate(newConstraint))
+					return false;
+				// continuing at true is not spec'd but needed for javac-compatibility,
+				// see org.eclipse.jdt.core.tests.compiler.regression.GenericsRegressionTest_1_8.testBug428198()
+				// and org.eclipse.jdt.core.tests.compiler.regression.GenericsRegressionTest_1_8.testBug428264()
 			}
 			TypeBinding rTheta = inferenceContext.substitute(returnType);
 			ParameterizedTypeBinding parameterizedType = InferenceContext18.parameterizedWithWildcard(rTheta);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java
index 5dde656..8a729f5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java
@@ -38,6 +38,8 @@
 	protected boolean isCompatibleWithInLooseInvocationContext(TypeBinding one, TypeBinding two, InferenceContext18 context) {
 		if (one.isCompatibleWith(two, context.scope))
 			return true;
+		if (one.isBaseType() == two.isBaseType()) // this also protects against comparing null & primitive
+			return false;
 		if (one.isPrimitiveType()) {
 			if (!two.isBaseType()) {
 				TypeBinding boxingType = context.environment.computeBoxingType(one);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java
index e600593..e6d18b0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java
@@ -220,8 +220,8 @@
 			case Binding.PARAMETERIZED_TYPE:
 				{
 					List<ConstraintFormula> constraints = new ArrayList<ConstraintFormula>();
-					while (superCandidate instanceof ParameterizedTypeBinding && subCandidate != null)  {
-						if (!addConstraintsFromTypeParamters(subCandidate, (ParameterizedTypeBinding) superCandidate, constraints))
+					while (superCandidate != null && superCandidate.kind() == Binding.PARAMETERIZED_TYPE && subCandidate != null)  {
+						if (!addConstraintsFromTypeParameters(subCandidate, (ParameterizedTypeBinding) superCandidate, constraints))
 							return FALSE;
 						// travel to enclosing types to check if they have type parameters, too:
 						superCandidate = superCandidate.enclosingType();
@@ -266,18 +266,31 @@
 
 			// "type variable" has two implementations in JDT:
 			case Binding.WILDCARD_TYPE:
-				// TODO If S is an intersection type of which T is an element, the constraint reduces to true. 
-				if (subCandidate.kind() == Binding.INTERSECTION_TYPE)
-					InferenceContext18.missingImplementation("NYI"); //$NON-NLS-1$
+				if (subCandidate.kind() == Binding.INTERSECTION_TYPE) {
+					ReferenceBinding[] intersectingTypes = subCandidate.getIntersectingTypes();
+					if (intersectingTypes != null)
+						for (int i = 0; i < intersectingTypes.length; i++)
+							if (TypeBinding.equalsEquals(intersectingTypes[i], superCandidate))
+								return true;
+				}
 				WildcardBinding variable = (WildcardBinding) superCandidate;
 				if (variable.boundKind == Wildcard.SUPER)
 					return new ConstraintTypeFormula(subCandidate, variable.bound, SUBTYPE, this.isSoft);
 				return FALSE;
 			case Binding.TYPE_PARAMETER:
-				// same as wildcard (but we don't have a lower bound any way)
-				// TODO If S is an intersection type of which T is an element, the constraint reduces to true.
-				if (subCandidate.kind() == Binding.INTERSECTION_TYPE)
-					InferenceContext18.missingImplementation("NYI"); //$NON-NLS-1$
+				// similar to wildcard, but different queries for lower bound
+				if (subCandidate.kind() == Binding.INTERSECTION_TYPE) {
+					ReferenceBinding[] intersectingTypes = subCandidate.getIntersectingTypes();
+					if (intersectingTypes != null)
+						for (int i = 0; i < intersectingTypes.length; i++)
+							if (TypeBinding.equalsEquals(intersectingTypes[i], superCandidate))
+								return true;
+				}
+				if (superCandidate instanceof CaptureBinding) {
+					CaptureBinding capture = (CaptureBinding) superCandidate;
+					if (capture.lowerBound != null && (capture.firstBound == null || capture.firstBound.id == TypeIds.T_JavaLangObject))
+						return new ConstraintTypeFormula(subCandidate, capture.lowerBound, SUBTYPE, this.isSoft);
+				}
 				return FALSE;
 			case Binding.INTERSECTION_TYPE:
 				InferenceContext18.missingImplementation("NYI"); //$NON-NLS-1$
@@ -306,7 +319,7 @@
 		return null;
 	}
 
-	boolean addConstraintsFromTypeParamters(TypeBinding subCandidate, ParameterizedTypeBinding ca, List<ConstraintFormula> constraints) {
+	boolean addConstraintsFromTypeParameters(TypeBinding subCandidate, ParameterizedTypeBinding ca, List<ConstraintFormula> constraints) {
 		TypeBinding[] ai = ca.arguments;								// C<A1,A2,...>
 		if (ai == null)
 			return true; // no arguments here means nothing to check
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
index c85381a..905ac8b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
@@ -122,10 +122,10 @@
  *      18.5.2 finishes.</li>
  *    <li>If the inner poly expression is a functional expression or a conditional expression no inference variables
  *      exist representing the inner. In this case the final target type is pushed into the inner using
- *      {@link Expression#checkAgainstFinalTargetType(TypeBinding)}, which, too, is called from 
+ *      {@link Expression#checkAgainstFinalTargetType(TypeBinding, Scope)}, which, too, is called from 
  *      {@link #rebindInnerPolies(BoundSet, TypeBinding[])}.</li>
  *    <li>For recursively pushing target types into arguments of an invocation
- *    	method {@link ASTNode#resolvePolyExpressionArguments(Invocation, MethodBinding, TypeBinding[])} exists,
+ *    	method {@link ASTNode#resolvePolyExpressionArguments(Invocation, MethodBinding, TypeBinding[], Scope)} exists,
  *    	which is called in two situations: (1) for non-generic outer invocations from MessageSend#findMethodBinding() and
  *    	Statement#findConstructorBinding(); (2) for generic outer invocations from {@link #rebindInnerPolies(BoundSet, TypeBinding[])}.</li>
  *    <li>In some situations invocation arguments that are poly invocations need to be resolved in the middle of overload resolution
@@ -319,7 +319,7 @@
 		}
 		InferenceVariable[] newVariables = new InferenceVariable[len];
 		for (int i = 0; i < len; i++)
-			newVariables[i] = new InferenceVariable(typeVariables[i], this.variableCount++, this.currentInvocation, this.environment);
+			newVariables[i] = new InferenceVariable(typeVariables[i], this.variableCount++, this.currentInvocation, this.environment, this.object);
 		if (this.inferenceVariables == null || this.inferenceVariables.length == 0) {
 			this.inferenceVariables = newVariables;
 		} else {
@@ -339,7 +339,7 @@
 			if (typeVariables[i] instanceof InferenceVariable)
 				newVariables[i] = (InferenceVariable) typeVariables[i]; // prevent double substitution of an already-substituted inferenceVariable
 			else
-				newVariables[i] = new InferenceVariable(typeVariables[i], this.variableCount++, this.currentInvocation, this.environment);
+				newVariables[i] = new InferenceVariable(typeVariables[i], this.variableCount++, this.currentInvocation, this.environment, this.object);
 		}
 
 		int start = 0;
@@ -483,11 +483,12 @@
 			c.add(new ConstraintExceptionFormula((FunctionalExpression) expri, substF));
 		} else if (expri instanceof Invocation && expri.isPolyExpression()) {
 			Invocation invocation = (Invocation) expri;
-			MethodBinding innerMethod = invocation.binding(null);
+			MethodBinding innerMethod = invocation.binding(null, false, null);
 			if (innerMethod instanceof ParameterizedGenericMethodBinding) {
 				InferenceContext18 innerCtx = invocation.getInferenceContext((ParameterizedMethodBinding) innerMethod);
-				int innerKind = innerCtx != null ? innerCtx.inferenceKind : this.inferenceKind;
-				return addConstraintsToC(invocation.arguments(), c, innerMethod.genericMethod(), innerKind);
+				if (innerCtx != null) { // otherwise innerMethod does not participate in inference
+					return addConstraintsToC(invocation.arguments(), c, innerMethod.genericMethod(), innerCtx.inferenceKind);
+				}
 			}
 		} else if (expri instanceof ConditionalExpression) {
 			ConditionalExpression ce = (ConditionalExpression) expri;
@@ -1345,8 +1346,10 @@
 			Expression inner = (Expression) this.innerPolies.get(i);
 			if (inner instanceof Invocation) {
 				Invocation innerMessage = (Invocation) inner;
-				TypeBinding innerTargetType = getParameter(parameterTypes, i, isVarargs);
-				MethodBinding binding = innerMessage.binding(innerTargetType);
+				TypeBinding innerTargetType = inner.expectedType(); // may be set from acceptPendingPolyArguments
+				if (innerTargetType != null && !innerTargetType.isProperType(true))
+					innerTargetType = null;
+				MethodBinding binding = innerMessage.binding(innerTargetType, innerTargetType != null, this.scope);
 				if (binding == null)
 					continue;
 				MethodBinding original = binding.shallowOriginal();
@@ -1373,7 +1376,7 @@
 				ParameterizedGenericMethodBinding innerBinding = this.environment.createParameterizedGenericMethod(original, solutions);
 				
 				if (innerMessage.updateBindings(innerBinding, innerTargetType)) { // only if we are actually improving anything
-					ASTNode.resolvePolyExpressionArguments(innerMessage, innerBinding);
+					ASTNode.resolvePolyExpressionArguments(innerMessage, innerBinding, this.scope);
 				}
 			}
 		}
@@ -1388,11 +1391,10 @@
 			if (!targetType.isProperType(true))
 				targetType = Scope.substitute(substitution, targetType);
 			Expression expression = this.invocationArguments[i];
-			expression.checkAgainstFinalTargetType(targetType);
 			if (expression instanceof Invocation) {
 				Invocation invocation = (Invocation) expression;
 				if (!this.innerPolies.contains(invocation)) {
-					MethodBinding method = invocation.binding(targetType);
+					MethodBinding method = invocation.binding(targetType, true, this.scope);
 					if (method instanceof ParameterizedGenericMethodBinding) {
 						ParameterizedGenericMethodBinding previousBinding = (ParameterizedGenericMethodBinding) method;
 						InferenceContext18 innerCtx = invocation.getInferenceContext(previousBinding);
@@ -1404,11 +1406,15 @@
 								innerCtx.reportInvalidInvocation(invocation, innerBinding);
 							}
 							if (invocation.updateBindings(innerBinding, targetType)) { // only if we are actually improving anything
-								ASTNode.resolvePolyExpressionArguments(invocation, innerBinding);
+								ASTNode.resolvePolyExpressionArguments(invocation, innerBinding, this.scope);
 							}
 						}
 					}
+				} else {
+					expression.setExpectedType(targetType);
 				}
+			} else {
+				expression.checkAgainstFinalTargetType(targetType, this.scope);
 			}
 		}
 	}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java
index cfccb4d..fa91246 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java
@@ -26,16 +26,12 @@
 	InvocationSite site;
 	TypeBinding typeParameter;
 	
-	public InferenceVariable(TypeBinding typeParameter, int variableRank, InvocationSite site, LookupEnvironment environment) {
+	public InferenceVariable(TypeBinding typeParameter, int variableRank, InvocationSite site, LookupEnvironment environment, ReferenceBinding object) {
 		super(CharOperation.concat(typeParameter.shortReadableName(), Integer.toString(variableRank).toCharArray(), '#'), 
 				null/*declaringElement*/, variableRank, environment);
 		this.site = site;
 		this.typeParameter = typeParameter;
-	}
-
-	public InferenceVariable(int expressionRank, int variableRank, LookupEnvironment environment) {
-		super(CharOperation.concat("expr#".toCharArray(), Integer.toString(variableRank).toCharArray()), //$NON-NLS-1$
-				null/*declaringElement*/, variableRank, environment);
+		this.superclass = object;
 	}
 
 	public char[] constantPoolName() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionCastTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionCastTypeBinding.java
index aae9337..4f885c9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionCastTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionCastTypeBinding.java
@@ -43,21 +43,26 @@
 	}
 	
 	public MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcards) {
-		if (this.singleAbstractMethod != null)
-			return this.singleAbstractMethod;
+		int index = replaceWildcards ? 0 : 1;
+		if (this.singleAbstractMethod != null) {
+			if (this.singleAbstractMethod[index] != null)
+			return this.singleAbstractMethod[index];
+		} else {
+			this.singleAbstractMethod = new MethodBinding[2];
+		}
 		MethodBinding sam = samProblemBinding;  // guilty unless proven innocent !
 		for (int i = 0; i < this.length; i++) {
 			MethodBinding method = this.intersectingTypes[i].getSingleAbstractMethod(scope, replaceWildcards);
 			if (method != null) {
 				if (method.isValidBinding()) {
 					if (sam.isValidBinding())
-						return this.singleAbstractMethod = new ProblemMethodBinding(TypeConstants.ANONYMOUS_METHOD, null, ProblemReasons.IntersectionHasMultipleFunctionalInterfaces);
+						return this.singleAbstractMethod[index] = new ProblemMethodBinding(TypeConstants.ANONYMOUS_METHOD, null, ProblemReasons.IntersectionHasMultipleFunctionalInterfaces);
 					else
 						sam = method;
 				}
 			}
 		}
-		return this.singleAbstractMethod = sam; // I don't see a value in building the notional interface described in 9.8 - it appears just pedantic/normative - perhaps it plays a role in wildcard parameterized types ?
+		return this.singleAbstractMethod[index] = sam; // I don't see a value in building the notional interface described in 9.8 - it appears just pedantic/normative - perhaps it plays a role in wildcard parameterized types ?
 	}
 
 	public boolean hasTypeBit(int bit) { // Stephan ??
@@ -121,6 +126,12 @@
 		}
 		return this.intersectingTypes;
 	}
+	
+	@Override
+	public boolean isBoxedPrimitiveType() {
+		return this.intersectingTypes[0].isBoxedPrimitiveType();
+	}
+	
 	/* Answer true if the receiver type can be assigned to the argument type (right)
 	 */
 	public boolean isCompatibleWith(TypeBinding right, Scope scope) {
@@ -238,7 +249,7 @@
 		TypeBinding samType = null;
 		for (int i = 0, max = this.intersectingTypes.length; i < max; i++) {
 			TypeBinding typeBinding = this.intersectingTypes[i];
-			MethodBinding methodBinding = typeBinding.getSingleAbstractMethod(scope, false);
+			MethodBinding methodBinding = typeBinding.getSingleAbstractMethod(scope, true);
 			// Why doesn't getSingleAbstractMethod do as the javadoc says, and return null
 			// when it is not a SAM type
 			if (methodBinding instanceof ProblemMethodBinding && ((ProblemMethodBinding) methodBinding).problemId()==ProblemReasons.NoSuchSingleAbstractMethod) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
index a249f95..8ffe097 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
@@ -663,6 +663,8 @@
 			break;
 		case Binding.POLY_TYPE:
 			return ((PolyTypeBinding) type).computeBoxingType();
+		case Binding.INTERSECTION_CAST_TYPE:
+			return computeBoxingType(type.getIntersectingTypes()[0]);
 	}
 	return type;
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
index cb4c0ab..6e2ee2d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
@@ -35,9 +35,12 @@
  *								Bug 425156 - [1.8] Lambda as an argument is flagged with incompatible error
  *								Bug 426563 - [1.8] AIOOBE when method with error invoked with lambda expression as argument
  *								Bug 426792 - [1.8][inference][impl] generify new type inference engine
+ *								Bug 428294 - [1.8][compiler] Type mismatch: cannot convert from List<Object> to Collection<Object[]>
+ *								Bug 427199 - [1.8][resource] avoid resource leak warnings on Streams that have no resource
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.lookup;
 
+import java.util.Arrays;
 import java.util.List;
 import java.util.Set;
 
@@ -171,7 +174,11 @@
 		for (int i = 0; i < length; i++) {
 			TypeBinding argument = originalArguments[i];
 			if (argument.kind() == Binding.WILDCARD_TYPE) { // no capture for intersection types
-				capturedArguments[i] = new CaptureBinding((WildcardBinding) argument, contextType, position, scope.compilationUnitScope().nextCaptureID());
+				final WildcardBinding wildcard = (WildcardBinding) argument;
+				if (wildcard.boundKind == Wildcard.SUPER && wildcard.bound.id == TypeIds.T_JavaLangObject)
+					capturedArguments[i] = wildcard.bound;
+				else
+					capturedArguments[i] = new CaptureBinding(wildcard, contextType, position, scope.compilationUnitScope().nextCaptureID());
 			} else {
 				capturedArguments[i] = argument;
 			}
@@ -1367,6 +1374,9 @@
 	        ReferenceBinding genericSuperclass = this.type.superclass();
 	        if (genericSuperclass == null) return null; // e.g. interfaces
 		    this.superclass = (ReferenceBinding) Scope.substitute(this, genericSuperclass);
+			this.typeBits |= (this.superclass.typeBits & TypeIds.InheritableBits);
+			if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()! 
+				this.typeBits |= applyCloseableClassWhitelists();
 	    }
 		return this.superclass;
 	}
@@ -1376,9 +1386,16 @@
 	 */
 	public ReferenceBinding[] superInterfaces() {
 	    if (this.superInterfaces == null) {
-	    		if (this.type.isHierarchyBeingConnected())
-	    			return Binding.NO_SUPERINTERFACES; // prevent superinterfaces from being assigned before they are connected
-	    		this.superInterfaces = Scope.substitute(this, this.type.superInterfaces());
+    		if (this.type.isHierarchyBeingConnected())
+    			return Binding.NO_SUPERINTERFACES; // prevent superinterfaces from being assigned before they are connected
+    		this.superInterfaces = Scope.substitute(this, this.type.superInterfaces());
+    		if (this.superInterfaces != null) {
+	    		for (int i = this.superInterfaces.length; --i >= 0;) {
+	    			this.typeBits |= (this.superInterfaces[i].typeBits & TypeIds.InheritableBits);
+	    			if ((this.typeBits & (TypeIds.BitAutoCloseable|TypeIds.BitCloseable)) != 0) // avoid the side-effects of hasTypeBit()! 
+	    				this.typeBits |= applyCloseableInterfaceWhitelists();
+	    		}
+    		}
 	    }
 		return this.superInterfaces;
 	}
@@ -1517,22 +1534,26 @@
 		return this.fields;
 	}
 	public MethodBinding getSingleAbstractMethod(final Scope scope, boolean replaceWildcards) {
+		int index = replaceWildcards ? 0 : 1;
 		if (this.singleAbstractMethod != null) {
-			return this.singleAbstractMethod;
+			if (this.singleAbstractMethod[index] != null)
+			return this.singleAbstractMethod[index];
+		} else {
+			this.singleAbstractMethod = new MethodBinding[2];
 		}
 		if (!isValidBinding())
 			return null;
 		final ReferenceBinding genericType = genericType();
 		MethodBinding theAbstractMethod = genericType.getSingleAbstractMethod(scope, replaceWildcards);
 		if (theAbstractMethod == null || !theAbstractMethod.isValidBinding())
-			return this.singleAbstractMethod = theAbstractMethod;
+			return this.singleAbstractMethod[index] = theAbstractMethod;
 		
 		ParameterizedTypeBinding declaringType = null;
 		TypeBinding [] types = this.arguments; 
 		if (replaceWildcards) {
-			types = getNonWildcardParameterization();
+			types = getNonWildcardParameterization(scope);
 			if (types == null)
-				return this.singleAbstractMethod = new ProblemMethodBinding(TypeConstants.ANONYMOUS_METHOD, null, ProblemReasons.NotAWellFormedParameterizedType);
+				return this.singleAbstractMethod[index] = new ProblemMethodBinding(TypeConstants.ANONYMOUS_METHOD, null, ProblemReasons.NotAWellFormedParameterizedType);
 		} else if (types == null) {
 			types = NO_TYPES;
 		}
@@ -1540,21 +1561,21 @@
 		TypeVariableBinding [] typeParameters = genericType.typeVariables();
 		for (int i = 0, length = typeParameters.length; i < length; i++) {
 			if (typeParameters[i].boundCheck(declaringType, types[i], scope) != TypeConstants.OK)
-				return this.singleAbstractMethod = new ProblemMethodBinding(TypeConstants.ANONYMOUS_METHOD, null, ProblemReasons.NotAWellFormedParameterizedType);			
+				return this.singleAbstractMethod[index] = new ProblemMethodBinding(TypeConstants.ANONYMOUS_METHOD, null, ProblemReasons.NotAWellFormedParameterizedType);			
 		}
 		ReferenceBinding substitutedDeclaringType = (ReferenceBinding) declaringType.findSuperTypeOriginatingFrom(theAbstractMethod.declaringClass);
 		MethodBinding [] choices = substitutedDeclaringType.getMethods(theAbstractMethod.selector);
 		for (int i = 0, length = choices.length; i < length; i++) {
 			MethodBinding method = choices[i];
 			if (!method.isAbstract() || method.redeclaresPublicObjectMethod(scope)) continue; // (re)skip statics, defaults, public object methods ...
-			this.singleAbstractMethod = method;
+			this.singleAbstractMethod[index] = method;
 			break;
 		}
-		return this.singleAbstractMethod;
+		return this.singleAbstractMethod[index];
 	}
 
 	// from JLS 9.8
-	public TypeBinding[] getNonWildcardParameterization() {
+	public TypeBinding[] getNonWildcardParameterization(Scope scope) {
 		// precondition: isValidBinding()
 		TypeBinding[] typeArguments = this.arguments; 							// A1 ... An
 		if (typeArguments == null)
@@ -1576,29 +1597,32 @@
 						int len = 1 + (otherUBounds != null ? otherUBounds.length : 0) + otherBBounds.length;
 						if (typeParameters[i].firstBound != null)
 							len++;
-						ReferenceBinding[] allBounds = new ReferenceBinding[len];
-						try {
-							int idx = 0;
-							// Ui
-							allBounds[idx++] = (ReferenceBinding) wildcard.bound;
-							if (otherUBounds != null)
-								for (int j = 0; j < otherUBounds.length; j++)
-									allBounds[idx++] = (ReferenceBinding) otherUBounds[j];
-							// Bi
-							if (typeParameters[i].firstBound != null)
-								allBounds[idx++] = (ReferenceBinding) typeParameters[i].firstBound;
-							for (int j = 0; j < otherBBounds.length; j++)
-								allBounds[idx++] = (ReferenceBinding) otherBBounds[j];
-						} catch (ClassCastException cce) {
-							return null;
-						}
-						ReferenceBinding[] glb = Scope.greaterLowerBound(allBounds);
+						TypeBinding[] allBounds = new TypeBinding[len]; // TypeBinding so that in this round we accept ArrayBinding, too.
+						int idx = 0;
+						// Ui
+						allBounds[idx++] = wildcard.bound;
+						if (otherUBounds != null)
+							for (int j = 0; j < otherUBounds.length; j++)
+								allBounds[idx++] = otherUBounds[j];
+						// Bi
+						if (typeParameters[i].firstBound != null)
+							allBounds[idx++] = typeParameters[i].firstBound;
+						for (int j = 0; j < otherBBounds.length; j++)
+							allBounds[idx++] = otherBBounds[j];
+						TypeBinding[] glb = Scope.greaterLowerBound(allBounds, null, this.environment);
 						if (glb == null || glb.length == 0) {
 							return null;
 						} else if (glb.length == 1) {
 							types[i] = glb[0];
 						} else {
-							types[i] = new IntersectionCastTypeBinding(glb, this.environment);
+							try {
+								ReferenceBinding[] refs = new ReferenceBinding[glb.length];
+								System.arraycopy(glb, 0, refs, 0, glb.length); // TODO: if an array type plus more types get here, we get ArrayStoreException!
+								types[i] = new IntersectionCastTypeBinding(refs, this.environment);
+							} catch (ArrayStoreException ase) {
+								scope.problemReporter().genericInferenceError("Cannot compute glb of "+Arrays.toString(glb), null); //$NON-NLS-1$
+								return null;
+							}
 						}
 						break;
 					case Wildcard.SUPER :
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java
index 2fda46c..63faae8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java
@@ -196,13 +196,17 @@
 	}
 	
 	public MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcards) {
+		int index = replaceWildcards ? 0 : 1;
 		if (this.singleAbstractMethod != null) {
-			return this.singleAbstractMethod;
+			if (this.singleAbstractMethod[index] != null)
+			return this.singleAbstractMethod[index];
+		} else {
+			this.singleAbstractMethod = new MethodBinding[2];
 		}
 		final ReferenceBinding genericType = genericType();
 		MethodBinding theAbstractMethod = genericType.getSingleAbstractMethod(scope, replaceWildcards);
 		if (theAbstractMethod == null || !theAbstractMethod.isValidBinding())
-			return this.singleAbstractMethod = theAbstractMethod;
+			return this.singleAbstractMethod[index] = theAbstractMethod;
 		
 		ReferenceBinding declaringType = (ReferenceBinding) scope.environment().convertToRawType(genericType, true);
 		declaringType = (ReferenceBinding) declaringType.findSuperTypeOriginatingFrom(theAbstractMethod.declaringClass);
@@ -210,10 +214,10 @@
 		for (int i = 0, length = choices.length; i < length; i++) {
 			MethodBinding method = choices[i];
 			if (!method.isAbstract() || method.redeclaresPublicObjectMethod(scope)) continue; // (re)skip statics, defaults, public object methods ...
-			this.singleAbstractMethod = method;
+			this.singleAbstractMethod[index] = method;
 			break;
 		}
-		return this.singleAbstractMethod;
+		return this.singleAbstractMethod[index];
 	}
 	/**
 	 * @see org.eclipse.jdt.internal.compiler.lookup.Binding#readableName()
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
index f4109c5..207928f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
@@ -33,6 +33,7 @@
  *								Bug 423504 - [1.8] Implement "18.5.3 Functional Interface Parameterization Inference"
  *								Bug 426792 - [1.8][inference][impl] generify new type inference engine
  *								Bug 428019 - [1.8][compiler] Type inference failure with nested generic invocation.
+ *								Bug 427199 - [1.8][resource] avoid resource leak warnings on Streams that have no resource
  *      Jesper S Moller - Contributions for
  *								bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
  *								bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
@@ -119,7 +120,7 @@
 	private SimpleLookupTable compatibleCache;
 
 	int typeBits; // additional bits characterizing this type
-	protected MethodBinding singleAbstractMethod;
+	protected MethodBinding [] singleAbstractMethod;
 
 	public static final ReferenceBinding LUB_GENERIC = new ReferenceBinding() { /* used for lub computation */
 		{ this.id = TypeIds.T_undefined; }
@@ -2237,9 +2238,6 @@
 		return null;
 	return new ReferenceBinding[] {enclosingType};
 }
-public SyntheticArgumentBinding[] syntheticOuterLocalVariables() {
-	return null;		// is null if no enclosing instances are required
-}
 
 MethodBinding[] unResolvedMethods() { // for the MethodVerifier so it doesn't resolve types
 	return methods();
@@ -2253,7 +2251,7 @@
  * If a type - known to be a Closeable - is mentioned in one of our white lists
  * answer the typeBit for the white list (BitWrapperCloseable or BitResourceFreeCloseable).
  */
-protected int applyCloseableWhitelists() {
+protected int applyCloseableClassWhitelists() {
 	switch (this.compoundName.length) {
 		case 3:
 			if (CharOperation.equals(TypeConstants.JAVA, this.compoundName[0])) {
@@ -2295,6 +2293,20 @@
 	return 0;
 }
 
+/*
+ * If a type - known to be a Closeable - is mentioned in one of our white lists
+ * answer the typeBit for the white list (BitWrapperCloseable or BitResourceFreeCloseable).
+ */
+protected int applyCloseableInterfaceWhitelists() {
+	switch (this.compoundName.length) {
+		case 4:
+			if (CharOperation.equals(this.compoundName, TypeConstants.RESOURCE_FREE_CLOSEABLE_STREAM))
+				return TypeIds.BitResourceFreeCloseable;
+			break;
+	}
+	return 0;
+}
+
 //{ObjectTeams: support for checking substitution of a value parameter 
 public VariableBinding valueParamSynthArgAt(int typeParamPosition) {
 	SyntheticArgumentBinding[] args = valueParamSynthArgs();
@@ -2386,8 +2398,12 @@
 }
 public MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcards) {
 	
+	int index = replaceWildcards ? 0 : 1;
 	if (this.singleAbstractMethod != null) {
-		return this.singleAbstractMethod;
+		if (this.singleAbstractMethod[index] != null)
+		return this.singleAbstractMethod[index];
+	} else {
+		this.singleAbstractMethod = new MethodBinding[2];
 	}
 
 	if (this.compoundName != null)
@@ -2396,10 +2412,10 @@
 	try {
 		methods = getInterfaceAbstractContracts(scope);
 	} catch (InvalidInputException e) {
-		return this.singleAbstractMethod = samProblemBinding;
+		return this.singleAbstractMethod[index] = samProblemBinding;
 	}
 	if (methods != null && methods.length == 1)
-		return this.singleAbstractMethod = methods[0];
+		return this.singleAbstractMethod[index] = methods[0];
 	
 	final LookupEnvironment environment = scope.environment();
 	boolean genericMethodSeen = false;
@@ -2483,15 +2499,15 @@
 		if (exceptionsCount != exceptionsLength) {
 			System.arraycopy(exceptions, 0, exceptions = new ReferenceBinding[exceptionsCount], 0, exceptionsCount);
 		}
-		this.singleAbstractMethod = new MethodBinding(theAbstractMethod.modifiers, 
+		this.singleAbstractMethod[index] = new MethodBinding(theAbstractMethod.modifiers, 
 				theAbstractMethod.selector, 
 				theAbstractMethod.returnType, 
 				theAbstractMethod.parameters, 
 				exceptions, 
 				theAbstractMethod.declaringClass);
-	    this.singleAbstractMethod.typeVariables = theAbstractMethod.typeVariables;
-		return this.singleAbstractMethod;
+	    this.singleAbstractMethod[index].typeVariables = theAbstractMethod.typeVariables;
+		return this.singleAbstractMethod[index];
 	}
-	return this.singleAbstractMethod = samProblemBinding;
+	return this.singleAbstractMethod[index] = samProblemBinding;
 }
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index 116e0ed..5fe5bd1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -42,6 +42,8 @@
  *								Bug 427218 - [1.8][compiler] Verify error varargs + inference
  *								Bug 426836 - [1.8] special handling for return type in references to method getClass()?
  *								Bug 427628 - [1.8] regression : The method * is ambiguous for the type *
+ *								Bug 428352 - [1.8][compiler] Resolution errors don't always surface
+ *								Bug 428366 - [1.8] [compiler] The method valueAt(ObservableList<Object>, int) is ambiguous for the type Bindings
  *     Jesper S Moller - Contributions for
  *								Bug 378674 - "The method can be declared as static" is wrong
  *  							Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
@@ -60,6 +62,7 @@
 import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
 import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
 import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
+import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
 import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;
 import org.eclipse.jdt.internal.compiler.util.ObjectVector;
 import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
@@ -645,7 +648,8 @@
 					originalEnclosing = originalType.enclosingType();
 					substitutedEnclosing = originalEnclosing;
 					if (originalEnclosing != null) {
-						substitutedEnclosing = (ReferenceBinding) substitute(substitution, originalEnclosing);
+						substitutedEnclosing = (ReferenceBinding) (originalType.isStatic() ? substitution.environment().convertToRawType(originalEnclosing, true) : 
+																							(ReferenceBinding) substitute(substitution, originalEnclosing));
 						if (isMemberTypeOfRaw(originalType, substitutedEnclosing))
 							return substitution.environment().createRawType(originalReferenceType, substitutedEnclosing, originalType.getTypeAnnotations());
 					}
@@ -914,7 +918,7 @@
 			if (level != NOT_COMPATIBLE) {
 				return Math.max(compatible, level);
 			} else {
-				MethodBinding innerBinding = innerPoly.binding(null); // 1. try without update
+				MethodBinding innerBinding = innerPoly.binding(null, false, null); // 1. try without update
 				if (innerBinding instanceof ParameterizedGenericMethodBinding) {
 					ParameterizedGenericMethodBinding innerParameterized = (ParameterizedGenericMethodBinding) innerBinding;
 					InferenceContext18 infCtx18 = innerPoly.getInferenceContext(innerParameterized);
@@ -949,7 +953,7 @@
 						}
 					}
 				} else if (innerPoly instanceof AllocationExpression) {
-					MethodBinding updatedMethod = innerPoly.binding(targetType); // 2. try with updating
+					MethodBinding updatedMethod = innerPoly.binding(targetType, false, null); // 2. try with updating
 					if (updatedMethod != innerBinding && updatedMethod != null) {
 						if (updatedMethod.isValidBinding()) {
 						if (updatedMethod.declaringClass.isCompatibleWith(targetType))
@@ -1295,6 +1299,18 @@
 		}
 		return null; // may answer null if no method around
 	}
+	
+	public final MethodScope enclosingLambdaScope() {
+		Scope scope = this;
+		while ((scope = scope.parent) != null) {
+			if (scope instanceof MethodScope) {
+				MethodScope methodScope = (MethodScope) scope;
+				if (methodScope.referenceContext instanceof LambdaExpression) 
+					return methodScope;
+			}
+		}
+		return null; // may answer null if no method around
+	}
 
 	/* Answer the scope receiver type (could be parameterized)
 	*/
@@ -4778,6 +4794,7 @@
 				
 		// common part for all compliance levels:
 		int[] compatibilityLevels = new int[visibleSize];
+		int compatibleCount = 0;
 //{ObjectTeams: also record whether translation is required:
 		boolean[] useTranslation = new boolean[visibleSize];
 		Config oldConfig = Config.createOrResetConfig(this);
@@ -4790,7 +4807,13 @@
 				if (innerInferenceHelper != null)
 					argTypes = innerInferenceHelper.getArgumentTypesForCandidate(visible[i], argumentTypes);
 			}
-			compatibilityLevels[i] = parameterCompatibilityLevel(visible[i], argTypes);
+			if ((compatibilityLevels[i] = parameterCompatibilityLevel(visible[i], argTypes)) != NOT_COMPATIBLE) {
+				if (i != compatibleCount) {
+					visible[compatibleCount] = visible[i];
+					compatibilityLevels[compatibleCount] = compatibilityLevels[i];
+				}
+				compatibleCount++;
+			}
 // :giro
 			useTranslation[i] = Config.requireTypeAdjustment(); // TODO(SH): check kind of adjustment?
 		}
@@ -4798,6 +4821,20 @@
 		  Config.removeOrRestore(oldConfig, this);
 // SH}
 	  	}
+		if (compatibleCount != visibleSize) {
+			problemReporter().genericInferenceProblem("(Recovered) Internal inconsistency while checking invocation ambiguity", invocationSite, ProblemSeverities.Warning); //$NON-NLS-1$
+		}
+		if (compatibleCount == 0) {
+			return new ProblemMethodBinding(visible[0].selector, argumentTypes, ProblemReasons.NotFound);
+		} else if (compatibleCount == 1) {
+			MethodBinding candidate = inferInvocationType(invocationSite, visible[0], argumentTypes);
+			compilationUnitScope().recordTypeReferences(candidate.thrownExceptions);
+			return candidate;
+		}
+		if (compatibleCount != visibleSize) {
+			System.arraycopy(visible, 0, visible = new MethodBinding[visibleSize = compatibleCount], 0, compatibleCount);
+			System.arraycopy(compatibilityLevels, 0, compatibilityLevels = new int[compatibleCount], 0, compatibleCount);
+		}
 		MethodBinding[] moreSpecific = new MethodBinding[visibleSize];
 
 		if (isJdk18) {
@@ -5378,49 +5415,69 @@
 	   that could instead be invoked with identical results. Return null if no compatible, visible, most specific method
 	   could be found. This method is modeled after Scope.getConstructor and Scope.getMethod.
 	 */
-	public MethodBinding getStaticFactory (ReferenceBinding allocationType, ReferenceBinding originalEnclosingType, TypeBinding[] argumentTypes, final Invocation allocationSite) {
-		TypeVariableBinding[] classTypeVariables = allocationType.typeVariables();
-		int classTypeVariablesArity = classTypeVariables.length;
-		MethodBinding[] methods = allocationType.getMethods(TypeConstants.INIT, argumentTypes.length);
+	public MethodBinding getStaticFactory (ParameterizedTypeBinding allocationType, ReferenceBinding originalEnclosingType, TypeBinding[] argumentTypes, final Invocation allocationSite) {
+		
+		// allocationType is the diamond type. originalEnclosingType is the real enclosing type ==> may be parameterized, parameterized with own type variables, raw, just plain type or null.
+		int classTypeVariablesArity = 0;
+		TypeVariableBinding[] classTypeVariables = Binding.NO_TYPE_VARIABLES;
+		ReferenceBinding genericType = allocationType.genericType();
+		ReferenceBinding currentType = genericType;
+		while (currentType != null) {
+			TypeVariableBinding[] typeVariables = currentType.typeVariables();
+			int length = typeVariables == null ? 0 : typeVariables.length;
+			if (length > 0) {
+				System.arraycopy(classTypeVariables, 0, classTypeVariables = new TypeVariableBinding[classTypeVariablesArity + length], 0, classTypeVariablesArity);
+				System.arraycopy(typeVariables, 0, classTypeVariables, classTypeVariablesArity, length);
+				classTypeVariablesArity += length;
+			}	
+			if (currentType.isStatic()) // any enclosing types cannot be parameterized, if generic treat as raw.
+				break;
+			currentType = currentType.enclosingType();
+		}
+	
+		MethodBinding[] methods = genericType.getMethods(TypeConstants.INIT, argumentTypes.length);
 		MethodBinding [] staticFactories = new MethodBinding[methods.length];
 		int sfi = 0;
 		for (int i = 0, length = methods.length; i < length; i++) {
 			MethodBinding method = methods[i];
+			if (!method.canBeSeenBy(allocationSite, this))
+				continue;
+				
 			int paramLength = method.parameters.length;
 			boolean isVarArgs = method.isVarargs();
 			if (argumentTypes.length != paramLength)
 				if (!isVarArgs || argumentTypes.length < paramLength - 1)
 					continue; // incompatible
+			
 			TypeVariableBinding[] methodTypeVariables = method.typeVariables();
 			int methodTypeVariablesArity = methodTypeVariables.length;
-	        
-			MethodBinding staticFactory = new SyntheticFactoryMethodBinding(method, this.environment());
-			staticFactory.typeVariables = new TypeVariableBinding[classTypeVariablesArity + methodTypeVariablesArity];
-			final SimpleLookupTable map = new SimpleLookupTable(classTypeVariablesArity + methodTypeVariablesArity);
-			// Rename each type variable T of the type to T'
+			final int factoryArity = classTypeVariablesArity + methodTypeVariablesArity;
 			final LookupEnvironment environment = environment();
+			
+			MethodBinding staticFactory = new SyntheticFactoryMethodBinding(method, environment, originalEnclosingType);
+			staticFactory.typeVariables = new TypeVariableBinding[factoryArity];
+			final SimpleLookupTable map = new SimpleLookupTable(factoryArity);
+			
+			// Rename each type variable T of the type to T' or T'' or T''' based on the enclosing level to avoid a clash.
+			String prime = ""; //$NON-NLS-1$
+			Binding declaringElement = null;
 			for (int j = 0; j < classTypeVariablesArity; j++) {
-				map.put(classTypeVariables[j], staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(classTypeVariables[j].sourceName, "'".toCharArray()), //$NON-NLS-1$
+				TypeVariableBinding original;
+				original = classTypeVariables[j];
+				if (original.declaringElement != declaringElement) {
+					declaringElement = original.declaringElement;
+					prime += "'"; //$NON-NLS-1$
+				}
+				map.put(original, staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(original.sourceName, prime.toCharArray()),
 																			staticFactory, j, environment));
 			}
-			// Rename each type variable U of method U to U''.
-			for (int j = classTypeVariablesArity, max = classTypeVariablesArity + methodTypeVariablesArity; j < max; j++) {
-				map.put(methodTypeVariables[j - classTypeVariablesArity], 
-						(staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(methodTypeVariables[j - classTypeVariablesArity].sourceName, "''".toCharArray()), //$NON-NLS-1$
+			// Rename each type variable U of method
+			prime += "'"; //$NON-NLS-1$
+			for (int j = classTypeVariablesArity, k = 0; j < factoryArity; j++, k++) {
+				map.put(methodTypeVariables[k], 
+						(staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(methodTypeVariables[k].sourceName, prime.toCharArray()),
 																			staticFactory, j, environment)));
-			}
-			ReferenceBinding enclosingType = originalEnclosingType;
-			while (enclosingType != null) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=345968
-				if (enclosingType.kind() == Binding.PARAMETERIZED_TYPE) {
-					final ParameterizedTypeBinding parameterizedType = (ParameterizedTypeBinding) enclosingType;
-					final ReferenceBinding genericType = parameterizedType.genericType();
-					TypeVariableBinding[] enclosingClassTypeVariables = genericType.typeVariables();
-					int enclosingClassTypeVariablesArity = enclosingClassTypeVariables.length;
-					for (int j = 0; j < enclosingClassTypeVariablesArity; j++) {
-						map.put(enclosingClassTypeVariables[j], parameterizedType.arguments[j]);
-					}
-				}
-				enclosingType = enclosingType.enclosingType();
+
 			}
 			final Scope scope = this;
 			Substitution substitution = new Substitution() {
@@ -5443,46 +5500,38 @@
 				};
 
 			// initialize new variable bounds
-			for (int j = 0, max = classTypeVariablesArity + methodTypeVariablesArity; j < max; j++) {
+			for (int j = 0; j < factoryArity; j++) {
 				TypeVariableBinding originalVariable = j < classTypeVariablesArity ? classTypeVariables[j] : methodTypeVariables[j - classTypeVariablesArity];
-				TypeBinding substitutedType = (TypeBinding) map.get(originalVariable);
-				if (substitutedType instanceof TypeVariableBinding) {
-					TypeVariableBinding substitutedVariable = (TypeVariableBinding) substitutedType;
-					TypeBinding substitutedSuperclass = Scope.substitute(substitution, originalVariable.superclass);
-					ReferenceBinding[] substitutedInterfaces = Scope.substitute(substitution, originalVariable.superInterfaces);
-					if (originalVariable.firstBound != null) {
-						TypeBinding firstBound;
-						firstBound = TypeBinding.equalsEquals(originalVariable.firstBound, originalVariable.superclass)
-								? substitutedSuperclass // could be array type or interface
-										: substitutedInterfaces[0];
-						substitutedVariable.setFirstBound(firstBound);
-					}
-					switch (substitutedSuperclass.kind()) {
-						case Binding.ARRAY_TYPE :
+				TypeVariableBinding substitutedVariable = (TypeVariableBinding) map.get(originalVariable);
+				
+				TypeBinding substitutedSuperclass = Scope.substitute(substitution, originalVariable.superclass);
+				ReferenceBinding[] substitutedInterfaces = Scope.substitute(substitution, originalVariable.superInterfaces);
+				if (originalVariable.firstBound != null) {
+					TypeBinding firstBound;
+					firstBound = TypeBinding.equalsEquals(originalVariable.firstBound, originalVariable.superclass)
+							? substitutedSuperclass // could be array type or interface
+									: substitutedInterfaces[0];
+					substitutedVariable.setFirstBound(firstBound);
+				}
+				switch (substitutedSuperclass.kind()) {
+					case Binding.ARRAY_TYPE :
+						substitutedVariable.setSuperClass(environment.getResolvedType(TypeConstants.JAVA_LANG_OBJECT, null));
+						substitutedVariable.setSuperInterfaces(substitutedInterfaces);
+						break;
+					default:
+						if (substitutedSuperclass.isInterface()) {
 							substitutedVariable.setSuperClass(environment.getResolvedType(TypeConstants.JAVA_LANG_OBJECT, null));
+							int interfaceCount = substitutedInterfaces.length;
+							System.arraycopy(substitutedInterfaces, 0, substitutedInterfaces = new ReferenceBinding[interfaceCount+1], 1, interfaceCount);
+							substitutedInterfaces[0] = (ReferenceBinding) substitutedSuperclass;
 							substitutedVariable.setSuperInterfaces(substitutedInterfaces);
-							break;
-						default:
-							if (substitutedSuperclass.isInterface()) {
-								substitutedVariable.setSuperClass(environment.getResolvedType(TypeConstants.JAVA_LANG_OBJECT, null));
-								int interfaceCount = substitutedInterfaces.length;
-								System.arraycopy(substitutedInterfaces, 0, substitutedInterfaces = new ReferenceBinding[interfaceCount+1], 1, interfaceCount);
-								substitutedInterfaces[0] = (ReferenceBinding) substitutedSuperclass;
-								substitutedVariable.setSuperInterfaces(substitutedInterfaces);
-							} else {
-								substitutedVariable.setSuperClass((ReferenceBinding) substitutedSuperclass); // typeVar was extending other typeVar which got substituted with interface
-								substitutedVariable.setSuperInterfaces(substitutedInterfaces);
-							}
-					}
+						} else {
+							substitutedVariable.setSuperClass((ReferenceBinding) substitutedSuperclass); // typeVar was extending other typeVar which got substituted with interface
+							substitutedVariable.setSuperInterfaces(substitutedInterfaces);
+						}
 				}
 			}
-		    TypeVariableBinding[] returnTypeParameters = new TypeVariableBinding[classTypeVariablesArity];
-			for (int j = 0; j < classTypeVariablesArity; j++) {
-				returnTypeParameters[j] = (TypeVariableBinding) map.get(classTypeVariables[j]);
-			}
-			// make sure to use the original enclosing, so we don't loose the outer type information, which we already have
-			// (I saw unbound type variables from enclosing enter type inference, which cannot handle such 'alien' type variables).
-			staticFactory.returnType = environment.createParameterizedType(allocationType, returnTypeParameters, originalEnclosingType);
+			staticFactory.returnType = environment.createParameterizedType(genericType, Scope.substitute(substitution, genericType.typeVariables()), originalEnclosingType);
 			staticFactory.parameters = Scope.substitute(substitution, method.parameters);
 			staticFactory.thrownExceptions = Scope.substitute(substitution, method.thrownExceptions);
 			if (staticFactory.thrownExceptions == null) { 
@@ -5509,21 +5558,11 @@
 		if (compatibleIndex == 0) {
 			return null;
 		}
-		MethodBinding[] visible = new MethodBinding[compatibleIndex];
-		int visibleIndex = 0;
-		for (int i = 0; i < compatibleIndex; i++) {
-			MethodBinding method = compatible[i];
-			if (method.canBeSeenBy(allocationSite, this))
-				visible[visibleIndex++] = method;
-		}
-		if (visibleIndex == 0) {
-			return null;
-		}
-		if (visibleIndex == 1) {
+		if (compatibleIndex == 1) {
 			// 1.8: Give inference a chance to perform outstanding tasks (18.5.2):
-			visible[0] = inferInvocationType(allocationSite, visible[0], argumentTypes);
+			compatible[0] = inferInvocationType(allocationSite, compatible[0], argumentTypes);
 		}
-		return visibleIndex == 1 ? visible[0] : mostSpecificMethodBinding(visible, visibleIndex, argumentTypes, allocationSite, allocationType);
+		return compatibleIndex == 1 ? compatible[0] : mostSpecificMethodBinding(compatible, compatibleIndex, argumentTypes, allocationSite, allocationType);
 	}
 
 	public boolean validateNullAnnotation(long tagBits, TypeReference typeRef, Annotation[] annotations) {
@@ -5611,10 +5650,9 @@
 					return infCtx18.inferInvocationType(invocation, argumentTypes, parameterizedMethod);
 				}
 			} else {
-				ASTNode.resolvePolyExpressionArguments(invocation, applicable, argumentTypes);
+				ASTNode.resolvePolyExpressionArguments(invocation, applicable, argumentTypes, this);
 			}
 		}
 		return applicable;
 	}
-}
-
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
index 7866ebb..59464d0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -197,9 +197,6 @@
 	this.methods = Binding.UNINITIALIZED_METHODS;
 	this.prototype = this;
 	computeId();
-	if (this.isAnnotationType()) { // for forward references, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=419331
-		this.superInterfaces = new ReferenceBinding [] { scope.getJavaLangAnnotationAnnotation() };
-	}
 }
 
 public SourceTypeBinding(SourceTypeBinding prototype) {
@@ -3228,7 +3225,7 @@
 public ReferenceBinding[] superInterfaces() {
 	if (!isPrototype())
 		return this.superInterfaces = this.prototype.superInterfaces();
-	return this.superInterfaces;
+	return this.superInterfaces != null ? this.superInterfaces : isAnnotationType() ? this.superInterfaces = new ReferenceBinding [] { this.scope.getJavaLangAnnotationAnnotation() } : null;
 }
 
 public SyntheticMethodBinding[] syntheticMethods() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java
index 67155af..4b3a4a5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java
@@ -23,19 +23,20 @@
 
 	private MethodBinding staticFactoryFor;
 	private LookupEnvironment environment;
+	private ReferenceBinding enclosingType;
 	
-	public SyntheticFactoryMethodBinding(MethodBinding method, LookupEnvironment environment) {
+	public SyntheticFactoryMethodBinding(MethodBinding method, LookupEnvironment environment, ReferenceBinding enclosingType) {
 		super(method.modifiers | ClassFileConstants.AccStatic, TypeConstants.SYNTHETIC_STATIC_FACTORY,
 				null, null, null, method.declaringClass);
 		this.environment = environment;
 		this.staticFactoryFor = method;
+		this.enclosingType = enclosingType;
 	}
 	
 	/** Apply the given type arguments on the (declaring class of the) actual constructor being represented by this factory method. */
 	public ParameterizedMethodBinding applyTypeArgumentsOnConstructor(TypeBinding[] typeArguments) {
-		ReferenceBinding originalDeclaringClass = (ReferenceBinding) this.declaringClass.original();
-		ReferenceBinding parameterizedType = this.environment.createParameterizedType(originalDeclaringClass, typeArguments,
-																						originalDeclaringClass.enclosingType());
+		ReferenceBinding parameterizedType = this.environment.createParameterizedType(this.declaringClass, typeArguments,
+																						this.enclosingType);
 		for (MethodBinding parameterizedMethod : parameterizedType.methods()) {
 			if (parameterizedMethod.original() == this.staticFactoryFor)
 				return (ParameterizedMethodBinding) parameterizedMethod;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
index b45bd05..7368515 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
@@ -579,6 +579,24 @@
 	}
 }
 
+/* Answer true if the receiver is a boxed primitive type
+ */
+public boolean isBoxedPrimitiveType() {
+	switch (this.id) {
+		case TypeIds.T_JavaLangBoolean :
+		case TypeIds.T_JavaLangByte :
+		case TypeIds.T_JavaLangCharacter :
+		case TypeIds.T_JavaLangShort :
+		case TypeIds.T_JavaLangDouble :
+		case TypeIds.T_JavaLangFloat :
+		case TypeIds.T_JavaLangInteger :
+		case TypeIds.T_JavaLangLong :
+			return true;
+		default: 
+			return false;
+	}
+}
+
 /**
  *  Returns true if parameterized type AND not of the form List<?>
  */
@@ -1654,4 +1672,8 @@
 public ReferenceBinding[] superInterfaces() {
 	return Binding.NO_SUPERINTERFACES;
 }
+
+public SyntheticArgumentBinding[] syntheticOuterLocalVariables() {
+	return null;		// is null if no enclosing instances are required
+}
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
index 14e1c16..a808bfa 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
@@ -18,6 +18,7 @@
  *								bug 400421 - [compiler] Null analysis for fields does not take @com.google.inject.Inject into account
  *								bug 382069 - [null] Make the null analysis consider JUnit's assertNotNull similarly to assertions
  *								Bug 405569 - Resource leak check false positive when using DbUtils.closeQuietly
+ *								Bug 427199 - [1.8][resource] avoid resource leak warnings on Streams that have no resource
  *    Jesper S Moller - Contributions for
  *								Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
  *								Bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
@@ -173,6 +174,7 @@
 	char[][] JAVA_IO_IOEXCEPTION = new char[][] { JAVA, IO, "IOException".toCharArray()};//$NON-NLS-1$
 	char[][] JAVA_IO_OBJECTOUTPUTSTREAM = new char[][] { JAVA, IO, "ObjectOutputStream".toCharArray()}; //$NON-NLS-1$
 	char[][] JAVA_IO_OBJECTINPUTSTREAM = new char[][] { JAVA, IO, "ObjectInputStream".toCharArray()}; //$NON-NLS-1$
+	char[][] JAVA_NIO_FILE_FILES = new char[][] { JAVA, "nio".toCharArray(), "file".toCharArray(), "Files".toCharArray() };   //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
 	// javax.rmi.CORBA.Stub
 	char[][] JAVAX_RMI_CORBA_STUB = new char[][] {
 			JAVAX,
@@ -279,6 +281,9 @@
 		"CharArrayWriter".toCharArray(), //$NON-NLS-1$
 		"StringBufferInputStream".toCharArray(), //$NON-NLS-1$
 	};
+	char[][] RESOURCE_FREE_CLOSEABLE_STREAM = new char[][] {
+		JAVA, UTIL, "stream".toCharArray(), "Stream".toCharArray() //$NON-NLS-1$ //$NON-NLS-2$
+	};
 	
 	// different assertion utilities:
 	char[] ASSERT_CLASS = "Assert".toCharArray(); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java
index fdfc34c..36d8cc9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
@@ -152,7 +152,7 @@
 		return;
 
 	 boolean mandatory = (severity & (ProblemSeverities.Error | ProblemSeverities.Optional)) == ProblemSeverities.Error;
-	 if (this.policy.ignoreAllErrors()) { 
+	 if (severity < ProblemSeverities.InternalError && this.policy.ignoreAllErrors()) { 
 		 // Error is not to be exposed, but clients may need still notification as to whether there are silently-ignored-errors.
 		 if (mandatory)
 			 referenceContext.tagAsHavingIgnoredMandatoryErrors(problemId);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index aadded1..af75ef6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -49,6 +49,8 @@
  *								Bug 416307 - [1.8][compiler][null] subclass with type parameter substitution confuses null checking
  *								Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
  *								Bug 424637 - [1.8][compiler][null] AIOOB in ReferenceExpression.resolveType with a method reference to Files::walk
+ *								Bug 428294 - [1.8][compiler] Type mismatch: cannot convert from List<Object> to Collection<Object[]>
+ *								Bug 428366 - [1.8] [compiler] The method valueAt(ObservableList<Object>, int) is ambiguous for the type Bindings
  *      Jesper S Moller <jesper@selskabet.org> -  Contributions for
  *								bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
  *								bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
@@ -1765,7 +1767,8 @@
 			return ProblemSeverities.Warning;
 		case IProblem.IllegalUseOfUnderscoreAsAnIdentifier:
 			return this.underScoreIsLambdaParameter ? ProblemSeverities.Error : ProblemSeverities.Warning;
-		
+		case IProblem.LambdaShapeComputationError:
+			return ProblemSeverities.InternalError;
 	}
 	int irritant = getIrritant(problemID);
 	if (irritant != 0) {
@@ -14299,8 +14302,16 @@
 		annotation.sourceEnd);
 }
 public void genericInferenceError(String message, InvocationSite invocationSite) {
+	genericInferenceProblem(message, invocationSite, ProblemSeverities.Error);
+}
+public void genericInferenceProblem(String message, InvocationSite invocationSite, int severity) {
 	String[] args = new String[]{message};
-	this.handle( IProblem.GenericInferenceError, args, args, invocationSite.sourceStart(), invocationSite.sourceEnd());	
+	int start = 0, end = 0;
+	if (invocationSite != null) {
+		start = invocationSite.sourceStart();
+		end = invocationSite.sourceEnd();
+	}
+	this.handle(IProblem.GenericInferenceError, args, args, severity, start, end);	
 }
 public void uninternedIdentityComparison(EqualExpression expr, TypeBinding lhs, TypeBinding rhs, CompilationUnitDeclaration unit) {
 	
@@ -14341,4 +14352,13 @@
 			expr.sourceStart,
 			expr.sourceEnd);
 }
+
+public void lambdaShapeComputationError(LambdaExpression expression) {
+	this.handle(
+			IProblem.LambdaShapeComputationError,
+			NoArgument,
+			NoArgument,
+			expression.sourceStart,
+			expression.diagnosticsSourceEnd());
+}
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemSeverities.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemSeverities.java
index 069f70d..7cf7e78 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemSeverities.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemSeverities.java
@@ -1,9 +1,13 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
  * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
@@ -13,7 +17,6 @@
 
 public interface ProblemSeverities {
 
-	final int Ignore = 256; // during handling only
 	final int Warning = 0; // during handling only
 
 	final int Error = 1; // when bit is set: problem is error, if not it is a warning
@@ -25,8 +28,10 @@
 	final int Optional = 32; // when bit is set: problem was configurable
 	final int SecondaryError = 64;
 	final int Fatal = 128; // when bit is set: problem was either a mandatory error, or an optional+treatOptionalErrorAsFatal
+	final int Ignore = 256; // during handling only
+	final int InternalError = 512;  // always exposed, even when silent error handling policy is in effect.
 
 //{ObjectTeams: signal problem that should be ignored, but yet recorded to match potential @SuppressWarnings
-	final int IgnoredGenerated = 256;
+	final int IgnoredGenerated = 1024;
 // SH}
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
index d92bec2..13d5a83 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
@@ -837,7 +837,8 @@
 1057 = strictfp is not permitted for abstract interface method {0}
 1058 = Default methods are allowed only in interfaces with source level 1.8 or greater.
 
-1100 = Error detected during type inference: {0}
+1100 = Problem detected during type inference: {0}
+1101 = (Recovered) Internal inconsistency detected during lambda shape analysis
 
 ### ELABORATIONS
 ## Access restrictions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TSuperMessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TSuperMessageSend.java
index 1cbd5e9..a69652c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TSuperMessageSend.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/TSuperMessageSend.java
@@ -137,7 +137,7 @@
 	    	this.binding = scope.getMethod(tsuperRole, this.selector, argumentTypes, this);
 	    	if (!this.binding.isValidBinding() && ((ProblemMethodBinding)this.binding).declaringClass == null)
 	    		this.binding.declaringClass = (ReferenceBinding) tsuperRole;
-    		resolvePolyExpressionArguments(this, this.binding, argumentTypes);
+    		resolvePolyExpressionArguments(this, this.binding, argumentTypes, scope);
 	    	return;
 	    }
 	    // no qualification => search all tsupers by priority:
@@ -151,7 +151,7 @@
 	    			return;
 	    		}
 	    		this.binding = candidate;
-	    		resolvePolyExpressionArguments(this, this.binding, argumentTypes);
+	    		resolvePolyExpressionArguments(this, this.binding, argumentTypes, scope);
 	    		return;
 	    	}
 	    	if (bestMatch == null || 
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
index 165ea62..82ed848 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
@@ -1069,7 +1069,10 @@
 /* orig:
 		name.internalSetIdentifier(new String(argument.name));
   :giro */
-//jsv} Original:
+//jsv}
+		if (argument instanceof Receiver) {
+			name.setFlags(name.getFlags() | ASTNode.MALFORMED);
+		}
 		int start = argument.sourceStart;
 		int nameEnd = argument.sourceEnd;
 		name.setSourceRange(start, nameEnd - start + 1);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ClassInstanceCreation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ClassInstanceCreation.java
index 3d74fe8..62f874a 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ClassInstanceCreation.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ClassInstanceCreation.java
@@ -1,10 +1,14 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -31,20 +35,7 @@
  * simple, qualified, or parameterized type.
  * </p>
  * <p>
- * A type like "A.B" can be represented either of two ways:
- * <ol>
- * <li>
- * <code>QualifiedType(SimpleType(SimpleName("A")),SimpleName("B"))</code>
- * </li>
- * <li>
- * <code>SimpleType(QualifiedName(SimpleName("A"),SimpleName("B")))</code>
- * </li>
- * </ol>
- * The first form is preferred when "A" is known to be a type (as opposed
- * to a package). However, a parser cannot always determine this. Clients
- * should be prepared to handle either rather than make assumptions.
- * (Note also that the first form became possible as of JLS3; only the second
- * form existed in JLS2.)
+ * {@link QualifiedType} discusses typical representations of qualified type references.
  * </p>
  *
  * @since 2.0
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java
index 598d40d..5f9adb7 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java
@@ -307,6 +307,21 @@
 	 * @since 3.1
 	 */
 	public ITypeBinding getErasure();
+	
+	/**
+	 * Returns the single abstract method that constitutes the single function 
+	 * contract (aside from any redeclarations of methods of <code>java.lang.Object</code>) 
+	 * of the receiver interface type or null if there no such contract or if the receiver 
+	 * is not an interface. 
+	 * 
+	 * @return the single abstract method that represents the single function contract 
+	 * (aside from any redeclarations of methods of <code>java.lang.Object</code>) of 
+	 * this interface type or null if the receiver is not an interface or if the receiver 
+	 * has more than one abstract method or no abstract methods.
+	 *
+	 * @since 3.9 BETA_JAVA8
+	 */
+	public IMethodBinding getFunctionalInterfaceMethod();
 
 	/**
 	 * Returns a list of type bindings representing the direct superinterfaces
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java
index 3cd217e..f45f695 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java
@@ -208,6 +208,14 @@
 	}
 
 	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.core.dom.ITypeBinding#getFunctionalInterfaceMethod
+	 */
+	@Override
+	public IMethodBinding getFunctionalInterfaceMethod() {
+		return null;
+	}
+	
+	/* (non-Javadoc)
 	 * @see org.eclipse.jdt.core.dom.ITypeBinding#getInterfaces()
 	 */
 	public ITypeBinding[] getInterfaces() {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java
index 5af26e6..83ebab5 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java
@@ -544,6 +544,20 @@
 	public ITypeBinding getErasure() {
 		return this.resolver.getTypeBinding(this.binding.erasure());
 	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.core.dom.ITypeBinding#getFunctionalInterfaceMethod
+	 */
+	@Override
+	public IMethodBinding getFunctionalInterfaceMethod() {
+		Scope scope = this.resolver.scope();
+		if (this.binding == null || scope == null)
+			return null;
+		MethodBinding sam = this.binding.getSingleAbstractMethod(scope, true);
+		if (sam == null || !sam.isValidBinding())
+			return null;
+		return this.resolver.getMethodBinding(sam);
+	}
 
 	public synchronized ITypeBinding[] getInterfaces() {
 		if (this.prototype != null) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
index 59e605f..20b7d96 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
@@ -302,7 +302,7 @@
 				case ASTNode.PRIMITIVE_TYPE:
 				case ASTNode.QUALIFIED_TYPE:
 				case ASTNode.SIMPLE_TYPE:
-					prefix= "void m("; //$NON-NLS-1$
+					prefix= "void m(final "; //$NON-NLS-1$
 					suffix= " x);"; //$NON-NLS-1$
 					code= CodeFormatter.K_CLASS_BODY_DECLARATIONS;
 					break;
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
index 7cef2c9..97ce8ec 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
@@ -222,7 +222,7 @@
 		return this.resolvedType;
 	}
 	if (isDiamond) {
-		TypeBinding [] inferredTypes = inferElidedTypes(((ParameterizedTypeBinding) this.resolvedType).genericType(), null, argumentTypes, scope);
+		TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, null, argumentTypes, scope);
 		if (inferredTypes == null) {
 			scope.problemReporter().cannotInferElidedTypes(this);
 			return this.resolvedType = null;
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java
index 49b1eb6..b9a93d7 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java
@@ -2658,7 +2658,7 @@
 		return 0;
 	}
 
-		private void skipPastTypeAnnotations() {  // we get here having seen @
+	private void skipPastTypeAnnotations() {  // we get here having seen @
 		int balance = 0;
 		int currentTokenStartPosition = this.localScanner.currentPosition;
 		try {
@@ -2708,6 +2708,42 @@
 		return false;
 	}
 
+	private boolean hasNonAnnotationModifiers() {
+		this.localScanner.resetTo(this.scribe.scanner.currentPosition, this.scribe.scannerEndPosition - 1);
+		try {
+			int token;
+			while ((token = this.localScanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
+				switch(token) {
+					case TerminalTokens.TokenNamedefault :
+					case TerminalTokens.TokenNamepublic :
+					case TerminalTokens.TokenNameprotected :
+					case TerminalTokens.TokenNameprivate :
+					case TerminalTokens.TokenNamestatic :
+					case TerminalTokens.TokenNameabstract :
+					case TerminalTokens.TokenNamefinal :
+					case TerminalTokens.TokenNamenative :
+					case TerminalTokens.TokenNamesynchronized :
+					case TerminalTokens.TokenNametransient :
+					case TerminalTokens.TokenNamevolatile :
+					case TerminalTokens.TokenNamestrictfp :
+						return true;
+					case TerminalTokens.TokenNameAT :
+						skipPastTypeAnnotations();
+						break;
+					case TerminalTokens.TokenNameCOMMENT_BLOCK :
+					case TerminalTokens.TokenNameCOMMENT_JAVADOC :
+					case TerminalTokens.TokenNameCOMMENT_LINE :
+						break;
+					default:
+						return false;
+				}
+			}
+		} catch(InvalidInputException e) {
+			// ignore
+		}
+		return false;
+	}
+	
 	private boolean isNextToken(int tokenName) {
 		this.localScanner.resetTo(this.scribe.scanner.currentPosition, this.scribe.scannerEndPosition - 1);
 		try {
@@ -2989,7 +3025,7 @@
 
 		if (argument.modifiers != NO_MODIFIERS || argument.annotations != null) {
 	        this.scribe.printComment();
-			this.scribe.printModifiers(argument.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_PARAMETER);
+			this.scribe.printModifiers(argument.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_PARAMETER, !hasNonAnnotationModifiers());
 			this.scribe.space();
 		}
 
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java
index f9bd678..f0d29e4 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java
@@ -4541,11 +4541,11 @@
 		}
     }
 
-	public void printModifiers(Annotation[] annotations, ASTVisitor visitor) {
-		printModifiers(annotations, visitor, ICodeFormatterConstants.ANNOTATION_UNSPECIFIED);
+	public void printModifiers(Annotation[] annotations, ASTVisitor visitor, int annotationSourceKind) {
+		printModifiers(annotations, visitor, annotationSourceKind, false);
 	}
 
-	public void printModifiers(Annotation[] annotations, ASTVisitor visitor, int annotationSourceKind) {
+	public void printModifiers(Annotation[] annotations, ASTVisitor visitor, int annotationSourceKind, boolean firstIsTypeAnnotation) {
 		try {
 			int annotationsLength = annotations != null ? annotations.length : 0;
 			int annotationsIndex = 0;
@@ -4553,7 +4553,7 @@
 			int currentTokenStartPosition = this.scanner.currentPosition;
 			boolean hasComment = false;
 			boolean hasModifiers = false;
-			boolean foundNonAnnotModifiers = false;
+			boolean treatNextAsTypeAnnotation = firstIsTypeAnnotation;
 			while ((this.currentToken = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
 				int foundTaskCount = this.scanner.foundTaskCount;
 				int tokenStartPosition = this.scanner.getCurrentTokenStartPosition();
@@ -4576,7 +4576,7 @@
 				    case TerminalTokens.TokenNamecallin :
 //carp}						
 						hasModifiers = true;
-						foundNonAnnotModifiers = true;
+						treatNextAsTypeAnnotation = true;
 						print(this.scanner.currentPosition - this.scanner.startPosition, !isFirstModifier);
 						isFirstModifier = false;
 						currentTokenStartPosition = this.scanner.currentPosition;
@@ -4600,34 +4600,34 @@
 							boolean shouldAddNewLine = false;
 							switch (annotationSourceKind) {
 								case ICodeFormatterConstants.ANNOTATION_ON_TYPE :
-									if (this.formatter.preferences.insert_new_line_after_annotation_on_type) {
-										shouldAddNewLine = foundNonAnnotModifiers ? this.formatter.preferences.insert_new_line_after_type_annotation : true;
-									}
+									shouldAddNewLine = treatNextAsTypeAnnotation
+											? this.formatter.preferences.insert_new_line_after_type_annotation
+											: this.formatter.preferences.insert_new_line_after_annotation_on_type;
 									break;
 								case ICodeFormatterConstants.ANNOTATION_ON_FIELD :
-									if (this.formatter.preferences.insert_new_line_after_annotation_on_field) {
-										shouldAddNewLine = foundNonAnnotModifiers ? this.formatter.preferences.insert_new_line_after_type_annotation : true;
-									}
+									shouldAddNewLine = treatNextAsTypeAnnotation
+											? this.formatter.preferences.insert_new_line_after_type_annotation
+											: this.formatter.preferences.insert_new_line_after_annotation_on_field;
 									break;
 								case ICodeFormatterConstants.ANNOTATION_ON_METHOD :
-									if (this.formatter.preferences.insert_new_line_after_annotation_on_method) {
-										shouldAddNewLine = foundNonAnnotModifiers ? this.formatter.preferences.insert_new_line_after_type_annotation : true;
-									}
+									shouldAddNewLine = treatNextAsTypeAnnotation
+											? this.formatter.preferences.insert_new_line_after_type_annotation
+											: this.formatter.preferences.insert_new_line_after_annotation_on_method;
 									break;
 								case ICodeFormatterConstants.ANNOTATION_ON_PACKAGE :
-									if (this.formatter.preferences.insert_new_line_after_annotation_on_package) {
-										shouldAddNewLine = foundNonAnnotModifiers ? this.formatter.preferences.insert_new_line_after_type_annotation : true;
-									}
+									shouldAddNewLine = treatNextAsTypeAnnotation
+											? this.formatter.preferences.insert_new_line_after_type_annotation
+											: this.formatter.preferences.insert_new_line_after_annotation_on_package;
 									break;
 								case ICodeFormatterConstants.ANNOTATION_ON_PARAMETER :
-									if (this.formatter.preferences.insert_new_line_after_annotation_on_parameter) {
-										shouldAddNewLine = foundNonAnnotModifiers ? this.formatter.preferences.insert_new_line_after_type_annotation : true;
-									}
+									shouldAddNewLine = treatNextAsTypeAnnotation
+											? this.formatter.preferences.insert_new_line_after_type_annotation
+											: this.formatter.preferences.insert_new_line_after_annotation_on_parameter;
 									break;
 								case ICodeFormatterConstants.ANNOTATION_ON_LOCAL_VARIABLE :
-									if (this.formatter.preferences.insert_new_line_after_annotation_on_local_variable) {
-										shouldAddNewLine = foundNonAnnotModifiers ? this.formatter.preferences.insert_new_line_after_type_annotation : true;
-									}
+									shouldAddNewLine = treatNextAsTypeAnnotation
+											? this.formatter.preferences.insert_new_line_after_type_annotation
+											: this.formatter.preferences.insert_new_line_after_annotation_on_local_variable;
 									break;
 								default:
 									// do nothing when no annotation formatting option specified