Update jdt.core up-to 5d9ab3c35b604994d7f3bd7c1c70c17649f1325e towards
2.3 SR1
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 397dde4..cb2558b 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
@@ -28,6 +28,7 @@
  *								Bug 434570 - Generic type mismatch for parametrized class annotation attribute with inner class
  *								Bug 434044 - Java 8 generics thinks single method is ambiguous
  *								Bug 434793 - [1.8][null][compiler] AIOOBE in ParameterizedGenericMethodBinding.substitute when inlining a method
+ *								Bug 438337 - StackOverflow after update from Kepler to Luna 
  *******************************************************************************/
 package org.eclipse.jdt.core.tests.compiler.regression;
 
@@ -5351,5 +5352,49 @@
 			"}\n"
 		});
 }
+public void testBug438337comment5() {
+	runConformTest(
+		new String[] {
+			"Test.java",
+			"public class Test {\n" +
+			"	void test() {\n" +
+			"		I18nResource<?> i18nResource = null;\n" +
+			"	}\n" +
+			"}\n",
+			"I18nResource.java",
+			"public interface I18nResource<E extends Internationalized<? extends I18nResource<E>>> extends BusinessObject {}\n",
+			"Internationalized.java",
+			"public interface Internationalized<E extends I18nResource<? extends Internationalized<E>>>\n" + 
+			"    extends BusinessObject {}\n",
+			"BusinessObject.java",
+			"public interface BusinessObject {}\n"
+		});
+}
+public void testBug438337comment3() {
+	runConformTest(
+		new String[] {
+			"PermissionDrivenPresenter.java",
+			"public abstract class PermissionDrivenPresenter<V extends BaseView<? extends Presenter<V>>> extends BasePresenter<V> {\n" + 
+			"\n" + 
+			"    public void updatePermissions() {\n" + 
+			"        getView().setReadOnly(true);\n" + 
+			"    }\n" + 
+			"}\n",
+			"View.java",
+			"public interface View<P extends Presenter<? extends View<P>>> { }\n",
+			"Presenter.java",
+			"public interface Presenter<V extends View<? extends Presenter<V>>> { }\n",
+			"BaseView.java",
+			"public abstract class BaseView<P extends Presenter<? extends View<P>>> implements View<P> {\n" +
+			"	void setReadOnly(boolean f) {}\n" +
+			"}\n",
+			"BasePresenter.java",
+			"public abstract class BasePresenter<V extends View<? extends Presenter<V>>> implements Presenter<V> {\n" + 
+			"    public V getView() {\n" + 
+			"        return null;\n" + 
+			"    }\n" + 
+			"}\n"
+		});
+}
 }
 
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
index 825a1ed..3ba56cf 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
@@ -14,8 +14,15 @@
  *******************************************************************************/
 package org.eclipse.jdt.core.tests.compiler.regression;
 
+import java.io.File;
 import java.util.Map;
 
+import org.eclipse.jdt.core.ToolFactory;
+import org.eclipse.jdt.core.tests.util.Util;
+import org.eclipse.jdt.core.util.IAttributeNamesConstants;
+import org.eclipse.jdt.core.util.IClassFileAttribute;
+import org.eclipse.jdt.core.util.IClassFileReader;
+import org.eclipse.jdt.core.util.IMethodInfo;
 import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
 
 import junit.framework.Test;
@@ -4434,6 +4441,115 @@
 			"}"
 	});
 }
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=436542 : Eclipse 4.4 compiler generates "bad class file" according to javac
+public void test436542() throws Exception {
+	String jreDirectory = Util.getJREDirectory();
+	String jfxJar = Util.toNativePath(jreDirectory + "/lib/ext/jfxrt.jar");
+	this.runConformTest(
+		new String[] {
+			"Utility.java",
+			"import java.util.Collection;\n" + 
+			"import java.util.List;\n" + 
+			"import java.util.function.Function;\n" + 
+			"import java.util.stream.Collectors;\n" + 
+			"import javafx.collections.ListChangeListener;\n" + 
+			"import javafx.collections.ObservableList;\n" + 
+			"public class Utility {\n" + 
+			"	public static void main(String[] args) {\n" + 
+			"		System.out.println(\"Success\");\n" + 
+			"	}\n" + 
+			"    public static <T, R> List<R> mapList(Collection<T> original, Function<T, R> func) {\n" + 
+			"        return original.stream().map(func).collect(Collectors.toList());\n" + 
+			"    }\n" + 
+			"    /**\n" + 
+			"     * \"Binds\" the destination list to the observable source list with a transformation function applied.\n" + 
+			"     * Whenever the source list changes, the destination list is altered to match by applying\n" + 
+			"     * the given function to each element in the source list.\n" + 
+			"     */\n" + 
+			"    public static <S, T> void bindMap(List<T> dest, ObservableList<S> src, Function<S, T> func) {\n" + 
+			"        dest.clear();\n" + 
+			"        dest.addAll(mapList(src, func));\n" + 
+			"        src.addListener((ListChangeListener<S>) changes -> {\n" + 
+			"            while (changes.next()) {\n" + 
+			"                if (changes.wasPermutated() || changes.wasUpdated()) {\n" + 
+			"                    // Same code for updated, replaced and permutation, just recalc the range:\n" + 
+			"                    for (int i = changes.getFrom(); i < changes.getTo(); i++)\n" + 
+			"                        dest.set(i, func.apply(src.get(i)));\n" + 
+			"                } else {\n" + 
+			"                    for (int i = 0; i < changes.getRemovedSize(); i++)\n" + 
+			"                        dest.remove(changes.getFrom());\n" + 
+			"                    for (int i = 0; i < changes.getAddedSubList().size();i++)\n" + 
+			"                        dest.add(i + changes.getFrom(), func.apply(changes.getAddedSubList().get(i)));\n" + 
+			"                }\n" + 
+			"            }\n" + 
+			"        });\n" + 
+			"    }\n" + 
+			"}",
+		},
+		"Success",
+		Util.concatWithClassLibs(new String[]{jfxJar,OUTPUT_DIR}, false),
+		true,
+		null);
+	IClassFileReader classFileReader = ToolFactory.createDefaultClassFileReader(OUTPUT_DIR + File.separator + "Utility.class", IClassFileReader.ALL);
+	IMethodInfo lambdaMethod = null;
+	IMethodInfo[] methodInfos = classFileReader.getMethodInfos();
+	int length = methodInfos.length;
+	for (int i = 0; i < length; i++) {
+		IMethodInfo methodInfo = methodInfos[i];
+		if ("lambda$0".equals(new String(methodInfo.getName()))) {
+			lambdaMethod = methodInfo;
+			break;
+		}
+	}
+	assertNotNull("Could not find lambda method",lambdaMethod);
+	IClassFileAttribute signature = org.eclipse.jdt.internal.core.util.Util.getAttribute(lambdaMethod, IAttributeNamesConstants.SIGNATURE);
+	assertNull("Found generic signature for lambda method", signature);
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=440152 [codegen]"Missing code implementation in the compiler" on cascaded inner class references
+public void test440152() {
+	this.runConformTest(
+		new String[] {
+			"Foo.java",
+			"import java.util.function.Function;\n" + 
+			"interface Foo {void alpha(Bar pBar);}\n" + 
+			"class Bar {Object bravo() {return null;}}\n" + 
+			"class Test {\n" + 
+			"  Test(Function pFunction) {\n" + 
+			"    class Baz {public Baz(Object pObj) {pFunction.apply(pObj);}}\n" + 
+			"    delta(pBar -> charlie(new Baz(pBar.bravo())));\n" + 
+			"  }\n" + 
+			"  void charlie(Object pRemovals) {}\n" + 
+			"  void delta(Foo pListener) {}\n" + 
+			"}"
+	});
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=440152 [codegen]"Missing code implementation in the compiler" on cascaded inner class references
+public void test440152a() {
+	this.runConformTest(
+		new String[] {
+			"Foo.java",
+			"import java.util.function.Function;\n" + 
+			"interface Foo {void alpha(Bar pBar);}\n" + 
+			"class Bar {Object bravo() {return null;}}\n" + 
+			"class Test {\n" + 
+			"	Test(Function pFunction) {\n" + 
+			"	    class Baz {\n" + 
+			"	    	public Baz(Object pObj) {\n" + 
+			"	    	}\n" + 
+			"	    	class NestedBaz extends Baz {\n" + 
+			"	    		NestedBaz(Object pObj) {\n" + 
+			"	    			super(pObj);\n" + 
+			"	    			pFunction.apply(pObj);\n" + 
+			"	    		}\n" + 
+			"	    	}\n" + 
+			"	    	}\n" + 
+			"	    delta(pBar -> charlie(new Baz(pBar).new NestedBaz(pBar.bravo())));\n" + 
+			"	  }\n" + 
+			"	  void charlie(Object pRemovals) {}\n" + 
+			"	  void delta(Foo pListener) {}\n" + 
+			"}\n"
+	});
+}
 public static Class testClass() {
 	return LambdaExpressionsTest.class;
 }
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 1350e28..94f1d61 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
@@ -8,6 +8,7 @@
  * Contributors:
  *        Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
  *                          Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
+ *                          Bug 439889 - [1.8][compiler] [lambda] Deserializing lambda fails with IllegalArgumentException: "Invalid lambda deserialization"
  *******************************************************************************/
 package org.eclipse.jdt.core.tests.compiler.regression;
 
@@ -1234,6 +1235,85 @@
 				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=439889 - [1.8][compiler] [lambda] Deserializing lambda fails with IllegalArgumentException: "Invalid lambda deserialization"
+	public void test439889() throws Exception {
+		this.runConformTest(
+				new String[]{
+					"SerializationTest.java",
+					"import java.io.*;\n"+
+					"\n"+
+					"public class SerializationTest implements Serializable {\n"+
+					"	interface SerializableRunnable extends Runnable, Serializable {\n"+
+					"	}\n"+
+					"\n"+
+					"	SerializableRunnable runnable;\n"+
+					"\n"+
+					"	public SerializationTest() {\n"+
+					"		final SerializationTest self = this;\n"+
+					"		// runnable = () -> self.doSomething();\n"+
+					"		runnable = () -> this.doSomething();\n"+ // results in this method handle: #166 invokespecial SerializationTest.lambda$0:()V
+					"       }\n"+
+					"\n"+
+					"	public void doSomething() {\n"+
+					"		System.out.println(\"Hello,world!\");\n"+
+					"	}\n"+
+					"\n"+
+					"	public static void main(String[] args) throws Exception {\n"+
+					"		final ByteArrayOutputStream buffer = new ByteArrayOutputStream();\n"+
+					"		try (ObjectOutputStream out = new ObjectOutputStream(buffer) ) {\n"+
+					"			out.writeObject(new SerializationTest());\n"+
+					"		}\n"+
+					"		try (ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray()))) {\n"+
+					"			final SerializationTest s = (SerializationTest) in.readObject();\n"+
+					"			s.doSomething();\n"+
+					"		}\n"+
+					"	}\n"+
+					"}\n"
+					},
+					"Hello,world!",
+					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 test439889_2() throws Exception {
+		this.runConformTest(
+				new String[]{
+					"SerializationTest.java",
+					"import java.io.*;\n"+
+					"\n"+
+					"public class SerializationTest implements Serializable {\n"+
+					"	interface SerializableRunnable extends Runnable, Serializable {\n"+
+					"	}\n"+
+					"\n"+
+					"	SerializableRunnable runnable;\n"+
+					"\n"+
+					"	public SerializationTest() {\n"+
+					"		final SerializationTest self = this;\n"+
+					"		runnable = () -> self.doSomething();\n"+ // results in this method handle: #168 invokestatic SerializationTest.lambda$0:(LSerializationTest;)V
+					"		// runnable = () -> this.doSomething();\n"+
+					"       }\n"+
+					"\n"+
+					"	public void doSomething() {\n"+
+					"		System.out.println(\"Hello,world!\");\n"+
+					"	}\n"+
+					"\n"+
+					"	public static void main(String[] args) throws Exception {\n"+
+					"		final ByteArrayOutputStream buffer = new ByteArrayOutputStream();\n"+
+					"		try (ObjectOutputStream out = new ObjectOutputStream(buffer) ) {\n"+
+					"			out.writeObject(new SerializationTest());\n"+
+					"		}\n"+
+					"		try (ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray()))) {\n"+
+					"			final SerializationTest s = (SerializationTest) in.readObject();\n"+
+					"			s.doSomething();\n"+
+					"		}\n"+
+					"	}\n"+
+					"}\n"
+					},
+					"Hello,world!",
+					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.
+	}
 	// ---
 	
 	private void checkExpected(String expected, String actual) {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java
index 9b5fabe..2ccbd6d 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java
@@ -4469,6 +4469,89 @@
 			this.resultCollector,
 			null);
 }
+/**
+ * @bug 432541:  Stack Overflow in Java Search - type inference issue?
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=432541"
+ */
+public void testBug432541() throws CoreException {
+this.workingCopies = new ICompilationUnit[8];
+this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Constants.java",
+		"final class Constants {\n" +
+		"    static final String BUG_NAME =  \"BUG 432541\";\n" +
+		"}\n"	
+	);
+this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/Constants.java",
+		"package test;\n" +
+		"public class Constants { public static final String ANY_NAMESPACE_ANY = \"UNRELATED\";}"
+		);
+this.workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/Context.java",
+		"package test;\n" +
+		"public abstract class Context <  DESCRIPTOR extends Descriptor<?, ?>> {}"
+		);
+this.workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/CoreObjectBuilder.java",
+		"package test;\n" +
+		"public abstract class CoreObjectBuilder {}\n"
+		);
+this.workingCopies[4] = getWorkingCopy("/JavaSearchBugs/src/Descriptor.java",
+		"package test;\n" +
+		"\n" +
+		"public interface Descriptor <UNMARSHAL_RECORD extends UnmarshalRecord, OBJECT_BUILDER extends CoreObjectBuilder> {\n" +
+		"	public default OBJECT_BUILDER getObjectBuilder() { return null; }\n" +
+		"}\n"
+		);
+this.workingCopies[5] = getWorkingCopy("/JavaSearchBugs/src/Unmarshaller.java",
+		"package test;\n" +
+		"\n" +
+		"public abstract class Unmarshaller<CONTEXT extends Context, DESCRIPTOR extends Descriptor> {\n" +
+		"   public CONTEXT getContext() {\n" +
+		"	   return null;\n" +
+		"   }\n" +
+		"}\n"
+		);
+this.workingCopies[6] = getWorkingCopy("/JavaSearchBugs/src/UnmarshalRecord.java",
+		"package test;\n" +
+		"\n" +
+		"public interface UnmarshalRecord<UNMARSHALLER extends Unmarshaller> {\n" +
+		"    public UNMARSHALLER getUnmarshaller();\n" +
+		"    public default void setAttrs() {}\n" +
+		"}\n"
+		);
+this.workingCopies[7] = getWorkingCopy("/JavaSearchBugs/src/XMLRelationshipMappingNodeValue.java",
+		"package test;\n" +
+		"interface CMap<UNMARSHALLER extends Unmarshaller> {\n" +
+		"    Object convertToValue( UNMARSHALLER unmarshaller);\n" +
+		"}\n" +
+		"public abstract class XMLRelationshipMappingNodeValue {\n" +
+		"	public void processChild(Descriptor xmlDescriptor, UnmarshalRecord unmarshalRecord) {\n" +
+		"		if (Constants.ANY_NAMESPACE_ANY.toCharArray().length > 0) {\n" +
+		"			Descriptor d1 = (Descriptor) xmlDescriptor.getObjectBuilder();\n" +
+		"		}\n" +
+		"	}\n" +
+		"	protected Descriptor findReferenceDescriptor(UnmarshalRecord unmarshalRecord, Descriptor descriptor) {\n" +
+		"		if (Constants.ANY_NAMESPACE_ANY.toCharArray().length > 0) {\n" +
+		"			Context xmlContext = unmarshalRecord.getUnmarshaller().getContext();			\n" +
+		"		}\n" +
+		"		return null;\n" +
+		"	}\n" +
+		"	\n" +
+		"	protected void endElementProcessText(UnmarshalRecord unmarshalRecord, CMap converter) {\n" +
+		"		if (Constants.ANY_NAMESPACE_ANY.toCharArray().length > 0) {\n" +
+		"			converter.convertToValue(unmarshalRecord.getUnmarshaller());\n" +
+		"		}\n" +
+		"	}\n" +
+		"}\n"
+		);
+SearchPattern pattern = SearchPattern.createPattern(
+		"Constants",
+		TYPE,
+		REFERENCES,
+		EXACT_RULE);
+new SearchEngine(this.workingCopies).search(pattern,
+new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
+getJavaSearchWorkingCopiesScope(),
+this.resultCollector,
+null);
+}
 // Add new tests in JavaSearchBugs8Tests
 }
 
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 d1f1ac4..fa9b241 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
@@ -338,7 +338,7 @@
 
 	// perform some emulation work in case there is some and we are inside a local type only
 	if (allocatedTypeErasure.isNestedType()
-		&& currentScope.enclosingSourceType().isLocalType()) {
+		&& (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaScope())) {
 
 		if (allocatedTypeErasure.isLocalType()) {
 			((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, false);
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 9fcca2c..ec4e015 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
@@ -333,9 +333,6 @@
 					}
 				}
 
-				TypeBinding leafType = parameterType.leafComponentType();
-				if (leafType instanceof ReferenceBinding && (((ReferenceBinding) leafType).modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0)
-					this.binding.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
 				newParameters[i] = argument.bind(this.scope, parameterType, false);				
 				if (argument.annotations != null) {
 					this.binding.tagBits |= TagBits.HasParameterAnnotations;
@@ -371,7 +368,6 @@
 			if ((exception.tagBits & TagBits.HasMissingType) != 0) {
 				this.binding.tagBits |= TagBits.HasMissingType;
 			}
-			this.binding.modifiers |= (exception.modifiers & ExtraCompilerModifiers.AccGenericSignature);
 		}
 		
 		TypeBinding returnType = this.binding.returnType;
@@ -379,9 +375,6 @@
 			if ((returnType.tagBits & TagBits.HasMissingType) != 0) {
 				this.binding.tagBits |= TagBits.HasMissingType;
 			}
-			TypeBinding leafType = returnType.leafComponentType();
-			if (leafType instanceof ReferenceBinding && (((ReferenceBinding) leafType).modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0)
-				this.binding.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
 		} // TODO (stephan): else? (can that happen?)
 
 		if (haveDescriptor && !buggyArguments && blockScope.compilerOptions().isAnnotationBasedNullAnalysisEnabled) {
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 a2ab15d..9e7c2a0 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
@@ -333,7 +333,7 @@
 
 		// perform some extra emulation work in case there is some and we are inside a local type only
 		if (allocatedTypeErasure.isNestedType()
-			&& currentScope.enclosingSourceType().isLocalType()) {
+			&& (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaScope())) {
 
 			if (allocatedTypeErasure.isLocalType()) {
 				((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, this.enclosingInstance != null);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
index a09369d..bcd345f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
@@ -14,6 +14,7 @@
  *							Bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
  *     Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
  *                          Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
+ *                          Bug 439889 - [1.8][compiler] [lambda] Deserializing lambda fails with IllegalArgumentException: "Invalid lambda deserialization"
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.codegen;
 
@@ -786,6 +787,7 @@
 			isInterface ? binding.isStatic() ? MethodHandleRefKindInvokeStatic : binding.isPrivate() ? MethodHandleRefKindInvokeSpecial : MethodHandleRefKindInvokeInterface
 			: binding.isConstructor() ? MethodHandleRefKindNewInvokeSpecial
 			: binding.isStatic() ? MethodHandleRefKindInvokeStatic
+			: binding.isPrivate() ? MethodHandleRefKindInvokeSpecial
 			: MethodHandleRefKindInvokeVirtual;
 		
 		return literalIndexForMethodHandle(referenceKind, binding.declaringClass, binding.selector, binding.signature(), isInterface);
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 8c7f6fe..1fcc839 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
@@ -1892,6 +1892,12 @@
 //pre: null annotation analysis is enabled
 private void scanFieldForNullAnnotation(IBinaryField field, FieldBinding fieldBinding, boolean isEnum) {
 	if (!isPrototype()) throw new IllegalStateException();
+
+	if (isEnum && (field.getModifiers() & ClassFileConstants.AccEnum) != 0) {
+		fieldBinding.tagBits |= TagBits.AnnotationNonNull;
+		return; // we know it's nonnull, no need to look for null *annotations* on enum constants.
+	}
+
 	if (this.environment.globalOptions.sourceLevel >= ClassFileConstants.JDK1_8) {
 		TypeBinding fieldType = fieldBinding.type;
 		if (fieldType != null
@@ -1935,11 +1941,6 @@
 	if (!explicitNullness && (this.tagBits & TagBits.AnnotationNonNullByDefault) != 0) {
 		fieldBinding.tagBits |= TagBits.AnnotationNonNull;
 	}
-	if (isEnum) {
-		if ((field.getModifiers() & ClassFileConstants.AccEnum) != 0) {
-			fieldBinding.tagBits |= TagBits.AnnotationNonNull;
-		}
-	}
 }
 
 private void scanMethodForNullAnnotation(IBinaryMethod method, MethodBinding methodBinding) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java
index a64e7eb..c3c30a2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java
@@ -11,7 +11,6 @@
  *     Stephan Herrmann - Contribution for
  *								Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
  *								Bug 429384 - [1.8][null] implement conformance rules for null-annotated lower / upper type bounds
- *								Bug 434044 - Java 8 generics thinks single method is ambiguous
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.lookup;
 
@@ -198,14 +197,8 @@
 					} else {
 						int length = substitutedVariableInterfaces.length;
 						System.arraycopy(substitutedVariableInterfaces, 0, substitutedVariableInterfaces = new ReferenceBinding[length+1], 1, length);
-						// to properly support glb, perform capture *after* glb, so restart from the original bound:
-						substitutedVariableInterfaces[0] =  (ReferenceBinding) originalWildcardBound;
-						ReferenceBinding[] glb = Scope.greaterLowerBound(substitutedVariableInterfaces);
-						if (glb != null) {
-							for (int i = 0; i < glb.length; i++)
-								glb[i] = (ReferenceBinding) glb[i].capture(scope, this.position);
-						}
-						this.setSuperInterfaces(glb);
+						substitutedVariableInterfaces[0] =  (ReferenceBinding) capturedWildcardBound;
+						this.setSuperInterfaces(Scope.greaterLowerBound(substitutedVariableInterfaces));
 					}
 				} else {
 					// the wildcard bound should be a subtype of variable superclass
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 9be376c..ccc979a 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
@@ -228,6 +228,9 @@
 		}
 		return this.singleAbstractMethod[index];
 	}
+	public boolean mentionsAny(TypeBinding[] parameters, int idx) {
+		return false;
+	}
 	/**
 	 * @see org.eclipse.jdt.internal.compiler.lookup.Binding#readableName()
 	 */
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java
index ef9484c..2a40a44 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java
@@ -961,14 +961,21 @@
 	}
 	@Override
 	public boolean mentionsAny(TypeBinding[] parameters, int idx) {
-		if (super.mentionsAny(parameters, idx))
-			return true;
-		if (this.bound != null && 	this.bound.mentionsAny(parameters, -1))
-			return true;
-		if (this.otherBounds != null) {
-			for (int i = 0, length = this.otherBounds.length; i < length; i++)
-				if (this.otherBounds[i].mentionsAny(parameters, -1))
-					return true;
+		if (this.inRecursiveFunction)
+			return false;
+		this.inRecursiveFunction = true;
+		try {
+			if (super.mentionsAny(parameters, idx))
+				return true;
+			if (this.bound != null && 	this.bound.mentionsAny(parameters, -1))
+				return true;
+			if (this.otherBounds != null) {
+				for (int i = 0, length = this.otherBounds.length; i < length; i++)
+					if (this.otherBounds[i].mentionsAny(parameters, -1))
+						return true;
+			}
+		} finally {
+			this.inRecursiveFunction = false;
 		}
 		return false;
 	}