Merge commit '235aac64377cb73110d833cb8180126955618b6e' into
OT_BETA_JAVA8

Conflicts:
	features/org.eclipse.objectteams.otdt.core.patch/feature.xml
	org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
	org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
	org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java
	org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
	org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
	org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
	org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java
	org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java
	org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
	org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
	org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
	org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
	org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
	releng/build-scripts/build/otdt_prerequisites.sh
	releng/build-scripts/build/run.properties
diff --git a/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
index a8844a0..ad496df 100644
--- a/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
@@ -3,11 +3,11 @@
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.core.tests.compiler;singleton:=true
 Bundle-Version: 3.9.0
-Bundle-ClassPath: jdtcoretestscompiler.jar
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.jdt.core.tests.compiler.parser,
  org.eclipse.jdt.core.tests.compiler.regression,
+ org.eclipse.jdt.core.tests.dom,
  org.eclipse.jdt.core.tests.eval,
  org.eclipse.jdt.core.tests.eval.target,
  org.eclipse.jdt.core.tests.junit.extension,
diff --git a/org.eclipse.jdt.core.tests.compiler/build.properties b/org.eclipse.jdt.core.tests.compiler/build.properties
index 2f28c52..4ee1654 100644
--- a/org.eclipse.jdt.core.tests.compiler/build.properties
+++ b/org.eclipse.jdt.core.tests.compiler/build.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2012 IBM Corporation and others.
+# Copyright (c) 2000, 2013 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
@@ -7,13 +7,14 @@
 #
 # Contributors:
 #     IBM Corporation - initial API and implementation
+#     Red Hat Inc. (mistria) - Avoid nested jars
 ###############################################################################
 bin.includes = test.xml,\
                about.html,\
-               jdtcoretestscompiler.jar,\
+               .,\
                META-INF/,\
                plugin.properties,\
                workspace/
-source.jdtcoretestscompiler.jar = src/
-output.jdtcoretestscompiler.jar = bin/
+source.. = src/
+output.. = bin/
 src.includes = about.html
diff --git a/org.eclipse.jdt.core.tests.compiler/pom.xml b/org.eclipse.jdt.core.tests.compiler/pom.xml
index 91236e9..2b0f25b 100644
--- a/org.eclipse.jdt.core.tests.compiler/pom.xml
+++ b/org.eclipse.jdt.core.tests.compiler/pom.xml
@@ -5,9 +5,10 @@
   are made available under the terms of the Eclipse Distribution License v1.0
   which accompanies this distribution, and is available at
   http://www.eclipse.org/org/documents/edl-v10.php
- 
+
   Contributors:
      Igor Fedorenko - initial implementation
+     Mickael Istria (Red Hat Inc.) - 416912: tycho-surefire-plugin configuration
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
@@ -21,9 +22,25 @@
   <artifactId>org.eclipse.jdt.core.tests.compiler</artifactId>
   <version>3.8.3-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
-  
+
   <properties>
     <defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
   </properties>
 
+  <build>
+  	<plugins>
+  		<plugin>
+  			<groupId>org.eclipse.tycho</groupId>
+	  		<artifactId>tycho-surefire-plugin</artifactId>
+	  		<version>${tycho.version}</version>
+	  		<configuration>
+	  			<includes>
+	  				<include>org/eclipse/jdt/core/tests/compiler/parser/TestAll.class</include>
+	  				<include>org/eclipse/jdt/core/tests/compiler/regression/TestAll.class</include>
+	  			</includes>
+	  		</configuration>
+  		</plugin>
+  	</plugins>
+  </build>
+
 </project>
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
index d98c878..04eb986 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
@@ -4795,7 +4795,7 @@
     		"1. ERROR in X.java (at line 3)\n" +
     		"	@interface Bar {\n" +
     		"	           ^^^\n" +
-    		"The member annotation Bar can only be defined inside a top-level class or interface\n" +
+    		"The member annotation Bar can only be defined inside a top-level class or interface or in a static context\n" +
     		"----------\n");
     }
 
@@ -11006,4 +11006,44 @@
 		"Syntax error, modifiers are not allowed here\n" + 
 		"----------\n");
 }
+// Bug 416107 - Incomplete error message for member interface and annotation
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=416107
+public void test416107a() {
+    this.runNegativeTest(
+        new String[] {
+            "X.java",
+			"public class X {\n" +
+			"	class Y {\n" +
+			"		 @interface Bar {\n" +
+			"			public String bar = \"BUG\";\n" +
+			"		}\n" +
+			"	}\n" +
+			"}",
+        },
+        "----------\n" +
+		"1. ERROR in X.java (at line 3)\n" +
+		"	@interface Bar {\n" +
+		"	           ^^^\n" +
+		"The member annotation Bar can only be defined inside a top-level class or interface or in a static context\n" +
+		"----------\n");
+}
+public void test416107b() {
+	runNegativeTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" +
+			"	class Y {\n" +
+			"		interface Bar {\n" +
+			"			public String bar = \"BUG\";\n" +
+			"		}\n" +
+			"	}\n" +
+			"}",
+		},
+		"----------\n" +
+		"1. ERROR in X.java (at line 3)\n" +
+		"	interface Bar {\n" +
+		"	          ^^^\n" +
+		"The member interface Bar can only be defined inside a top-level class or interface or in a static context\n" +
+		"----------\n");
+}
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
index a0f96f5..6424775 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
@@ -2038,6 +2038,7 @@
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unclosedCloseable\" value=\"warning\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock\" value=\"ignore\"/>\n" + 
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unhandledWarningToken\" value=\"warning\"/>\n" + 
+			"		<option key=\"org.eclipse.jdt.core.compiler.problem.uninternedIdentityComparison\" value=\"disabled\"/>\n" +
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unnecessaryElse\" value=\"ignore\"/>\n" +
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck\" value=\"ignore\"/>\n" +
 			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess\" value=\"ignore\"/>\n" +
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 3ff512a..86d3359 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
@@ -1013,6 +1013,7 @@
 		expectedProblemAttributes.put("UninitializedLocalVariableHintMissingDefault", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
 		expectedProblemAttributes.put("UninitializedNonNullField", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM));
 		expectedProblemAttributes.put("UninitializedNonNullFieldHintMissingDefault", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM));
+		expectedProblemAttributes.put("UninternedIdentityComparison", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
 		expectedProblemAttributes.put("UnmatchedBracket", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
 		expectedProblemAttributes.put("UnnecessaryArgumentCast", DEPRECATED);
 		expectedProblemAttributes.put("UnnecessaryCast", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE));
@@ -1904,6 +1905,7 @@
 		expectedProblemAttributes.put("UninitializedLocalVariableHintMissingDefault", SKIP);
 		expectedProblemAttributes.put("UninitializedNonNullField", SKIP);
 		expectedProblemAttributes.put("UninitializedNonNullFieldHintMissingDefault", SKIP);
+		expectedProblemAttributes.put("UninternedIdentityComparison", SKIP);
 		expectedProblemAttributes.put("UnmatchedBracket", SKIP);
 		expectedProblemAttributes.put("UnnecessaryArgumentCast", SKIP);
 		expectedProblemAttributes.put("UnnecessaryCast", new ProblemAttributes(JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK));
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java
index ed6a69d..6181a8f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java
@@ -2557,7 +2557,7 @@
 		"1. ERROR in X.java (at line 3)\n" +
 		"	enum E {}\n" +
 		"	     ^\n" +
-		"The member enum E can only be defined inside a top-level class or interface\n" +
+		"The member enum E can only be defined inside a top-level class or interface or in a static context\n" +
 		"----------\n");
 }
 
@@ -2603,7 +2603,7 @@
 		"1. ERROR in X.java (at line 4)\n" +
 		"	enum E {}\n" +
 		"	     ^\n" +
-		"The member enum E can only be defined inside a top-level class or interface\n" +
+		"The member enum E can only be defined inside a top-level class or interface or in a static context\n" +
 		"----------\n");
 }
 
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java
index 97e02af..e521892 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java
@@ -2639,6 +2639,67 @@
 			}, 
 			"");
 }
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=415997
+// Bug 415997 - java.lang.VerifyError: Expecting a stackmap frame at branch target 
+public void testBug415997a() {
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" +
+			"	public static void main(String[] args) {\n" +
+			"		Object o = null;\n" +
+			"		if (o == null)\n" +
+			"			if (true)\n" +
+			"				return;\n" +
+			"	}\n" +
+			"}"
+		},
+		"");
+}
+public void testBug415997b() {
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" +
+			"	public static void main(String[] args) {\n" +
+			"		Object o = null;\n" +
+			"		if (o == null) {}\n" +
+			"		else\n" +
+			"			if (true)\n" +
+			"				return;\n" +
+			"	}\n" +
+			"}"
+		},
+		"");
+}
+public void testBug415997c() {
+	this.runConformTest(
+		new String[] {
+			"X.java",
+			"public class X {\n" +
+			"	public static void main(String[] args) throws Exception {\n" +
+			"		System.out.println(ParseExpr11());\n" +
+			"	}\n" +
+			"	static final public Object ParseExpr11() throws Exception {\n" +
+			"		Object expr;\n" +
+			"		Object op = null;\n" +
+			"		expr = ParseVarExpr();\n" +
+			"		if (op == null) {\n" +
+			"			if (true)\n" +
+			"				return expr;\n" +
+			"		}\n" +
+			"		{\n" +
+			"			throw new Exception(\"++/-- not supported in TUD Bantam Java.\");\n" +
+			"		}\n" +
+			"	}\n" +
+			"	private static Object ParseVarExpr() {\n" +
+			"		// TODO Auto-generated method stub\n" +
+			"		return \"test\";\n" +
+			"	}\n" +
+			"}"
+		},
+		"test");
+}
 public static Class testClass() {
 	return FlowAnalysisTest.class;
 }
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
index 70dfd1e..f05cace 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java
@@ -6629,6 +6629,22 @@
 		"Missing cannot be resolved to a type\n" + 
 		"----------\n");
 }
+//duplicate of bug 416267
+public void testBug418843() {
+	runNegativeTestWithLibs(
+		new String[] {
+			"TestEnum.java",
+			"public enum TestEnum {\n" + 
+			"	TestEntry(1){};\n" + 
+			"}"
+		},
+		"----------\n" + 
+		"1. ERROR in TestEnum.java (at line 2)\n" + 
+		"	TestEntry(1){};\n" + 
+		"	^^^^^^^^^\n" + 
+		"The constructor TestEnum(int) is undefined\n" + 
+		"----------\n");
+}
 public void testBug418235() {
     runNegativeTestWithLibs(
             new String[] {
diff --git a/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
index 3ced8ea..6e45bdd 100644
--- a/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.core.tests.model;singleton:=true
 Bundle-Version: 3.9.0
-Bundle-ClassPath: jdtcoretestsmodel.jar
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.jdt.core.tests,
diff --git a/org.eclipse.jdt.core.tests.model/build.properties b/org.eclipse.jdt.core.tests.model/build.properties
index 06adb5c..0ec24cd 100644
--- a/org.eclipse.jdt.core.tests.model/build.properties
+++ b/org.eclipse.jdt.core.tests.model/build.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
+# Copyright (c) 2000, 2013 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
@@ -7,15 +7,16 @@
 #
 # Contributors:
 #     IBM Corporation - initial API and implementation
+#     Red Hat Inc. (mistria) - Avoid nested jars
 ###############################################################################
 bin.includes = plugin.xml,\
                plugin.properties,\
                test.xml,\
                about.html,\
-               jdtcoretestsmodel.jar,\
+               .,\
                JCL/,\
                workspace/,\
                META-INF/
 src.includes = about.html
-source.jdtcoretestsmodel.jar = src/
-output.jdtcoretestsmodel.jar = bin/
+source.. = src/
+output.. = bin/
diff --git a/org.eclipse.jdt.core.tests.model/pom.xml b/org.eclipse.jdt.core.tests.model/pom.xml
index dc316e9..1a47e89 100644
--- a/org.eclipse.jdt.core.tests.model/pom.xml
+++ b/org.eclipse.jdt.core.tests.model/pom.xml
@@ -5,9 +5,10 @@
   are made available under the terms of the Eclipse Distribution License v1.0
   which accompanies this distribution, and is available at
   http://www.eclipse.org/org/documents/edl-v10.php
- 
+
   Contributors:
      Igor Fedorenko - initial implementation
+     Mickael Istria (Red Hat Inc.) - 416912: tycho-surefire-plugin configuration
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
@@ -36,6 +37,18 @@
           <timestampProvider>default</timestampProvider>
         </configuration>
       </plugin>
+      <plugin>
+      	<groupId>org.eclipse.tycho</groupId>
+      	<artifactId>tycho-surefire-plugin</artifactId>
+      	<version>${tycho.version}</version>
+      	<configuration>
+      	  <includes>
+      	  	<include>org/eclipse/jdt/core/tests/model/AllJavaModelTests.class</include>
+      	  	<include>org/eclipse/jdt/core/tests/dom/RunAllTests.class</include>
+      	  	<include>org/eclipse/jdt/core/tests/RunFormatterTests.class</include>
+      	  </includes>
+      	</configuration>
+      </plugin>
     </plugins>
   </build>
 </project>
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java
index 4befb19..bbcdcfb 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java
@@ -4751,7 +4751,7 @@
     	assertNotNull("No node", node);
     	assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
     	CompilationUnit compilationUnit = (CompilationUnit) node;
-        final String expectedErrors = "The member enum E can only be defined inside a top-level class or interface";
+        final String expectedErrors = "The member enum E can only be defined inside a top-level class or interface or in a static context";
     	assertProblemsSize(compilationUnit, 1, expectedErrors);
 		node = getASTNode(compilationUnit, 0, 0, 0);
    		assertEquals("Not a type declaration statement", ASTNode.TYPE_DECLARATION_STATEMENT, node.getNodeType());
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java
index 9b7c30a..a08fd78 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java
@@ -4761,7 +4761,7 @@
     	assertNotNull("No node", node);
     	assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
     	CompilationUnit compilationUnit = (CompilationUnit) node;
-        final String expectedErrors = "The member enum E can only be defined inside a top-level class or interface";
+        final String expectedErrors = "The member enum E can only be defined inside a top-level class or interface or in a static context";
     	assertProblemsSize(compilationUnit, 1, expectedErrors);
 		node = getASTNode(compilationUnit, 0, 0, 0);
    		assertEquals("Not a type declaration statement", ASTNode.TYPE_DECLARATION_STATEMENT, node.getNodeType());
@@ -11570,4 +11570,4 @@
 		assertTrue(type.isQualifiedType());
 		assertTrue(isMalformed(type));
 	}
-}
\ No newline at end of file
+}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java
index 21e2810..6db0e52 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 2012 GK Software AG and others.
+ * Copyright (c) 2011, 2013 GK Software AG and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -516,4 +516,58 @@
     		deleteProject("P");
     	}
 	}
+	
+	// see https://bugs.eclipse.org/418233
+	public void testNonNullDefaultInInner()  throws CoreException, IOException, InterruptedException  {
+		IJavaProject project15 = null;
+		try {
+			project15 = createJavaProject("TestAnnot", new String[] {"src"}, new String[] {"JCL15_LIB", this.ANNOTATION_LIB}, "bin", "1.5");
+			createFolder("/TestAnnot/src/p1");
+			createFile(
+					"/TestAnnot/src/p1/Interfaces.java",
+					"package p1;\n" +
+					"import org.eclipse.jdt.annotation.*;\n" + 
+					"\n" + 
+					"@NonNullByDefault\n" + 
+					"public interface Interfaces {\n" + 
+					"  public interface InnerInterface {\n" + 
+					"    Object doSomethingElse(Object o);\n" + 
+					"  }\n" + 
+					"}"
+				);
+			String source =
+					"package p1;\n" +
+					"import org.eclipse.jdt.annotation.*;\n" + 
+					"\n" + 
+					"@NonNullByDefault\n" + 
+					"public class Implementations implements Interfaces.InnerInterface {\n" + 
+					"	public Object doSomethingElse(Object o) {\n" + 
+					"		return o; \n" + 
+					"	}\n" + 
+					"}";
+			createFile(
+					"/TestAnnot/src/p1/Implementations.java",
+					source
+				);
+			project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
+			project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
+			project15.setOption(JavaCore.COMPILER_PB_NULL_REFERENCE, JavaCore.ERROR);
+			project15.setOption(JavaCore.COMPILER_PB_POTENTIAL_NULL_REFERENCE, JavaCore.ERROR);
+			project15.setOption(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK, JavaCore.ERROR);
+			project15.setOption(JavaCore.COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS, JavaCore.ENABLED);
+			project15.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
+	
+			this.workingCopies = new ICompilationUnit[1];
+			char[] sourceChars = source.toCharArray();
+			this.problemRequestor.initialize(sourceChars);
+			this.workingCopies[0] = getCompilationUnit("/TestAnnot/src/p1/Implementations.java").getWorkingCopy(this.wcOwner, null);
+			this.workingCopies[0].makeConsistent(null);
+			this.workingCopies[0].reconcile(ICompilationUnit.NO_AST, false, null, null);
+	
+			assertNoProblem(sourceChars, this.workingCopies[0]);
+		} finally {
+			if (project15 != null)
+				deleteProject(project15);
+		}
+	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java
index ce7b0a6..55570c6 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java
@@ -1056,6 +1056,88 @@
 
 	}
 
+	public void testInfixExpression2() throws Exception {
+		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class E {\n");
+		buf.append("    public void foo() {\n");
+		buf.append("        i= 0 + 2;\n");
+		buf.append("        j= 1 + 0;\n");
+		buf.append("        k= 0 + 2 + 3 + 4 + 5;\n");
+		buf.append("        l= 1 + 0 + 3 + 4 + 5;\n");
+		buf.append("        m= 0 + 0 + 0 + 4 + 5;\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+	
+		CompilationUnit astRoot= createAST(cu);
+		ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+	
+		assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);
+		TypeDeclaration type= findTypeDeclaration(astRoot, "E");
+		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
+		Block block= methodDecl.getBody();
+		List statements= block.statements();
+		{ // remove left side
+			ExpressionStatement stmt= (ExpressionStatement) statements.get(0);
+			Assignment assignment= (Assignment) stmt.getExpression();
+			InfixExpression expr= (InfixExpression) assignment.getRightHandSide();
+	
+			rewrite.remove(expr.getLeftOperand(), null);
+		}
+	
+		{ // remove right side
+			ExpressionStatement stmt= (ExpressionStatement) statements.get(1);
+			Assignment assignment= (Assignment) stmt.getExpression();
+			InfixExpression expr= (InfixExpression) assignment.getRightHandSide();
+	
+			rewrite.remove(expr.getRightOperand(), null);
+		}
+	
+		{ // remove left side (with extended operands)
+			ExpressionStatement stmt= (ExpressionStatement) statements.get(2);
+			Assignment assignment= (Assignment) stmt.getExpression();
+			InfixExpression expr= (InfixExpression) assignment.getRightHandSide();
+	
+			rewrite.remove(expr.getLeftOperand(), null);
+		}
+	
+		{ // remove right side (with extended operands)
+			ExpressionStatement stmt= (ExpressionStatement) statements.get(3);
+			Assignment assignment= (Assignment) stmt.getExpression();
+			InfixExpression expr= (InfixExpression) assignment.getRightHandSide();
+			
+			rewrite.remove(expr.getRightOperand(), null);
+		}
+		
+		{ // remove left, right, and extended operand
+			ExpressionStatement stmt= (ExpressionStatement) statements.get(4);
+			Assignment assignment= (Assignment) stmt.getExpression();
+			InfixExpression expr= (InfixExpression) assignment.getRightHandSide();
+			
+			rewrite.remove(expr.getLeftOperand(), null);
+			rewrite.remove(expr.getRightOperand(), null);
+			rewrite.remove((ASTNode) expr.extendedOperands().get(0), null);
+		}
+		
+		String preview= evaluateRewrite(cu, rewrite);
+	
+		buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class E {\n");
+		buf.append("    public void foo() {\n");
+		buf.append("        i= 2;\n");
+		buf.append("        j= 1;\n");
+		buf.append("        k= 2 + 3 + 4 + 5;\n");
+		buf.append("        l= 1 + 3 + 4 + 5;\n");
+		buf.append("        m= 4 + 5;\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		assertEqualString(preview, buf.toString());
+	
+	}
+
 	public void testInstanceofExpression() throws Exception {
 		IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
 		StringBuffer buf= new StringBuffer();
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 ceb45ce..c7928b3 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
@@ -952,6 +952,10 @@
 
 	/** @since 3.9 BETA_JAVA8 */
 	int IllegalUseOfUnderscoreAsAnIdentifier = Syntax + Internal + 443;
+
+	 /** @since 3.10 */
+	int UninternedIdentityComparison = Syntax + Internal + 444;
+
 	// detected task
 	/** @since 2.1 */
 	int Task = Internal + 450;
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 cdda392..803b328 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
@@ -251,8 +251,8 @@
 	// for if statement
 	public static final int IsElseIfStatement = Bit30;
 	public static final int ThenExit = Bit31;
-	public static final int IsElseStatementUnreachable = Bit8;
-	public static final int IsThenStatementUnreachable = Bit9;
+	public static final int IsElseStatementUnreachable = Bit8; // as computed by control flow analysis or null analysis.
+	public static final int IsThenStatementUnreachable = Bit9; // as computed by control flow analysis or null analysis
 
 	// for type reference
 	public static final int IsSuperType = Bit5;
@@ -589,7 +589,8 @@
 				scope.problemReporter().forbiddenReference(type, this, restriction.classpathEntryType,
 						restriction.classpathEntryName, restriction.getProblemId());
   :giro */
-				scope.problemReporter().forbiddenReference(type, this, restriction.classpathEntryType,
+				if (!isGeneratedBaseTypeReference())
+					scope.problemReporter().forbiddenReference(type, this, restriction.classpathEntryType,
 						restriction);
 // SH}
 			}
@@ -607,6 +608,14 @@
 		if (!scope.compilerOptions().reportDeprecationInsideDeprecatedCode && scope.isInsideDeprecatedCode()) return false;
 		return true;
 	}
+	
+	private boolean isGeneratedBaseTypeReference() {
+		if ((this.bits & IsGenerated) == 0)
+			return false;
+		if (!(this instanceof Expression))
+			return false;
+		return  ((Expression)this).getBaseclassDecapsulation().isAllowed();
+	}
 
 	public abstract StringBuffer print(int indent, StringBuffer output);
 
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 6f07112..742a466 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
@@ -23,11 +23,10 @@
  *							bug 370639 - [compiler][resource] restore the default for resource leak warnings
  *							bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
  *							bug 388996 - [compiler][resource] Incorrect 'potential resource leak'
- *        Andy Clement - Contributions for
- *                          Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
  *							bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
  *							Bug 392238 - [1.8][compiler][null] Detect semantically invalid null type annotations
  *							Bug 417295 - [1.8[[null] Massage type annotated null analysis to gel well with deep encoded type bindings.
+ *							Bug 418235 - [compiler][null] Unreported nullness error when using generic
  *     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
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
index 63eb10e..b13244d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
@@ -25,12 +25,6 @@
 	private Annotation[][] annotationsOnDimensions;  // jsr308 style type annotations on dimensions
 	public int extendedDimensions;
 
-//{ObjectTeams: mark generated reference:
-	public ArrayQualifiedTypeReference(char[][] sources , int dim, long[] poss, boolean isGenerated) {
-		this(sources, dim, poss);
-		this.isGenerated = isGenerated;
-	}
-// SH}
 	public ArrayQualifiedTypeReference(char[][] sources , int dim, long[] poss) {
 
 		super( sources , poss);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
index 9101f14..b82b864 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
@@ -842,8 +842,12 @@
 			return null;
 		}
 
+		final CompilerOptions compilerOptions = scope.compilerOptions();
+		if (compilerOptions.complainOnUninternedIdentityComparison && originalRightType.hasTypeBit(TypeIds.BitUninternedType) && originalLeftType.hasTypeBit(TypeIds.BitUninternedType))
+			scope.problemReporter().uninternedIdentityComparison(this, originalLeftType, originalRightType);
+
 		// autoboxing support
-		boolean use15specifics = scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5;
+		boolean use15specifics = compilerOptions.sourceLevel >= ClassFileConstants.JDK1_5;
 		TypeBinding leftType = originalLeftType, rightType = originalRightType;
 		if (use15specifics) {
 			if (leftType != TypeBinding.NULL && leftType.isBaseType()) {
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 82db3bd..d55f768 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
@@ -40,6 +40,7 @@
  *								Bug 405569 - Resource leak check false positive when using DbUtils.closeQuietly
  *								Bug 411964 - [1.8][null] leverage null type annotation in foreach statement
  *								Bug 417295 - [1.8[[null] Massage type annotated null analysis to gel well with deep encoded type bindings.
+ *								Bug 418235 - [compiler][null] Unreported nullness error when using generic
  *     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
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 fc4ac39..2994364 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
@@ -30,6 +30,7 @@
  *								Bug 392238 - [1.8][compiler][null] Detect semantically invalid null type annotations
  *								Bug 417295 - [1.8[[null] Massage type annotated null analysis to gel well with deep encoded type bindings.
  *								Bug 416267 - NPE in QualifiedAllocationExpression.resolveType
+ *								Bug 418235 - [compiler][null] Unreported nullness error when using generic
  *     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
@@ -730,4 +731,4 @@
 }
 //{ObjectTeams: end enclosing wrapper class
 }
-// SH}
\ No newline at end of file
+// SH}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
index 0959314..b8677b5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
@@ -40,15 +40,6 @@
 
 	public char[][] tokens;
 	public long[] sourcePositions;
-//{ObjectTeams: exempt generated references from OTJLD 1.2.3(b).
-	public boolean isGenerated;
-	public QualifiedTypeReference(char[][] sources , long[] poss, boolean isGenerated) {
-		this(sources,poss);
-		this.isGenerated = isGenerated;
-		if (isGenerated)
-			this.bits |= ASTNode.IgnoreRawTypeCheck;
-	}
-// SH}
 
 	public QualifiedTypeReference(char[][] sources , long[] poss) {
 
@@ -206,7 +197,7 @@
 				reportDeprecatedType(this.resolvedType, scope, i);
 			}
 //{ObjectTeams: statically qualified use of role?
-			if (i > 0 && !this.isGenerated && shouldAnalyzeRoleReference()) { // generated (and copied) methods are allowed to use MyTeam.R
+			if (i > 0 && (this.bits & ASTNode.IsGenerated) == 0 && shouldAnalyzeRoleReference()) { // generated (and copied) methods are allowed to use MyTeam.R
 				if (isIllegalQualifiedUseOfProtectedRole(scope)) {
 					// already reported
 				} else {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
index 3379caf..68bb509 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
@@ -549,7 +549,11 @@
 		// if a variable is only initialized in one branch and not initialized in the other,
 		// then we need to cast a doubt on its initialization in the merged info
 		mergedInfo.definiteInits &= initsWhenFalse.unconditionalCopy().definiteInits;
-		
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=415997, classify unreachability precisely, IsElseStatementUnreachable could be due to null analysis
+		if ((mergedInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0 && (initsWhenFalse.tagBits & FlowInfo.UNREACHABLE) == FlowInfo.UNREACHABLE_BY_NULLANALYSIS) {
+			mergedInfo.tagBits &= ~UNREACHABLE_OR_DEAD;
+			mergedInfo.tagBits |= UNREACHABLE_BY_NULLANALYSIS;
+		}
 	}
 	else if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0 &&
 			(ifStatement.bits & ASTNode.IsThenStatementUnreachable) != 0 && initsWhenTrue != FlowInfo.DEAD_END
@@ -565,6 +569,11 @@
 		// if a variable is only initialized in one branch and not initialized in the other,
 		// then we need to cast a doubt on its initialization in the merged info
 		mergedInfo.definiteInits &= initsWhenTrue.unconditionalCopy().definiteInits;
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=415997, classify unreachability precisely, IsThenStatementUnreachable could be due to null analysis
+		if ((mergedInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0 && (initsWhenTrue.tagBits & FlowInfo.UNREACHABLE) == FlowInfo.UNREACHABLE_BY_NULLANALYSIS) {
+			mergedInfo.tagBits &= ~UNREACHABLE_OR_DEAD;
+			mergedInfo.tagBits |= UNREACHABLE_BY_NULLANALYSIS;
+		}
 	}
 	else {
 		mergedInfo = initsWhenTrue.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
index 9ac3aca..bb0f017 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
@@ -249,6 +249,7 @@
 	public static final String OPTION_NullableAnnotationName = "org.eclipse.jdt.core.compiler.annotation.nullable"; //$NON-NLS-1$
 	public static final String OPTION_NonNullAnnotationName = "org.eclipse.jdt.core.compiler.annotation.nonnull"; //$NON-NLS-1$
 	public static final String OPTION_NonNullByDefaultAnnotationName = "org.eclipse.jdt.core.compiler.annotation.nonnullbydefault"; //$NON-NLS-1$
+	public static final String OPTION_ReportUninternedIdentityComparison = "org.eclipse.jdt.core.compiler.problem.uninternedIdentityComparison"; //$NON-NLS-1$
 	// defaults for the above:
 	static final char[][] DEFAULT_NULLABLE_ANNOTATION_NAME = CharOperation.splitOn('.', "org.eclipse.jdt.annotation.Nullable".toCharArray()); //$NON-NLS-1$
 	static final char[][] DEFAULT_NONNULL_ANNOTATION_NAME = CharOperation.splitOn('.', "org.eclipse.jdt.annotation.NonNull".toCharArray()); //$NON-NLS-1$
@@ -566,6 +567,8 @@
 	/** Should immediate null-check for fields be considered during null analysis (syntactical match)? */
 	public boolean enableSyntacticNullAnalysisForFields;
 
+	public boolean complainOnUninternedIdentityComparison;
+
 	// keep in sync with warningTokenToIrritant and warningTokenFromIrritant
 	public final static String[] warningTokens = {
 		"all", //$NON-NLS-1$
@@ -1493,6 +1496,7 @@
 		optionsMap.put(OPTION_SyntacticNullAnalysisForFields, this.enableSyntacticNullAnalysisForFields ? ENABLED : DISABLED);
 		optionsMap.put(OPTION_InheritNullAnnotations, this.inheritNullAnnotations ? ENABLED : DISABLED);
 		optionsMap.put(OPTION_ReportNonnullParameterAnnotationDropped, getSeverityString(NonnullParameterAnnotationDropped));
+		optionsMap.put(OPTION_ReportUninternedIdentityComparison, this.complainOnUninternedIdentityComparison ? ENABLED : DISABLED);
 		return optionsMap;
 	}
 
@@ -1660,6 +1664,8 @@
 		this.analyseResourceLeaks = true;
 
 		this.reportMissingEnumCaseDespiteDefault = false;
+
+		this.complainOnUninternedIdentityComparison = false;
 	}
 
 	public void set(Map optionsMap) {
@@ -2177,6 +2183,13 @@
 					this.storeAnnotations = false;
 			}
 		}
+		if ((optionValue = optionsMap.get(OPTION_ReportUninternedIdentityComparison)) != null) {
+			if (ENABLED.equals(optionValue)) {
+				this.complainOnUninternedIdentityComparison = true;
+			} else if (DISABLED.equals(optionValue)) {
+				this.complainOnUninternedIdentityComparison = false;
+			}
+		}
 	}
 	public String toString() {
 		StringBuffer buf = new StringBuffer("CompilerOptions:"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java
index 6f8236f..d900189 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java
@@ -587,4 +587,13 @@
 	    return false;
 	}
 // SH}
+
+//{ObjectTeams: is method the static implementation of a role ifc's abstract static?
+	private boolean staticRoleMethodImpl(MethodBinding method, MethodBinding inheritedMethod)
+	{
+	    if (inheritedMethod.declaringClass.isSynthInterface())
+	        return method.isStatic() && inheritedMethod.isStatic();
+	    return false;
+	}
+// SH}
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java
index 1fbefe0..e13bf0a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java
@@ -25,6 +25,7 @@
  *								bug 406928 - computation of inherited methods seems damaged (affecting @Overrides)
  *								bug 409473 - [compiler] JDT cannot compile against JRE 1.8
  *								Bug 420080 - [1.8] Overridden Default method is reported as duplicated
+ *								Bug 418235 - [compiler][null] Unreported nullness error when using generic
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.lookup;
 
@@ -78,7 +79,7 @@
 	SourceTypeBinding type;
 	HashtableOfObject inheritedMethods;
 	HashtableOfObject currentMethods;
-/*
+	/*
 Binding creation is responsible for reporting all problems with types:
 	- all modifier problems (duplicates & multiple visibility modifiers + incompatible combinations - abstract/final)
 		- plus invalid modifiers given the context (the verifier did not do this before)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
index c9b1d03..f0ba436 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
@@ -28,6 +28,7 @@
  *								bug 395681 - [compiler] Improve simulation of javac6 behavior from bug 317719 after fixing bug 388795
  *								bug 409473 - [compiler] JDT cannot compile against JRE 1.8
  *								Bug 420080 - [1.8] Overridden Default method is reported as duplicated
+ *								Bug 418235 - [compiler][null] Unreported nullness error when using generic
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.lookup;
 
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 b5b9386..05de02c 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
@@ -1014,6 +1014,12 @@
 					return;
 			}
 			break;
+		case 7 :
+			if (!CharOperation.equals(TypeConstants.JDT, this.compoundName[2]) || !CharOperation.equals(TypeConstants.TYPEBINDING, this.compoundName[6]))
+				return;
+			if (CharOperation.equals(TypeConstants.ORG_ECLIPSE_JDT_INTERNAL_COMPILER_LOOKUP_TYPEBINDING, this.compoundName))
+				this.typeBits |= TypeIds.BitUninternedType;
+			break;
 	}
 }
 
@@ -1382,8 +1388,6 @@
 public final boolean hasRestrictedAccess() {
 	return (this.modifiers & ExtraCompilerModifiers.AccRestrictedAccess) != 0;
 }
-/** Answer an additional bit characterizing this type, like {@link TypeIds#BitAutoCloseable}. */
-abstract public boolean hasTypeBit(int bit);
 
 //{ObjectTeams: support asymmetric comparison. // FIXME(SH): is this needed or is super-impl smart enough??
 @Override
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 cabb666..d09e6c4 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
@@ -34,6 +34,7 @@
  *								Bug 415850 - [1.8] Ensure RunJDTCoreTests can cope with null annotations enabled
  *								Bug 416172 - [1.8][compiler][null] null type annotation not evaluated on method return type
  *								Bug 417295 - [1.8[[null] Massage type annotated null analysis to gel well with deep encoded type bindings.
+ *								Bug 418235 - [compiler][null] Unreported nullness error when using generic
  *      Jesper S Moller <jesper@selskabet.org> -  Contributions for
  *								Bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
  *     Till Brychcy - Contributions for
@@ -2724,7 +2725,8 @@
 			methodDecl.createArgumentBindings();
 		// add implicit annotations (inherited(?) & default):
 		if (compilerOptions.isAnnotationBasedNullAnalysisEnabled) {
-			new ImplicitNullAnnotationVerifier(this.scope.environment()).checkImplicitNullAnnotations(method, methodDecl, true, this.scope);
+			new ImplicitNullAnnotationVerifier(this.scope.environment(), compilerOptions.inheritNullAnnotations)
+					.checkImplicitNullAnnotations(method, methodDecl, true, this.scope);
 		}
 	}
 }
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 60709c7..3b5834f 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
@@ -1526,4 +1526,8 @@
 	return false;
 }
 
+/** Answer an additional bit characterizing this type, like {@link TypeIds#BitAutoCloseable}. */
+public boolean hasTypeBit(int bit) {
+	return false;
+}
 }
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 a33464c..dacf483 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
@@ -107,7 +107,12 @@
     char[] LANG3 = "lang3".toCharArray(); //$NON-NLS-1$
     char[] COM = "com".toCharArray(); //$NON-NLS-1$
     char[] GOOGLE = "google".toCharArray(); //$NON-NLS-1$
-
+    char[] JDT = "jdt".toCharArray(); //$NON-NLS-1$
+    char[] INTERNAL = "internal".toCharArray(); //$NON-NLS-1$
+    char[] COMPILER = "compiler".toCharArray(); //$NON-NLS-1$
+    char[] LOOKUP = "lookup".toCharArray(); //$NON-NLS-1$
+    char[] TYPEBINDING = "TypeBinding".toCharArray(); //$NON-NLS-1$
+    
 	// Constant compound names
 	char[][] JAVA_LANG = {JAVA, LANG};
 	char[][] JAVA_IO = {JAVA, IO};
@@ -288,6 +293,7 @@
 	char[] VALIDATE_CLASS = "Validate".toCharArray(); //$NON-NLS-1$
 	char[][] ORG_APACHE_COMMONS_LANG_VALIDATE = new char[][] { ORG, APACHE, COMMONS, LANG, VALIDATE_CLASS };
 	char[][] ORG_APACHE_COMMONS_LANG3_VALIDATE = new char[][] { ORG, APACHE, COMMONS, LANG3, VALIDATE_CLASS };
+	char[][] ORG_ECLIPSE_JDT_INTERNAL_COMPILER_LOOKUP_TYPEBINDING = new char[][] { ORG, ECLIPSE, JDT, INTERNAL, COMPILER, LOOKUP, TYPEBINDING };
 	// ... methods:
 	char[] IS_TRUE = "isTrue".toCharArray(); //$NON-NLS-1$
 	char[] NOT_NULL = "notNull".toCharArray(); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
index 66b0dc3..cae2eb1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
@@ -243,8 +243,9 @@
 	 */
 	final int BitResourceFreeCloseable = 8;
 	
+	final int BitUninternedType = 16;
 	/**
 	 * Set of type bits that should be inherited by any sub types.
 	 */
-	final int InheritableBits = BitAutoCloseable | BitCloseable;
+	final int InheritableBits = BitAutoCloseable | BitCloseable | BitUninternedType;
 }
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 30c6cee..80f3c8e 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
@@ -14221,4 +14221,32 @@
 		annotation.sourceStart,
 		annotation.sourceEnd);
 }
+public void uninternedIdentityComparison(EqualExpression expr, TypeBinding lhs, TypeBinding rhs) {
+	
+	char [] lhsName = lhs.sourceName();
+	char [] rhsName = rhs.sourceName();
+	
+	if (CharOperation.equals(lhsName, "VoidTypeBinding".toCharArray())  //$NON-NLS-1$
+			|| CharOperation.equals(lhsName, "NullTypeBinding".toCharArray())  //$NON-NLS-1$
+			|| CharOperation.equals(lhsName, "ProblemReferenceBinding".toCharArray())) //$NON-NLS-1$
+		return;
+	
+	if (CharOperation.equals(rhsName, "VoidTypeBinding".toCharArray())  //$NON-NLS-1$
+			|| CharOperation.equals(rhsName, "NullTypeBinding".toCharArray())  //$NON-NLS-1$
+			|| CharOperation.equals(rhsName, "ProblemReferenceBinding".toCharArray())) //$NON-NLS-1$
+		return;
+	
+	this.handle(
+			IProblem.UninternedIdentityComparison,
+			new String[] {
+					new String(lhs.readableName()),
+					new String(rhs.readableName())
+			},
+			new String[] {
+					new String(lhs.shortReadableName()),
+					new String(rhs.shortReadableName())
+			},
+			expr.sourceStart,
+			expr.sourceEnd);
+}
 }
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 1562437..36c92f3 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
@@ -69,8 +69,8 @@
 27 = Cannot use an expression of the type {0} as a valid enclosing instance
 28 = No enclosing instance of type {0} is available due to some intermediate constructor invocation
 29 = An anonymous class cannot subclass the final class {0}
-30 = The member annotation {0} can only be defined inside a top-level class or interface
-31 = The member enum {0} can only be defined inside a top-level class or interface
+30 = The member annotation {0} can only be defined inside a top-level class or interface or in a static context
+31 = The member enum {0} can only be defined inside a top-level class or interface or in a static context
 32 = The member enum {0} must be defined inside a static member type
 33 = The type {0} is hiding the type {1}
 
@@ -425,6 +425,7 @@
 441 = 'enum' should not be used as an identifier, since it is a reserved keyword from source level 1.5 on
 442 = Enum constants cannot be surrounded by parenthesis
 443 = '_' should not be used as an identifier, since it is a reserved keyword from source level 1.8 on
+444 = The uninterned types {0} and {1} should not be compared using ==/!= operators.
 
 450 = {0}{1}
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstClone.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstClone.java
index 406aa4e..8fa523b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstClone.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstClone.java
@@ -23,6 +23,7 @@
 import java.util.Arrays;
 
 import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.internal.compiler.ast.ASTNode;
 import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
 import org.eclipse.jdt.internal.compiler.ast.Argument;
 import org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference;
@@ -113,7 +114,7 @@
 	                qualifiedResult = gen.qualifiedArrayTypeReference(typeName, dims);
 	            else
 	                qualifiedResult = gen.qualifiedTypeReference(typeName);
-	            qualifiedResult.isGenerated = qualifiedTypeReference.isGenerated;
+	            qualifiedResult.bits |= (qualifiedTypeReference.bits & ASTNode.IsGenerated);
 	            result = qualifiedResult;
             }
         }
@@ -183,9 +184,9 @@
             	result = new ParameterizedQualifiedTypeReference(typeName, newArgs, dims, poss);
             } else {
 	            if (dims > 0)
-	                result = new ArrayQualifiedTypeReference(typeName, dims, poss, qualifiedTypeReference.isGenerated);
+	                result = new ArrayQualifiedTypeReference(typeName, dims, poss);
 	            else
-	                result = new QualifiedTypeReference(typeName, poss, qualifiedTypeReference.isGenerated);
+	                result = new QualifiedTypeReference(typeName, poss);
             }
         }
 
@@ -212,7 +213,7 @@
         }
         if (result != null) {
         	result.setBaseclassDecapsulation(typeReference.getBaseclassDecapsulation());
-        	result.bits = typeReference.bits;
+        	result.bits = typeReference.bits | ASTNode.IsGenerated;
         	return result;
         }
         throw new InternalCompilerError("Unexpected kind of type reference: " + typeReference.getClass().getName()); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java
index cd23f71..985fb32 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java
@@ -305,13 +305,17 @@
 	public QualifiedTypeReference qualifiedTypeReference(char[][] compoundName) {
 		long[] poss = new long[compoundName.length];
 		Arrays.fill(poss, this.pos);
-		return new QualifiedTypeReference(compoundName, poss, true);
+		QualifiedTypeReference reference = new QualifiedTypeReference(compoundName, poss);
+		reference.bits |= ASTNode.IsGenerated | ASTNode.IgnoreRawTypeCheck;
+		return reference;
 	}
 
 	public QualifiedTypeReference qualifiedArrayTypeReference(char[][] compoundName, int dims) {
 		long[] poss = new long[compoundName.length];
 		Arrays.fill(poss, this.pos);
-		return new ArrayQualifiedTypeReference(compoundName, dims, poss, true);
+		ArrayQualifiedTypeReference reference = new ArrayQualifiedTypeReference(compoundName, dims, poss);
+		reference.bits |= ASTNode.IsGenerated | ASTNode.IgnoreRawTypeCheck;
+		return reference;
 	}
 
 	public SingleTypeReference parameterizedSingleTypeReference(char[] name, TypeReference[] typeParameters, int dimensions)
@@ -370,6 +374,7 @@
             elementType = ab.leafComponentType;
         }
         TypeReference typeReference = createArrayTypeReference(elementType, dims, makeGeneric);
+        typeReference.bits |= ASTNode.IsGenerated | ASTNode.IgnoreRawTypeCheck;
         typeReference.deprecationProblemId = 0;
         if (!type.isValidBinding())
         	typeReference.bits |= ASTNode.IsGeneratedWithProblem;
@@ -418,9 +423,11 @@
     {
     	TypeReference typeReference = createArrayTypeReference(elementType, dims, true);
     	typeReference.deprecationProblemId = 0;
+    	typeReference.bits |= ASTNode.IsGenerated | ASTNode.IgnoreRawTypeCheck;
 		return typeReference;
     }
-    public TypeReference createArrayTypeReference(
+
+    private TypeReference createArrayTypeReference(
             TypeBinding elementType,
             int dims,
             boolean makeGeneric)
@@ -529,12 +536,12 @@
 	            if (qname == null)
 	           		return new SingleTypeReference(sname, this.pos);
 	            else
-	                return new QualifiedTypeReference(qname, poss, /*isGenerated*/true);
+	                return new QualifiedTypeReference(qname, poss);
 	        } else {
 	            if (qname == null)
 	                return new ArrayTypeReference(sname, dims, this.pos);
 	            else {
-	                return new ArrayQualifiedTypeReference(qname, dims, poss, /*isGenerated*/true);
+	                return new ArrayQualifiedTypeReference(qname, dims, poss);
 	            }
 	        }
         } else {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IAlienScopeTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IAlienScopeTypeReference.java
index 56d91f4..87a7d07 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IAlienScopeTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/IAlienScopeTypeReference.java
@@ -17,6 +17,7 @@
 package org.eclipse.objectteams.otdt.internal.core.compiler.util;
 
 import org.eclipse.jdt.internal.compiler.CompilationResult.CheckPoint;
+import org.eclipse.jdt.internal.compiler.ast.ASTNode;
 import org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference;
 import org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference;
 import org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference;
@@ -164,7 +165,7 @@
 		public AlienScopeQualifiedTypeReference(char[][] sources, long[] poss, Scope alienScope) {
 			super(sources, poss);
 			this.alienScope = alienScope;
-			this.isGenerated = true; // allow qualified reference to role
+			this.bits |= ASTNode.IsGenerated; // allow qualified reference to role
 		}
 		public Scope getAlienScope() { return this.alienScope; }
 		@Override
@@ -204,7 +205,7 @@
 		public AlienScopeArrayQualifiedTypeReference(char[][] sources, long[] poss, int dim, Scope alienScope) {
 			super(sources, dim, poss);
 			this.alienScope = alienScope;
-			this.isGenerated = true; // allow qualified reference to role
+			this.bits |= ASTNode.IsGenerated; // allow qualified reference to role
 		}
 		public Scope getAlienScope() { return this.alienScope; }
 		@Override
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
index 33e70c1..4930496 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
@@ -2774,15 +2774,43 @@
 			return doVisitUnchangedChildren(node);
 		}
 
-		int pos= rewriteRequiredNode(node, InfixExpression.LEFT_OPERAND_PROPERTY);
+		Expression right= node.getRightOperand();
+		int pos;
+		
+		RewriteEvent leftEvent= getEvent(node, InfixExpression.LEFT_OPERAND_PROPERTY);
+		boolean removeLeft = leftEvent != null && leftEvent.getChangeKind() == RewriteEvent.REMOVED;
+		RewriteEvent rightEvent= getEvent(node, InfixExpression.RIGHT_OPERAND_PROPERTY);
+		boolean removeRight = rightEvent != null && rightEvent.getChangeKind() == RewriteEvent.REMOVED;
+		
+		if (removeLeft) {
+			Expression left= node.getLeftOperand();
+			int leftStart= getExtendedOffset(left);
+			pos= getExtendedOffset(right);
+			TextEditGroup editGroup= getEditGroup(leftEvent);
+			doTextRemoveAndVisit(leftStart, pos - leftStart, left, editGroup);
+		} else {
+			pos = rewriteRequiredNode(node, InfixExpression.LEFT_OPERAND_PROPERTY);
+		}
 
 		boolean needsNewOperation= isChanged(node, InfixExpression.OPERATOR_PROPERTY);
 		String operation= getNewValue(node, InfixExpression.OPERATOR_PROPERTY).toString();
-		if (needsNewOperation) {
+		if (needsNewOperation && !removeLeft && !removeRight) {
 			replaceOperation(pos, operation, getEditGroup(node, InfixExpression.OPERATOR_PROPERTY));
 		}
 
-		pos= rewriteRequiredNode(node, InfixExpression.RIGHT_OPERAND_PROPERTY);
+		if (removeRight) {
+			int end;
+			if (removeLeft && node.extendedOperands().size() > 0) {
+				end= getExtendedOffset((Expression) node.extendedOperands().get(0));
+			} else {
+				end= getExtendedEnd(right);
+			}
+			TextEditGroup editGroup= getEditGroup(rightEvent);
+			doTextRemoveAndVisit(pos, end - pos, right, editGroup);
+			pos= end;
+		} else {
+			pos= rewriteRequiredNode(node, InfixExpression.RIGHT_OPERAND_PROPERTY);
+		}
 
 		RewriteEvent event= getEvent(node, InfixExpression.EXTENDED_OPERANDS_PROPERTY);
 		String prefixString= ' ' + operation + ' ';
diff --git a/org.eclipse.jdt.core/forceQualifierUpdate.txt b/org.eclipse.jdt.core/forceQualifierUpdate.txt
index 6c3cdbf..c51eb12 100644
--- a/org.eclipse.jdt.core/forceQualifierUpdate.txt
+++ b/org.eclipse.jdt.core/forceQualifierUpdate.txt
@@ -4,3 +4,4 @@
 Bug 407852 - ECJ source download is not correct
 Bug 408447 - compiler (log message) needs updating for copyright and bundle_qualifier
 Several bundles changed and need to be touched
+Bug 418646 - org.eclipse.jdt.core does not provide an artifact with classifier 'antadapter'
\ No newline at end of file
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
index 416d78c..836c105 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
@@ -3985,7 +3985,7 @@
 	 * @param wrapStyle the given wrapping style
 	 * @param indentStyle the given indent style
 	 * 
-	 * @return the new alignement value
+	 * @return the new alignment value
 	 */
 	public static String createAlignmentValue(boolean forceSplit, int wrapStyle, int indentStyle) {
 		int alignmentValue = 0; 
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
index d909e2e..159eeb9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
@@ -4616,20 +4616,21 @@
 		Iterator packages = secondaryTypes.values().iterator();
 		while (packages.hasNext()) {
 			HashMap types = (HashMap) packages.next();
+			HashMap tempTypes = new HashMap(types.size());
 			Iterator names = types.entrySet().iterator();
 			while (names.hasNext()) {
 				Map.Entry entry = (Map.Entry) names.next();
 				String typeName = (String) entry.getKey();
 				String path = (String) entry.getValue();
+				names.remove();
 				if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(path)) {
 					IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(path));
 					ICompilationUnit unit = JavaModelManager.createCompilationUnitFrom(file, null);
 					IType type = unit.getType(typeName);
-					types.put(typeName, type); // replace stored path with type itself
-				} else {
-					names.remove();
+					tempTypes.put(typeName, type);
 				}
 			}
+			types.putAll(tempTypes);
 		}
 
 		// Store result in per project info cache if still null or there's still an indexing cache (may have been set by another thread...)
diff --git a/org.eclipse.jdt.core/pom.xml b/org.eclipse.jdt.core/pom.xml
index c74c789..305416e 100644
--- a/org.eclipse.jdt.core/pom.xml
+++ b/org.eclipse.jdt.core/pom.xml
@@ -170,6 +170,10 @@
         <groupId>org.eclipse.tycho</groupId>
         <artifactId>tycho-p2-plugin</artifactId>
         <version>${tycho.version}</version>
+        <configuration>
+          <baselineMode>warn</baselineMode>
+          <baselineReplace>common</baselineReplace>
+        </configuration>
         <executions>
           <execution>
             <id>attached-p2-metadata</id>
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
index 91e2d27..f3d5a58 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
@@ -1006,7 +1006,7 @@
     // special handling for methods of anonymous/local types. Since these cannot be looked up in the environment the usual way ...
     if (methodPattern.focus instanceof SourceMethod) {
     	char[] typeName = PatternLocator.qualifiedPattern(methodPattern.declaringSimpleName, methodPattern.declaringQualification);
-    	if (CharOperation.indexOf(IIndexConstants.ONE_STAR, typeName, true) >= 0) { // See org.eclipse.jdt.core.search.SearchPattern.enclosingTypeNames(IType)
+    	if (typeName != null && CharOperation.indexOf(IIndexConstants.ONE_STAR, typeName, true) >= 0) { // See org.eclipse.jdt.core.search.SearchPattern.enclosingTypeNames(IType)
     		IType type = methodPattern.declaringType;
     		IType enclosingType = type.getDeclaringType();
     		while (enclosingType != null) {
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptorActivator.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptorActivator.java
index 719bba8..d810120 100644
--- a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptorActivator.java
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptorActivator.java
@@ -334,7 +334,7 @@
 		callin boolean build(SimpleLookupTable deltas) 
 		{
 			// Activation only for this thread/control flow:
-			within (manager) {
+			within (manager.start()) {
 				return base.build(deltas);
 			}
 		}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java
index cd56655..e9831a6 100644
--- a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java
@@ -127,6 +127,20 @@
 		this.staleRoles = new HashSet<String>();
 	}
 	
+	/**
+	 * We'll deactivate this BuildManager after MAX_RETRIES to avoid causing to fall back
+	 * on a full build due to our attempts, which in certain situations could lead to
+	 * an infinite build loop, see https://bugs.eclipse.org/417735
+	 * To play safe MAX_RETRIES must be less than IncrementalImageBuilder.MaxCompileLoop.
+	 */
+	final static int MAX_RETRIES = 3;
+	int retries = 0;
+
+	public BuildManager start() {
+		this.retries = 0;
+		return this;
+	}
+
 	protected class BinaryType playedBy BinaryTypeBinding 
 	{
 		/** Record if a given type depends on an unresolvable type.
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ImageBuilder.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ImageBuilder.java
index bf3fcba..04ed47b 100644
--- a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ImageBuilder.java
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ImageBuilder.java
@@ -215,6 +215,9 @@
 	void addAffectedTeamFiles() <- after void addAffectedSourceFiles();
 	
 	void addAffectedTeamFiles() {
+		if (++BuildManager.this.retries > MAX_RETRIES)
+			BuildManager.this.deactivate();
+
 		// fetch sets of teams:
 		Set<String> teamFiles = fetchTeamsToRecompile();
 		
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTEquinoxBuilderTests.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTEquinoxBuilderTests.java
index 68825e9..2b9b25b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTEquinoxBuilderTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/src/org/eclipse/objectteams/otdt/test/builder/OTEquinoxBuilderTests.java
@@ -67,9 +67,9 @@
 		}
 	};
 	
-//	static {
-//		TESTS_NAMES = new String[] { "testBaseImportTrac304"};
-//	}
+	static {
+//		TESTS_NAMES = new String[] { "testBug419987"};
+	}
 	public OTEquinoxBuilderTests(String name) {
 		super(name);
 	}
@@ -150,8 +150,8 @@
 		expectingNoProblemsFor(trac18b.getPath());
 		expectingOnlySpecificProblemsFor(trac18a.getPath(), new Problem[] {
 			getDecapsulationProblem(trac18a, "trac18b.actions.SampleAction", "trac18a/Team18.java", 42, 70),
-			getDecapsulationProblem(trac18a, "trac18b.actions.SampleAction", "trac18a/Team18.java", 163, 175),
-			getDecapsulationProblem(trac18a, "trac18b.actions.SampleAction", "trac18a/Team18.java", 201, 205) // location of the base-ctor call.
+			getDecapsulationProblem(trac18a, "trac18b.actions.SampleAction", "trac18a/Team18.java", 163, 175)
+			// base-ctor call no longer flagged
 		});
 	}
 	/* trying to produce a broken and bogus error message a la Trac #154 (no success yet). */
@@ -380,6 +380,16 @@
 				new Problem[] {
 					getMissingAspectExportProblem(aea, "aea")});
 	}
+	
+	public void testBug419987() throws CoreException, IOException {
+		IJavaProject aeb= fileManager.setUpJavaProject("Base419987"); 
+		env.addProject(aeb.getProject());
+		IJavaProject aea= fileManager.setUpJavaProject("Bug419987"); 
+		env.addProject(aea.getProject());
+		fullBuild();
+		expectingNoProblemsFor(aeb.getPath());
+		expectingNoProblemsFor(aea.getPath());		
+	}
 
 	// ---------------- HELPERS: ---------------------------
 	private Problem getDecapsulationProblem(IJavaProject project, String baseclassName, String teamPath, int start, int end) {
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/.classpath b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/.classpath
new file mode 100644
index 0000000..304e861
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/.project b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/.project
new file mode 100644
index 0000000..0659ea7
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>Base419987</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+	</natures>
+</projectDescription>
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/.settings/org.eclipse.jdt.core.prefs b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0f8f6c5
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.objectteams.otdt.compiler.option.pure_java=enabled
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/META-INF/MANIFEST.MF b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..cba4876
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/META-INF/MANIFEST.MF
@@ -0,0 +1,6 @@
+Bundle-ManifestVersion: 2
+Bundle-Name: Base
+Bundle-SymbolicName: Base419987
+Bundle-Version: 1.0.0.qualifier
+Export-Package: internal;x-internal:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/build.properties b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/build.properties
new file mode 100644
index 0000000..b107977
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/build.properties
@@ -0,0 +1,3 @@
+source.. = src/
+bin.includes = META-INF/,\
+               .
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/src/internal/RestrictedFoo.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/src/internal/RestrictedFoo.java
new file mode 100644
index 0000000..ff37c03
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Base419987/src/internal/RestrictedFoo.java
@@ -0,0 +1,5 @@
+package internal;
+
+public class RestrictedFoo {
+
+}
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/.classpath b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/.classpath
new file mode 100644
index 0000000..9b7e6c5
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="OTRE"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/.project b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/.project
new file mode 100644
index 0000000..8cf7b24
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>Bug419987</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.objectteams.otdt.builder.OTJBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.objectteams.otdt.OTJavaNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+	</natures>
+</projectDescription>
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/META-INF/MANIFEST.MF b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..4233287
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/META-INF/MANIFEST.MF
@@ -0,0 +1,7 @@
+Bundle-ManifestVersion: 2
+Bundle-Name: Bug419987
+Bundle-SymbolicName: Bug419987
+Bundle-Version: 1.0.0.qualifier
+Export-Package: teams
+Require-Bundle: Base419987;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/build.properties b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/build.properties
new file mode 100644
index 0000000..b107977
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/build.properties
@@ -0,0 +1,3 @@
+source.. = src/
+bin.includes = META-INF/,\
+               .
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/src/teams/Sub.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/src/teams/Sub.java
new file mode 100644
index 0000000..95a54bb
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/src/teams/Sub.java
@@ -0,0 +1,5 @@
+package teams;
+public team class Sub extends Super { // warning is here on "Super"
+	protected class RSub extends RSuper {
+	}
+}
\ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/src/teams/Super.java b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/src/teams/Super.java
new file mode 100644
index 0000000..c99c013
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.test.builder/workspace/Bug419987/src/teams/Super.java
@@ -0,0 +1,9 @@
+package teams;
+
+import base internal.RestrictedFoo;
+
+@SuppressWarnings("restriction")
+public team class Super {
+	protected class RSuper playedBy RestrictedFoo {
+	}
+}
\ No newline at end of file