update jdt.core to I20210920-1800 (from master with Java 17)
diff --git a/org.eclipse.jdt.core.tests.compiler/pom.xml b/org.eclipse.jdt.core.tests.compiler/pom.xml
index bdf289f..771c2b6 100644
--- a/org.eclipse.jdt.core.tests.compiler/pom.xml
+++ b/org.eclipse.jdt.core.tests.compiler/pom.xml
@@ -15,7 +15,7 @@
   <parent>
     <artifactId>tests-pom</artifactId>
     <groupId>eclipse.jdt.core</groupId>
-    <version>4.21.0-SNAPSHOT</version>
+    <version>4.22.0-SNAPSHOT</version>
     <relativePath>../tests-pom/</relativePath>
   </parent>
   <groupId>org.eclipse.jdt</groupId>
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 9e314d2..205b936 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
@@ -1360,27 +1360,27 @@
 	    expectedProblemAttributes.put("RecordIllegalStaticModifierForLocalClassOrInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
 	    expectedProblemAttributes.put("RecordIllegalModifierForLocalRecord", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
 	    expectedProblemAttributes.put("RecordIllegalExtendedDimensionsForRecordComponent", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
-	    expectedProblemAttributes.put("LocalStaticsIllegalVisibilityModifierForInterfaceLocalType", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("IllegalModifierForLocalEnumDeclaration", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedMissingClassModifier", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedDisAllowedNonSealedModifierInClass", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedSuperClassDoesNotPermit", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedSuperInterfaceDoesNotPermit", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedMissingSealedModifier", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedMissingInterfaceModifier", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedDuplicateTypeInPermits", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedNotDirectSuperClass", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedPermittedTypeOutsideOfModule", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedPermittedTypeOutsideOfPackage", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedSealedTypeMissingPermits", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedInterfaceIsSealedAndNonSealed", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedDisAllowedNonSealedModifierInInterface", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedNotDirectSuperInterface", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedLocalDirectSuperTypeSealed", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedAnonymousClassCannotExtendSealedType", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
+	    expectedProblemAttributes.put("LocalStaticsIllegalVisibilityModifierForInterfaceLocalType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("IllegalModifierForLocalEnumDeclaration", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedMissingClassModifier", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedDisAllowedNonSealedModifierInClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedSuperClassDoesNotPermit", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedSuperInterfaceDoesNotPermit", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedMissingSealedModifier", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedMissingInterfaceModifier", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedDuplicateTypeInPermits", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedNotDirectSuperClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedPermittedTypeOutsideOfModule", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedPermittedTypeOutsideOfPackage", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedSealedTypeMissingPermits", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedInterfaceIsSealedAndNonSealed", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedDisAllowedNonSealedModifierInInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedNotDirectSuperInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedLocalDirectSuperTypeSealed", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedAnonymousClassCannotExtendSealedType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
 	    expectedProblemAttributes.put("LocalReferencedInGuardMustBeEffectivelyFinal", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedSuperTypeInDifferentPackage", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
-	    expectedProblemAttributes.put("SealedSuperTypeDisallowed", new ProblemAttributes(CategorizedProblem.CAT_PREVIEW_RELATED));
+	    expectedProblemAttributes.put("SealedSuperTypeInDifferentPackage", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+	    expectedProblemAttributes.put("SealedSuperTypeDisallowed", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
 	    expectedProblemAttributes.put("SafeVarargsOnSyntheticRecordAccessor", new ProblemAttributes(true));
 	    expectedProblemAttributes.put("DiscouragedValueBasedTypeSynchronization", new ProblemAttributes(true));
 	    expectedProblemAttributes.put("ConstantWithPatternIncompatible", new ProblemAttributes(true));
diff --git a/org.eclipse.jdt.core.tests.model/pom.xml b/org.eclipse.jdt.core.tests.model/pom.xml
index 56bfc3b..69e7736 100644
--- a/org.eclipse.jdt.core.tests.model/pom.xml
+++ b/org.eclipse.jdt.core.tests.model/pom.xml
@@ -15,7 +15,7 @@
   <parent>
     <artifactId>tests-pom</artifactId>
     <groupId>eclipse.jdt.core</groupId>
-    <version>4.21.0-SNAPSHOT</version>
+    <version>4.22.0-SNAPSHOT</version>
     <relativePath>../tests-pom/</relativePath>
   </parent>
   <groupId>org.eclipse.jdt</groupId>
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
index b4ab2dd..09f4126 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
@@ -13285,4 +13285,13 @@
 		"}",
 		CodeFormatter.K_CLASS_BODY_DECLARATIONS);
 }
+public void testBug574437() {
+	formatSource(
+		"class C {\n" +
+		"	void foo(Object o) {\n" +
+		"		if ((o) instanceof String s)\n" +
+		"			bar(s);\n" +
+		"	}\n" +
+		"}");
+}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java
index d9671e3..e3b39ff 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java
@@ -1362,7 +1362,7 @@
 	}
 	assertEquals(
 		"Unxepected JavaModelException",
-		"Java Model Exception: Java Model Status [Operation not supported for specified element type(s):[Working copy] X.class [in workingcopy [in lib.jar [in P]]]]",
+		"Java Model Exception: Error in Java Model (code 967): Operation not supported for specified element type(s):[Working copy] X.class [in workingcopy [in lib.jar [in P]]]",
 		exception.toString());
 }
 
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java
index 8fe462b..8da158e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompilationUnitTests.java
@@ -619,9 +619,7 @@
 	try {
 		startLogListening();
 		((org.eclipse.jdt.internal.compiler.env.ICompilationUnit) getCompilationUnit("/P/src/p/Deleted.java")).getContents();
-		assertLogEquals(
-			"Status ERROR: org.eclipse.jdt.core code=4 File not found: \'/P/src/p/Deleted.java\' org.eclipse.core.internal.resources.ResourceException: Resource \'/P/src/p/Deleted.java\' does not exist.\n"
-		);
+		assertLogEquals("Error in Java Model (code 969): Resource \'/P/src/p/Deleted.java\' does not exist.\n");
 	} finally {
 		stopLogListening();
 	}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java
index cd84004..62dea73 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java
@@ -5163,8 +5163,8 @@
 	cu.codeComplete(cu.getSourceRange().getOffset() + cu.getSourceRange().getLength(), requestor);
 	assertEquals(
 		"should have two methods of 'foo'",
-		"element:foo    completion:foo()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
-		"element:foo    completion:foo()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED),
+		"element:foo    completion:foo()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED + R_METHOD_OVERLOAD)+"\n" +
+		"element:foo    completion:foo()    relevance:"+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED + R_METHOD_OVERLOAD),
 		requestor.getResults());
 }
 /*
@@ -13323,9 +13323,32 @@
 	int tStart = str.lastIndexOf("xBar(1,") + "xBar(1,".length();
 	int tEnd = tStart;
 
-	assertResults(
-		"xBar[METHOD_REF]{CompletionPrefixMethodName3.this.xBar(1,, LCompletionPrefixMethodName3;, (II)I, xBar, (a, b), replace["+rStart1+", "+rEnd1+"], token["+tStart+", "+tEnd+"], "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_NON_RESTRICTED)+"}\n"+
-		"xBar[METHOD_REF]{, LCompletionPrefixMethodName3$classFoo;, (II)I, xBar, (a, b), replace["+rStart2+", "+rEnd2+"], token["+tStart+", "+tEnd+"], "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+	assertResults("finalize[METHOD_REF]{CompletionPrefixMethodName3.this.finalize(), Ljava.lang.Object;, ()V, finalize, null, replace[150, 150], token[150, 150], 44}\n"
+			+ "notify[METHOD_REF]{CompletionPrefixMethodName3.this.notify(), Ljava.lang.Object;, ()V, notify, null, replace[150, 150], token[150, 150], 44}\n"
+			+ "notifyAll[METHOD_REF]{CompletionPrefixMethodName3.this.notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, replace[150, 150], token[150, 150], 44}\n"
+			+ "wait[METHOD_REF]{CompletionPrefixMethodName3.this.wait(), Ljava.lang.Object;, ()V, wait, null, replace[150, 150], token[150, 150], 44}\n"
+			+ "wait[METHOD_REF]{CompletionPrefixMethodName3.this.wait(), Ljava.lang.Object;, (J)V, wait, (millis), replace[150, 150], token[150, 150], 44}\n"
+			+ "wait[METHOD_REF]{CompletionPrefixMethodName3.this.wait(), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), replace[150, 150], token[150, 150], 44}\n"
+			+ "finalize[METHOD_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, replace[150, 150], token[150, 150], 47}\n"
+			+ "foo[METHOD_REF]{foo(), LCompletionPrefixMethodName3$classFoo;, ()V, foo, null, replace[150, 150], token[150, 150], 47}\n"
+			+ "notify[METHOD_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, replace[150, 150], token[150, 150], 47}\n"
+			+ "notifyAll[METHOD_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, replace[150, 150], token[150, 150], 47}\n"
+			+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, replace[150, 150], token[150, 150], 47}\n"
+			+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (J)V, wait, (millis), replace[150, 150], token[150, 150], 47}\n"
+			+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), replace[150, 150], token[150, 150], 47}\n"
+			+ "clone[METHOD_REF]{CompletionPrefixMethodName3.this.clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, replace[150, 150], token[150, 150], 49}\n"
+			+ "equals[METHOD_REF]{CompletionPrefixMethodName3.this.equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), replace[150, 150], token[150, 150], 49}\n"
+			+ "getClass[METHOD_REF]{CompletionPrefixMethodName3.this.getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, replace[150, 150], token[150, 150], 49}\n"
+			+ "toString[METHOD_REF]{CompletionPrefixMethodName3.this.toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, replace[150, 150], token[150, 150], 49}\n"
+			+ "CompletionPrefixMethodName3[TYPE_REF]{CompletionPrefixMethodName3, , LCompletionPrefixMethodName3;, null, null, replace[150, 150], token[150, 150], 52}\n"
+			+ "clone[METHOD_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, replace[150, 150], token[150, 150], 52}\n"
+			+ "equals[METHOD_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), replace[150, 150], token[150, 150], 52}\n"
+			+ "getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, replace[150, 150], token[150, 150], 52}\n"
+			+ "toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, replace[150, 150], token[150, 150], 52}\n"
+			+ "xBar[METHOD_REF]{CompletionPrefixMethodName3.this.xBar(1,, LCompletionPrefixMethodName3;, (II)I, xBar, (a, b), replace["+rStart1+", "+rEnd1+"], token["+tStart+", "+tEnd+"], "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_NON_RESTRICTED)+"}\n"
+			+ "xBar[METHOD_REF]{, LCompletionPrefixMethodName3$classFoo;, (II)I, xBar, (a, b), replace["+rStart2+", "+rEnd2+"], token["+tStart+", "+tEnd+"], "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"
+			+ "hashCode[METHOD_REF]{CompletionPrefixMethodName3.this.hashCode(), Ljava.lang.Object;, ()I, hashCode, null, replace[150, 150], token[150, 150], 79}\n"
+			+ "hashCode[METHOD_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, replace[150, 150], token[150, 150], 82}",
 		requestor.getResults());
 }
 public void testCompletionQualifiedAllocationType1() throws JavaModelException {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java
index 90aad65..ec79b7b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java
@@ -4670,7 +4670,7 @@
             "toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+normalRelevance+"}\n" +
             "List<java.lang.Long>[TYPE_REF]{List, java.util, Ljava.util.List<Ljava.lang.Long;>;, null, null, "+expectedTypeRelevance+"}\n" +
             "findAll[METHOD_REF]{findAll(), Ltest.TestApp;, ()Ljava.util.List<Ljava.lang.String;>;, findAll, null, "+expectedTypeRelevance+"}\n" +
-            "load[METHOD_REF]{load(), Ltest.TestApp;, (Ljava.util.List<Ljava.lang.Long;>;)Ljava.util.List<Ljava.lang.String;>;, load, (ids), "+expectedTypeRelevance+"}",
+            "load[METHOD_REF]{, Ltest.TestApp;, (Ljava.util.List<Ljava.lang.Long;>;)Ljava.util.List<Ljava.lang.String;>;, load, (ids), 86}",
     		requestor.getResults());
 }
 public void testBug539617_alloc() throws JavaModelException {
@@ -4711,8 +4711,8 @@
 	String completeBehind = "meth(";
 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
 	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-	int relevance =  R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED;
-	int relevanceExpectedType = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE;
+	int relevance =  R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED + R_METHOD_OVERLOAD;
+	int relevanceExpectedType = R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE  + R_METHOD_OVERLOAD;
 	assertResults(
 			"meth[METHOD_REF]{, LCodeCompletion;, (Ljava.lang.String;Z)Ljava.lang.Number;, meth, (arg, flag), "+relevance+"}\n" +
 			"meth[METHOD_REF]{, LCodeCompletion;, (Ljava.lang.String;)Ljava.lang.Double;, meth, (arg), "+relevanceExpectedType+"}",
@@ -5306,8 +5306,8 @@
     this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, new NullProgressMonitor());
 
     String result = requestor.getResults();
-	assertTrue(String.format("Result doesn''t contain enum literal SECONDS (%s)", result),
-    		result.contains("defaultParam[METHOD_REF]{, LBug573313;, (I)Ljava.util.concurrent.TimeUnit;, defaultParam, (amout), 86}"));
+	assertTrue(String.format("Result doesn''t contain defaultParam method (%s)", result),
+    		result.contains("defaultParam[METHOD_REF]{, LBug573313;, (I)Ljava.util.concurrent.TimeUnit;, defaultParam, (amout), 118}"));
 
 }
 public void testBug573313_MethodParametersCompletions_InCompleteMessageSendOnMiddleParam_MethodCompletionsForType_2() throws JavaModelException {
@@ -5682,8 +5682,8 @@
 
     String result = requestor.getResults();
 	assertTrue(String.format("Result doesn't contain expected methods (%s)", result),
-    		result.contains("sorted[METHOD_REF]{, Ljava.util.stream.Stream<Ljava.lang.String;>;, ()Ljava.util.stream.Stream<Ljava.lang.String;>;, sorted, null, 56}\n"
-    				+ "sorted[METHOD_REF]{, Ljava.util.stream.Stream<Ljava.lang.String;>;, (Ljava.util.Comparator<-Ljava.lang.String;>;)Ljava.util.stream.Stream<Ljava.lang.String;>;, sorted, (arg0), 56}"));
+    		result.contains("sorted[METHOD_REF]{, Ljava.util.stream.Stream<Ljava.lang.String;>;, ()Ljava.util.stream.Stream<Ljava.lang.String;>;, sorted, null, 88}\n"
+    				+ "sorted[METHOD_REF]{, Ljava.util.stream.Stream<Ljava.lang.String;>;, (Ljava.util.Comparator<-Ljava.lang.String;>;)Ljava.util.stream.Stream<Ljava.lang.String;>;, sorted, (arg0), 88}"));
 }
 public void testBug563020_lambdaWithMethodRef_overloadedMethodref_expectCompletionForNextChainWithToken() throws JavaModelException {
 	this.workingCopies = new ICompilationUnit[1];
@@ -5948,7 +5948,11 @@
 	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
 	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
 	String result = requestor.getResults();
-	assertResults("getMinimum[METHOD_REF]{, Ljava.util.Calendar;, (I)I, getMinimum, (arg0), 86}",
+	assertResults("LambdaFreeze2[TYPE_REF]{LambdaFreeze2, , LLambdaFreeze2;, null, null, 52}\n"
+			+ "SUPPLIER[FIELD_REF]{SUPPLIER, LLambdaFreeze2;, Ljava.util.function.Supplier<Ljava.util.Date;>;, SUPPLIER, null, 52}\n"
+			+ "calendar[LOCAL_VARIABLE_REF]{calendar, null, Ljava.util.Calendar;, calendar, null, 52}\n"
+			+ "num[FIELD_REF]{num, LLambdaFreeze2;, I, num, null, 82}\n"
+			+ "getMinimum[METHOD_REF]{, Ljava.util.Calendar;, (I)I, getMinimum, (arg0), 86}",
 			result);
 }
 public void testBug574912_comment6b() throws JavaModelException {
@@ -6024,4 +6028,91 @@
 			"completion token location={STATEMENT_START}", // this is required for sysout template proposal
 			requestor.getContext());
 }
+public void testBug575149_expectOverloadedMethodsAndVariablesRankedWithExpectedType() throws JavaModelException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy(
+			"Completion/src/Bug443091.java",
+			"import java.util.function.Consumer;\n" +
+			"import java.util.function.Function;\n" +
+			"\n" +
+			"public class Bug443091 {\n" +
+			"	private void foo() {\n" +
+			" 		Consumer<Integer> capture = null;\n" +
+			"		forEach()" +
+			"	}\n" +
+			"	private void forEach(Consumer<Integer> in) {}\n" +
+			"	private void forEach(Function<Integer, String> in) {}\n" +
+			"}\n");
+
+	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+	requestor.allowAllRequiredProposals();
+	String str = this.workingCopies[0].getSource();
+	String completeBehind = "forEach(";
+	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+	String result = requestor.getResults();
+	assertResults("finalize[METHOD_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, 47}\n"
+			+ "foo[METHOD_REF]{foo(), LBug443091;, ()V, foo, null, 47}\n"
+			+ "notify[METHOD_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, 47}\n"
+			+ "notifyAll[METHOD_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, 47}\n"
+			+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, 47}\n"
+			+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (J)V, wait, (millis), 47}\n"
+			+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), 47}\n"
+			+ "Bug443091[TYPE_REF]{Bug443091, , LBug443091;, null, null, 52}\n"
+			+ "clone[METHOD_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, 52}\n"
+			+ "equals[METHOD_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), 52}\n"
+			+ "getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, getClass, null, 52}\n"
+			+ "hashCode[METHOD_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, 52}\n"
+			+ "toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, 52}\n"
+			+ "Consumer<java.lang.Integer>[TYPE_REF]{Consumer, java.util.function, Ljava.util.function.Consumer<Ljava.lang.Integer;>;, null, null, 82}\n"
+			+ "Function<java.lang.Integer,java.lang.String>[TYPE_REF]{Function, java.util.function, Ljava.util.function.Function<Ljava.lang.Integer;Ljava.lang.String;>;, null, null, 82}\n"
+			+ "capture[LOCAL_VARIABLE_REF]{capture, null, Ljava.util.function.Consumer<Ljava.lang.Integer;>;, capture, null, 82}\n"
+			+ "forEach[METHOD_REF]{, LBug443091;, (Ljava.util.function.Consumer<Ljava.lang.Integer;>;)V, forEach, (in), 88}\n"
+			+ "forEach[METHOD_REF]{, LBug443091;, (Ljava.util.function.Function<Ljava.lang.Integer;Ljava.lang.String;>;)V, forEach, (in), 88}",
+			result);
+
+}
+public void testBug575149_expectRemainingOverloadedMethodsMatchingFilledArguments() throws JavaModelException {
+	this.workingCopies = new ICompilationUnit[1];
+	this.workingCopies[0] = getWorkingCopy(
+			"Completion/src/Bug443091.java",
+			"import java.util.function.Consumer;\n" +
+			"import java.util.function.Function;\n" +
+			"\n" +
+			"public class Bug443091 {\n" +
+			"	private void foo() {\n" +
+			" 		Consumer<Integer> capture = null;\n" +
+			"		forEach(capture, )" +
+			"	}\n" +
+			"	private void forEach(Consumer<Integer> in) {}\n" +
+			"	private void forEach(Consumer<Integer> in, Integer limit) {}\n" +
+			"}\n");
+
+	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+	requestor.allowAllRequiredProposals();
+	String str = this.workingCopies[0].getSource();
+	String completeBehind = "forEach(capture, ";
+	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
+	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+	String result = requestor.getResults();
+	assertResults("finalize[METHOD_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, 47}\n"
+			+ "foo[METHOD_REF]{foo(), LBug443091;, ()V, foo, null, 47}\n"
+			+ "forEach[METHOD_REF]{forEach(), LBug443091;, (Ljava.util.function.Consumer<Ljava.lang.Integer;>;)V, forEach, (in), 47}\n"
+			+ "notify[METHOD_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, 47}\n"
+			+ "notifyAll[METHOD_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, 47}\n"
+			+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, 47}\n"
+			+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (J)V, wait, (millis), 47}\n"
+			+ "wait[METHOD_REF]{wait(), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), 47}\n"
+			+ "Bug443091[TYPE_REF]{Bug443091, , LBug443091;, null, null, 52}\n"
+			+ "capture[LOCAL_VARIABLE_REF]{capture, null, Ljava.util.function.Consumer<Ljava.lang.Integer;>;, capture, null, 52}\n"
+			+ "clone[METHOD_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, 52}\n"
+			+ "equals[METHOD_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), 52}\n"
+			+ "getClass[METHOD_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class<*>;, getClass, null, 52}\n"
+			+ "toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, 52}\n"
+			+ "hashCode[METHOD_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, 72}\n"
+			+ "Integer[TYPE_REF]{Integer, java.lang, Ljava.lang.Integer;, null, null, 82}\n"
+			+ "forEach[METHOD_REF]{, LBug443091;, (Ljava.util.function.Consumer<Ljava.lang.Integer;>;Ljava.lang.Integer;)V, forEach, (in, limit), 83}",
+			result);
+
+}
 }
diff --git a/org.eclipse.jdt.core/.settings/.api_filters b/org.eclipse.jdt.core/.settings/.api_filters
index a742ed6..57a8701 100644
--- a/org.eclipse.jdt.core/.settings/.api_filters
+++ b/org.eclipse.jdt.core/.settings/.api_filters
@@ -1,13 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <component id="org.eclipse.jdt.core" version="2">
-    <resource path="META-INF/MANIFEST.MF">
-        <filter id="931135546">
-            <message_arguments>
-                <message_argument value="3.27.50"/>
-                <message_argument value="3.26.0"/>
-            </message_arguments>
-        </filter>
-    </resource>
     <resource path="compiler/org/eclipse/jdt/core/compiler/CategorizedProblem.java" type="org.eclipse.jdt.core.compiler.CategorizedProblem">
         <filter comment="Java 14" id="576725006">
             <message_arguments>
@@ -77,16 +69,151 @@
             </message_arguments>
         </filter>
     </resource>
-    <resource path="dom/org/eclipse/jdt/core/dom/AST.java" type="org.eclipse.jdt.core.dom.AST">
-        <filter comment="This should have the latest value" id="388194388">
+    <resource path="compiler/org/eclipse/jdt/core/compiler/IProblem.java" type="org.eclipse.jdt.core.compiler.IProblem">
+        <filter id="388194388">
             <message_arguments>
-                <message_argument value="org.eclipse.jdt.core.dom.AST"/>
-                <message_argument value="JLS_Latest"/>
-                <message_argument value="15"/>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="IllegalModifierForLocalEnumDeclaration"/>
+                <message_argument value="2098918"/>
             </message_arguments>
         </filter>
         <filter id="388194388">
             <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="LocalStaticsIllegalVisibilityModifierForInterfaceLocalType"/>
+                <message_argument value="2098917"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedAnonymousClassCannotExtendSealedType"/>
+                <message_argument value="2099017"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedDisAllowedNonSealedModifierInClass"/>
+                <message_argument value="2099003"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedDisAllowedNonSealedModifierInInterface"/>
+                <message_argument value="2099014"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedDuplicateTypeInPermits"/>
+                <message_argument value="2099008"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedInterfaceIsSealedAndNonSealed"/>
+                <message_argument value="2099013"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedLocalDirectSuperTypeSealed"/>
+                <message_argument value="2099016"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedMissingClassModifier"/>
+                <message_argument value="2099002"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedMissingInterfaceModifier"/>
+                <message_argument value="2099007"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedMissingSealedModifier"/>
+                <message_argument value="2099006"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedNotDirectSuperClass"/>
+                <message_argument value="2099009"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedNotDirectSuperInterface"/>
+                <message_argument value="2099015"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedPermittedTypeOutsideOfModule"/>
+                <message_argument value="2099010"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedPermittedTypeOutsideOfPackage"/>
+                <message_argument value="2099011"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedSealedTypeMissingPermits"/>
+                <message_argument value="2099012"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedSuperClassDoesNotPermit"/>
+                <message_argument value="2099004"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedSuperInterfaceDoesNotPermit"/>
+                <message_argument value="2099005"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedSuperTypeDisallowed"/>
+                <message_argument value="2099019"/>
+            </message_arguments>
+        </filter>
+        <filter comment="Update the errors that are no longer preview" id="388194388">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.compiler.IProblem"/>
+                <message_argument value="SealedSuperTypeInDifferentPackage"/>
+                <message_argument value="2099018"/>
+            </message_arguments>
+        </filter>
+    </resource>
+    <resource path="dom/org/eclipse/jdt/core/dom/AST.java" type="org.eclipse.jdt.core.dom.AST">
+        <filter id="388194388">
+            <message_arguments>
                 <message_argument value="org.eclipse.jdt.core.dom.AST"/>
                 <message_argument value="JLS_Latest"/>
                 <message_argument value="16"/>
diff --git a/org.eclipse.jdt.core/META-INF/MANIFEST.MF b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
index 1d98161..ba44e25 100644
--- a/org.eclipse.jdt.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.core; singleton:=true
-Bundle-Version: 3.27.50.OTDT_r282_qualifier
+Bundle-Version: 3.28.0.OTDT_r282_qualifier
 Bundle-Activator: org.eclipse.jdt.core.JavaCore
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
index b665a01..8b51a6b 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
@@ -881,6 +881,9 @@
 	private int foundConstructorsCount;
 	private ObjectVector acceptedConstructors;
 
+	// Introduce to disable Bug575149
+	private static final boolean DISABLE_OVERLOAD_EXPERIMENT = Boolean.parseBoolean(System.getProperty("org.eclipse.jdt.disableOverloadExperiment", "false")); //$NON-NLS-1$ //$NON-NLS-2$
+
 	/**
 	 * The CompletionEngine is responsible for computing source completions.
 	 *
@@ -2029,7 +2032,7 @@
 		} else if (astNode instanceof CompletionOnMethodReturnType) {
 			completionOnMethodReturnType(astNode, scope);
 		} else if (astNode instanceof CompletionOnSingleNameReference) {
-			completionOnSingleNameReference(astNode, astNodeParent, scope, insideTypeAnnotation);
+			completionOnSingleNameReference(astNode, astNodeParent, scope, insideTypeAnnotation, qualifiedBinding);
 		} else if (astNode instanceof CompletionOnProvidesInterfacesQualifiedTypeReference) {
 			completionOnProvidesInterfacesQualifiedTypeReference(astNode, astNodeParent, qualifiedBinding, scope);
 		} else if (astNode instanceof CompletionOnProvidesInterfacesSingleTypeReference) {
@@ -3305,9 +3308,9 @@
 		CompletionOnMessageSend messageSend = (CompletionOnMessageSend) astNode;
 		TypeBinding[] argTypes = computeTypes(messageSend.arguments);
 		this.completionToken = messageSend.selector;
+		ObjectVector methodsFound = new ObjectVector();
 		if (qualifiedBinding == null) {
 			if (!this.requestor.isIgnored(CompletionProposal.METHOD_REF)) {
-				ObjectVector methodsFound = new ObjectVector();
 
 				findImplicitMessageSends(this.completionToken, argTypes, scope, messageSend, scope, methodsFound);
 
@@ -3329,7 +3332,7 @@
 				argTypes,
 				(ReferenceBinding)((ReferenceBinding) qualifiedBinding).capture(scope, messageSend.receiver.sourceStart, messageSend.receiver.sourceEnd),
 				scope,
-				new ObjectVector(),
+				methodsFound,
 				false,
 				true,
 				messageSend,
@@ -3345,6 +3348,30 @@
 				-1,
 				-1);
 		}
+
+		if(this.assistNodeInJavadoc > 0 || DISABLE_OVERLOAD_EXPERIMENT) {
+			return;
+		}
+		// find completions for first parameters of matching overloaded methods.
+		CompletionOnSingleNameReference name = new CompletionOnSingleNameReference(new char[0], (((long)(messageSend.sourceEnd + 1)) << 32) + (messageSend.sourceEnd + 1), false);
+
+		MessageSend send = new MessageSend();
+		send.receiver = messageSend.receiver;
+		send.typeArguments = messageSend.typeArguments;
+		send.bits = messageSend.bits;
+		send.sourceStart = messageSend.sourceStart;
+		send.sourceEnd = messageSend.sourceEnd;
+		send.selector = messageSend.selector;
+		send.arguments = messageSend.arguments;
+		send.resolveType((BlockScope) scope);
+
+		computeExpectedTypes(send, name, scope);
+		if(this.expectedTypesPtr > -1) {
+			// rest of the completion logic must based on first argument completion with the following positions
+			this.startPosition = this.endPosition = name.sourceStart;
+			this.tokenStart = this.tokenEnd = name.sourceStart;
+			completionOnSingleNameReference(name, messageSend, scope, false, qualifiedBinding, methodsFound);
+		}
 	}
 
 	private void completionOnMessageSendName(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
@@ -3900,7 +3927,11 @@
 	}
 
 	private void completionOnSingleNameReference(ASTNode astNode, ASTNode astNodeParent, Scope scope,
-			boolean insideTypeAnnotation) {
+			boolean insideTypeAnnotation, Binding qualifiedBinding) {
+		completionOnSingleNameReference(astNode, astNodeParent, scope, insideTypeAnnotation, qualifiedBinding, new ObjectVector());
+	}
+	private void completionOnSingleNameReference(ASTNode astNode, ASTNode astNodeParent, Scope scope,
+			boolean insideTypeAnnotation, Binding qualifiedBinding, ObjectVector methodsFound) {
 		CompletionOnSingleNameReference singleNameReference = (CompletionOnSingleNameReference) astNode;
 		this.completionToken = singleNameReference.token;
 		SwitchStatement switchStatement = astNodeParent instanceof SwitchStatement ? (SwitchStatement) astNodeParent : null;
@@ -3972,13 +4003,28 @@
 
 			checkCancel();
 
+			if(!DISABLE_OVERLOAD_EXPERIMENT && this.assistNodeInJavadoc == 0 && singleNameReference.token.length == 0
+					&& methodsFound.size() == 0	&& (astNodeParent instanceof MessageSend)) {
+				MessageSend message = (MessageSend) astNodeParent;
+
+				// find only overloads by performing a exact match
+				findMethods(message.selector, null, computeTypes(message.arguments),
+						(ReferenceBinding)((ReferenceBinding) message.actualReceiverType).capture(scope, message.receiver.sourceStart, message.receiver.sourceEnd),
+						scope, methodsFound, false, true, message, scope,
+						false, message.receiver instanceof SuperReference,
+						false,
+						null, null, null,
+						false, null,
+						-1, -1);
+			}
+
 			findVariablesAndMethods(
 				this.completionToken,
 				scope,
 				singleNameReference,
 				scope,
 				insideTypeAnnotation,
-				singleNameReference.isInsideAnnotationAttribute);
+				singleNameReference.isInsideAnnotationAttribute, methodsFound);
 
 //{ObjectTeams: following analyses don't apply to base/tsuper calls:
 			if (isBaseAccess(singleNameReference) || isTSuperAccess(singleNameReference))
@@ -4634,7 +4680,7 @@
 			}
 		}
 
-		if(this.expectedTypesPtr + 1 != this.expectedTypes.length) {
+		if(this.expectedTypesPtr > -1 && this.expectedTypesPtr + 1 != this.expectedTypes.length) {
 			System.arraycopy(this.expectedTypes, 0, this.expectedTypes = new TypeBinding[this.expectedTypesPtr + 1], 0, this.expectedTypesPtr + 1);
 		}
 	}
@@ -4686,9 +4732,6 @@
 		InvocationSite invocationSite,
 		boolean isStatic) {
 
-		if (arguments == null)
-			return;
-
 		MethodBinding[] methods = binding.availableMethods();
 		nextMethod : for (int i = 0; i < methods.length; i++) {
 			MethodBinding method = methods[i];
@@ -4706,24 +4749,30 @@
 			if(!CharOperation.equals(method.selector, selector)) continue nextMethod;
 
 			TypeBinding[] parameters = method.parameters;
-			if(parameters.length < arguments.length)
+			if(method.parameters.length == 0) {
 				continue nextMethod;
-
-			int length = arguments.length - 1;
-			int completionArgIndex = arguments.length - 1;
-
-			for (int j = 0; j < length; j++) {
-				Expression argument = arguments[j];
-				TypeBinding argType = argument.resolvedType;
-				if(argType != null && !argType.erasure().isCompatibleWith(parameters[j].erasure()))
-					continue nextMethod;
-
-				if((argument.sourceStart >= this.startPosition)
-						&& (argument.sourceEnd <= this.endPosition)) {
-					completionArgIndex = j;
-				}
 			}
 
+			int completionArgIndex = 0;
+			if(arguments != null) {
+				if(parameters.length < arguments.length)
+					continue nextMethod;
+
+				int length = arguments.length - 1;
+				completionArgIndex = arguments.length - 1;
+
+				for (int j = 0; j < length; j++) {
+					Expression argument = arguments[j];
+					TypeBinding argType = argument.resolvedType;
+					if(argType != null && !argType.erasure().isCompatibleWith(parameters[j].erasure()))
+						continue nextMethod;
+
+					if((argument.sourceStart >= this.startPosition)
+							&& (argument.sourceEnd <= this.endPosition)) {
+						completionArgIndex = j;
+					}
+				}
+			}
 			TypeBinding expectedType = method.parameters[completionArgIndex];
 			if(expectedType != null) {
 				addExpectedType(expectedType, scope);
@@ -5141,6 +5190,14 @@
 		return 0;
 	}
 
+	private int computeRelevanceForOverload(MethodBinding method, char[] overloadSelector, boolean completingOverloadedMethod) {
+		if(!DISABLE_OVERLOAD_EXPERIMENT && CharOperation.equals(method.selector, overloadSelector) && completingOverloadedMethod) {
+			return R_METHOD_OVERLOAD;
+		}
+		return 0;
+	}
+
+
 	private long computeTargetedElement(CompletionOnAnnotationOfType fakeNode) {
 		ASTNode annotatedElement = fakeNode.potentialAnnotatedNode;
 
@@ -9688,6 +9745,22 @@
 		int minTypeArgLength = typeArgTypes == null ? 0 : typeArgTypes.length;
 		int minArgLength = argTypes == null ? 0 : argTypes.length;
 
+		// find if the current method in search is an overloaded method.
+		int sameNameCount = 0;
+		boolean currentMethodIsOverloaded = false;
+		if(this.assistNodeInJavadoc == 0) {
+			for (MethodBinding methodBinding : methods) {
+				if(CharOperation.equals(methodName, methodBinding.selector) &&
+						TypeBinding.equalsEquals(receiverType, methodBinding.declaringClass)) {
+					sameNameCount++;
+					if(sameNameCount == 2) {
+						currentMethodIsOverloaded = true;
+						break;
+					}
+				}
+			}
+		}
+
 		next : for (int f = methods.length; --f >= 0;) {
 			MethodBinding method = methods[f];
 
@@ -9953,6 +10026,7 @@
 				relevance += computeRelevanceForMissingElements(missingElementsHaveProblems);
 			}
 			relevance += computeRelevanceForSuper(method, scope, invocationSite);
+			relevance += computeRelevanceForOverload(method, methodName, currentMethodIsOverloaded);
 			this.noProposal = false;
 
 			if (castedReceiver == null) {
@@ -13460,13 +13534,25 @@
 		}
 
 	}
+
+	private void findVariablesAndMethods(
+			char[] token,
+			Scope scope,
+			InvocationSite invocationSite,
+			Scope invocationScope,
+			boolean insideTypeAnnotation,
+			boolean insideAnnotationAttribute) {
+		findVariablesAndMethods(token, scope, invocationSite, invocationScope, insideTypeAnnotation,
+				insideAnnotationAttribute, new ObjectVector());
+	}
+
 	private void findVariablesAndMethods(
 		char[] token,
 		Scope scope,
 		InvocationSite invocationSite,
 		Scope invocationScope,
 		boolean insideTypeAnnotation,
-		boolean insideAnnotationAttribute) {
+		boolean insideAnnotationAttribute, ObjectVector methodsFound) {
 
 		if (token == null)
 			return;
@@ -13480,7 +13566,6 @@
 
 		ObjectVector localsFound = new ObjectVector();
 		ObjectVector fieldsFound = new ObjectVector();
-		ObjectVector methodsFound = new ObjectVector();
 
 		Scope currentScope = scope;
 
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java
index 6e43a84..f412bfd 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/RelevanceConstants.java
@@ -61,4 +61,5 @@
 	int R_FINAL = 3; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346
 	int R_CONSTRUCTOR = 3; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=373409
 	int R_MODULE_DECLARATION = 31;
+	int R_METHOD_OVERLOAD = 32;
 }
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 1ad5b3b..4e56c56 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
@@ -1585,7 +1585,7 @@
 
 	/**
 	 * Modifiers
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	int StrictfpNotRequired = Syntax + Internal + 741;
 
@@ -2840,12 +2840,10 @@
 
 	/* records - end */
 	/* Local and Nested Static Declarations - Begin */
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int LocalStaticsIllegalVisibilityModifierForInterfaceLocalType = PreviewRelated + 1765;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int IllegalModifierForLocalEnumDeclaration = PreviewRelated + 1766;
+	/** @since 3.28 */
+	int LocalStaticsIllegalVisibilityModifierForInterfaceLocalType = TypeRelated + 1765;
+	/** @since 3.28 */
+	int IllegalModifierForLocalEnumDeclaration = TypeRelated + 1766;
 	/* records - end */
 
 
@@ -2866,106 +2864,88 @@
 	 */
 	int PatternVariableRedeclared = Internal + 1784;
 
-	/** @since 3.26
-	 * @noreference */
+	/** @since 3.28
+	 */
 	int DiscouragedValueBasedTypeSynchronization = Internal + 1820;
 
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedMissingClassModifier = PreviewRelated + 1850;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedDisAllowedNonSealedModifierInClass = PreviewRelated + 1851;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedSuperClassDoesNotPermit = PreviewRelated + 1852;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedSuperInterfaceDoesNotPermit = PreviewRelated + 1853;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedMissingSealedModifier = PreviewRelated + 1854;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedMissingInterfaceModifier = PreviewRelated + 1855;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedDuplicateTypeInPermits = PreviewRelated + 1856;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedNotDirectSuperClass = PreviewRelated + 1857;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedPermittedTypeOutsideOfModule = PreviewRelated + 1858;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedPermittedTypeOutsideOfPackage = PreviewRelated + 1859;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedSealedTypeMissingPermits = PreviewRelated + 1860;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedInterfaceIsSealedAndNonSealed = PreviewRelated + 1861;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedDisAllowedNonSealedModifierInInterface = PreviewRelated + 1862;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedNotDirectSuperInterface = PreviewRelated + 1863;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedLocalDirectSuperTypeSealed = PreviewRelated + 1864;
-	/** @since 3.24
-	 * @noreference preview feature error */
-	int SealedAnonymousClassCannotExtendSealedType = PreviewRelated + 1865;
-	/** @since 3.27
-	 * @noreference preview feature error */
-	int SealedSuperTypeInDifferentPackage = PreviewRelated + 1866;
-	/** @since 3.27
-	 * @noreference preview feature error */
-	int SealedSuperTypeDisallowed = PreviewRelated + 1867;
+	/** @since 3.28 */
+	int SealedMissingClassModifier = TypeRelated + 1850;
+	/** @since 3.28 */
+	int SealedDisAllowedNonSealedModifierInClass = TypeRelated + 1851;
+	/** @since 3.28 */
+	int SealedSuperClassDoesNotPermit = TypeRelated + 1852;
+	/** @since 3.28 */
+	int SealedSuperInterfaceDoesNotPermit = TypeRelated + 1853;
+	/** @since 3.28 */
+	int SealedMissingSealedModifier = TypeRelated + 1854;
+	/** @since 3.28 */
+	int SealedMissingInterfaceModifier = TypeRelated + 1855;
+	/** @since 3.28 */
+	int SealedDuplicateTypeInPermits = TypeRelated + 1856;
+	/** @since 3.28 */
+	int SealedNotDirectSuperClass = TypeRelated + 1857;
+	/** @since 3.28 */
+	int SealedPermittedTypeOutsideOfModule = TypeRelated + 1858;
+	/** @since 3.28 */
+	int SealedPermittedTypeOutsideOfPackage = TypeRelated + 1859;
+	/** @since 3.28 */
+	int SealedSealedTypeMissingPermits = TypeRelated + 1860;
+	/** @since 3.28 */
+	int SealedInterfaceIsSealedAndNonSealed = TypeRelated + 1861;
+	/** @since 3.28 */
+	int SealedDisAllowedNonSealedModifierInInterface = TypeRelated + 1862;
+	/** @since 3.28 */
+	int SealedNotDirectSuperInterface = TypeRelated + 1863;
+	/** @since 3.28 */
+	int SealedLocalDirectSuperTypeSealed = TypeRelated + 1864;
+	/** @since 3.28 */
+	int SealedAnonymousClassCannotExtendSealedType = TypeRelated + 1865;
+	/** @since 3.28 */
+	int SealedSuperTypeInDifferentPackage = TypeRelated + 1866;
+	/** @since 3.28 */
+	int SealedSuperTypeDisallowed = TypeRelated + 1867;
 	/* Java15 errors - end */
 
 	/**
-	 * @since 3.27
+	 * @since 3.28
 	 * @noreference preview feature error
 	 */
 	int LocalReferencedInGuardMustBeEffectivelyFinal = PreviewRelated + 1900;
-	/** @since 3.27
+	/** @since 3.28
 	 * @noreference preview feature error */
 	int ConstantWithPatternIncompatible = PreviewRelated + 1901;
 	/**
-	 * @since 3.27
+	 * @since 3.28
 	 * @noreference preview feature error
 	 */
 	int IllegalFallthroughToPattern = PreviewRelated + 1902;
 
-	/** @since 3.27
+	/** @since 3.28
 	 * @noreference preview feature error */
 	int OnlyOnePatternCaseLabelAllowed = PreviewRelated + 1903;
-	/** @since 3.27
+	/** @since 3.28
 	 * @noreference preview feature error */
 	int CannotMixPatternAndDefault = PreviewRelated + 1904;
-	/** @since 3.27
+	/** @since 3.28
 	 * @noreference preview feature error */
 	int CannotMixNullAndNonTypePattern = PreviewRelated + 1905;
-	/** @since 3.27
+	/** @since 3.28
 	 * @noreference preview feature error */
 	int PatternDominated = PreviewRelated + 1906;
-	/** @since 3.27
+	/** @since 3.28
 	 * @noreference preview feature error */
 	int IllegalTotalPatternWithDefault = PreviewRelated + 1907;
-	/** @since 3.27
+	/** @since 3.28
 	 * @noreference preview feature error */
 	int EnhancedSwitchMissingDefault = PreviewRelated + 1908;
-	/** @since 3.27
+	/** @since 3.28
 	 * @noreference preview feature error */
 	int DuplicateTotalPattern = PreviewRelated + 1909;
 
-	/** @since 3.27
+	/** @since 3.28
 	 * @noreference preview feature error */
 	int UnnecessaryNullCaseInSwitchOverNonNull = PreviewRelated + 1910;
-	/** @since 3.27
+	/** @since 3.28
 	 * @noreference preview feature error */
 	int UnexpectedTypeinSwitchPattern = PreviewRelated + 1911;
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
index 1848306..ea14a84 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
@@ -369,10 +369,9 @@
 		new char[] {'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000'};
 	static final int TableSize = 30, InternalTableSize = 6; //30*6 =210 entries
 
-	public static final int OptimizedLength = 7;
-//{ObjectTeams: really static:
-	public static final char[][][][] charArray_length;
-// SH}
+	public static final int OptimizedLength = 6;
+	public /*static*/ final char[][][][] charArray_length =
+		new char[OptimizedLength - 1][TableSize][InternalTableSize][];
 	// support for detecting non-externalized string literals
 	public static final char[] TAG_PREFIX= "//$NON-NLS-".toCharArray(); //$NON-NLS-1$
 	public static final int TAG_PREFIX_LENGTH= TAG_PREFIX.length;
@@ -393,26 +392,15 @@
 	// generic support
 	public boolean returnOnlyGreater = false;
 
-//{ObjectTeams: really static:
-	static int si,sj,k; // fields so IBM JVM has no chance to optimize out wrongly
-	static {
-		// predictable initialization:
-		charArray_length =
-			new char[OptimizedLength][TableSize][InternalTableSize][];
-		for (si = 0; si < 6; si++) {
-			for (sj = 0; sj < TableSize; sj++) {
-				for (k = 0; k < InternalTableSize; k++) {
-// debug:
-//System.out.print("i="+i+", j="+j+", k="+k+"; O="+OptimizedLength+", T="+TableSize+", I="+InternalTableSize);
-//System.out.print(", l0="+charArray_length.length);
-//System.out.print(", l1="+charArray_length[i].length);
-//System.out.println(", l2="+charArray_length[i][j].length);
-					charArray_length[si][sj][k] = initCharArray;
+	/*static*/ {
+		for (int i = 0; i < OptimizedLength - 1; i++) {
+			for (int j = 0; j < TableSize; j++) {
+				for (int k = 0; k < InternalTableSize; k++) {
+					this.charArray_length[i][j][k] = initCharArray;
 				}
 			}
 		}
 	}
-// SH}
 	/*static*/ int newEntry2 = 0,
 		newEntry3 = 0,
 		newEntry4 = 0,
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.java
index 90aadc8..b56a3a4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Util.java
@@ -1021,17 +1021,13 @@
 			return;
 		}
 		*/
-		BufferedOutputStream output = new BufferedOutputStream(file, DEFAULT_WRITING_SIZE);
-//		BufferedOutputStream output = new BufferedOutputStream(file);
-		try {
+		try (BufferedOutputStream output = new BufferedOutputStream(file, DEFAULT_WRITING_SIZE);) {
 			// if no IOException occured, output cannot be null
 			output.write(classFile.header, 0, classFile.headerOffset);
 			output.write(classFile.contents, 0, classFile.contentsOffset);
 			output.flush();
 		} catch(IOException e) {
 			throw e;
-		} finally {
-			output.close();
 		}
 	}
 	@SuppressWarnings({ "rawtypes", "unchecked" })
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java
index 2e95ec5..48b07d3 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java
@@ -391,7 +391,7 @@
 	 * up to and including Java SE 17(aka JDK 17).
 	 * </p>
 	 *
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public static final int JLS17 = 17;
 
@@ -1724,7 +1724,7 @@
 	 * Creates and returns a new unparented default case expression node.
 	 *
 	 * @return a new unparented default case expression node
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public CaseDefaultExpression newCaseDefaultExpression() {
 		CaseDefaultExpression result = new CaseDefaultExpression(this);
@@ -2087,7 +2087,7 @@
 	 * unspecified pattern variable name and a null expression.
 	 *
 	 * @return a new unparented guarded pattern node
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public GuardedPattern newGuardedPattern() {
 		GuardedPattern result = new GuardedPattern(this);
@@ -2675,7 +2675,7 @@
 	 * Creates and returns a new unparented null pattern node .
 	 *
 	 * @return a new unparented null pattern node
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public NullPattern newNullPattern() {
 		NullPattern result = new NullPattern(this);
@@ -3315,7 +3315,7 @@
 	 * unspecified pattern variable.
 	 *
 	 * @return a new unparented type pattern node
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public TypePattern newTypePattern() {
 		TypePattern result = new TypePattern(this);
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java
index 1d2f4d3..666b966 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java
@@ -504,7 +504,7 @@
 	 * @return <code>true</code> if the subtree matches, or
 	 *   <code>false</code> if they do not match or the other object has a
 	 *   different node type or is <code>null</code>
-	 *  @since 3.27
+	 *  @since 3.28
 	 */
 	public boolean match(CaseDefaultExpression node, Object other) {
 		if (!(other instanceof CaseDefaultExpression)) {
@@ -856,7 +856,7 @@
 	 * @return <code>true</code> if the subtree matches, or
 	 *   <code>false</code> if they do not match or the other object has a
 	 *   different node type or is <code>null</code>
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public boolean match(GuardedPattern node, Object other) {
 		if (!(other instanceof GuardedPattern)) {
@@ -1423,7 +1423,7 @@
 	 * @return <code>true</code> if the subtree matches, or
 	 *   <code>false</code> if they do not match or the other object has a
 	 *   different node type or is <code>null</code>
-	 *  @since 3.27
+	 *  @since 3.28
 	 */
 	public boolean match(NullPattern node, Object other) {
 		if (!(other instanceof NullPattern)) {
@@ -2833,7 +2833,7 @@
 	 * @return <code>true</code> if the subtree matches, or
 	 *   <code>false</code> if they do not match or the other object has a
 	 *   different node type or is <code>null</code>
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public boolean match(TypePattern node, Object other) {
 		if (!(other instanceof TypePattern)) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
index d49aacb..d32faed 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java
@@ -1008,7 +1008,7 @@
 	 * Node type constant indicating a node of type
 	 * <code>TypePattern</code>.
 	 * @see TypePattern
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public static final int TYPE_PATTERN = 106;
 
@@ -1016,7 +1016,7 @@
 	 * Node type constant indicating a node of type
 	 * <code>GuardedPattern</code>.
 	 * @see GuardedPattern
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public static final int GUARDED_PATTERN = 107;
 
@@ -1024,7 +1024,7 @@
 	 * Node type constant indicating a node of type
 	 * <code>NullPattern</code>.
 	 * @see NullPattern
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public static final int NULL_PATTERN = 108;
 
@@ -1032,7 +1032,7 @@
 	 * Node type constant indicating a node of type
 	 * <code>CaseDefaultExpression</code>.
 	 * @see CaseDefaultExpression
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public static final int CASE_DEFAULT_EXPRESSION = 109;
 
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
index 97ab6d0..e60ae78 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
@@ -1154,12 +1154,8 @@
 							} catch(JavaModelException e) {
 								// an error occured accessing the java element
 								StringWriter stringWriter = new StringWriter();
-								PrintWriter writer = null;
-								try {
-									writer = new PrintWriter(stringWriter);
+								try (PrintWriter writer = new PrintWriter(stringWriter)) {
 									e.printStackTrace(writer);
-								} finally {
-									if (writer != null) writer.close();
 								}
 								throw new IllegalStateException(String.valueOf(stringWriter.getBuffer()));
 							}
@@ -1228,12 +1224,8 @@
 						} catch(JavaModelException e) {
 							// an error occured accessing the java element
 							StringWriter stringWriter = new StringWriter();
-							PrintWriter writer = null;
-							try {
-								writer = new PrintWriter(stringWriter);
+							try (PrintWriter writer = new PrintWriter(stringWriter)) {
 								e.printStackTrace(writer);
-							} finally {
-								if (writer != null) writer.close();
 							}
 							throw new IllegalStateException(String.valueOf(stringWriter.getBuffer()));
 						}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java
index b634f41..c53eb0c 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java
@@ -397,7 +397,7 @@
 	 * @return <code>true</code> if the children of this node should be
 	 * visited, and <code>false</code> if the children of this node should
 	 * be skipped
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public boolean visit(CaseDefaultExpression node) {
 		return true;
@@ -757,7 +757,7 @@
 	 * @return <code>true</code> if the children of this node should be
 	 * visited, and <code>false</code> if the children of this node should
 	 * be skipped
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public boolean visit(GuardedPattern node) {
 		return true;
@@ -1174,7 +1174,7 @@
 	 * @return <code>true</code> if the children of this node should be
 	 * visited, and <code>false</code> if the children of this node should
 	 * be skipped
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public boolean visit(NullPattern node) {
 		return true;
@@ -1852,7 +1852,7 @@
 	 * @return <code>true</code> if the children of this node should be
 	 * visited, and <code>false</code> if the children of this node should
 	 * be skipped
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public boolean visit(TypePattern node) {
 		return true;
@@ -2289,7 +2289,7 @@
 	 * </p>
 	 *
 	 * @param node the node to visit
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public void endVisit(CaseDefaultExpression node) {
 		// default implementation: do nothing
@@ -2549,7 +2549,7 @@
 	 * </p>
 	 *
 	 * @param node the node to visit
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public void endVisit(GuardedPattern node) {
 		// default implementation: do nothing
@@ -2835,7 +2835,7 @@
 	 * </p>
 	 *
 	 * @param node the node to visit
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public void endVisit(NullPattern node) {
 		// default implementation: do nothing
@@ -3344,7 +3344,7 @@
 	 * </p>
 	 *
 	 * @param node the node to visit
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public void endVisit(TypePattern node) {
 		// default implementation: do nothing
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java
index e82d552..05daab4 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java
@@ -1159,7 +1159,7 @@
 	/**
 	 * A character index into the original restricted identifier source string, or <code>-1</code> if no restricted
 	 * identifier source position information is available for this node; <code>-1</code> by default.
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public void setRestrictedIdentifierStartPosition(int restrictedIdentifierStartPosition) {
 		if (restrictedIdentifierStartPosition < 0) {
@@ -1174,7 +1174,7 @@
 	/**
 	 * A character index into the original restricted identifier source string, or <code>-1</code> if no restricted
 	 * identifier source position information is available for this node; <code>-1</code> by default.
-	 * @since 3.27
+	 * @since 3.28
 	 */
 	public int getRestrictedIdentifierStartPosition() {
 		return this.restrictedIdentifierStartPosition;
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java
index e116360..36d8172 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java
@@ -83,6 +83,7 @@
 import org.eclipse.jdt.core.dom.ParameterMapping;
 import org.eclipse.jdt.core.dom.ParameterizedType;
 import org.eclipse.jdt.core.dom.ParenthesizedExpression;
+import org.eclipse.jdt.core.dom.PatternInstanceofExpression;
 import org.eclipse.jdt.core.dom.PostfixExpression;
 import org.eclipse.jdt.core.dom.PrefixExpression;
 import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
@@ -1174,6 +1175,12 @@
 	}
 
 	@Override
+	public boolean visit(PatternInstanceofExpression node) {
+		handleTokenAfter(node.getLeftOperand(), TokenNameinstanceof, true, true);
+		return true;
+	}
+
+	@Override
 	public boolean visit(ModuleDeclaration node) {
 		handleToken(node.getName(), TokenNameLBRACE,
 				this.options.insert_space_before_opening_brace_in_type_declaration, false);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
index 75a142a..3350fd4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
@@ -3168,7 +3168,7 @@
 	public static final String VERSION_16 = "16"; //$NON-NLS-1$
 	/**
 	 * Configurable option value: {@value}.
-	 * @since 3.27
+	 * @since 3.28
 	 * @category OptionValue
 	 */
 	public static final String VERSION_17 = "17"; //$NON-NLS-1$
@@ -4631,7 +4631,7 @@
 				}
 			}
 		} finally {
-			manager.batchContainerInitializationsProgress.initializeAfterLoadMonitor.set(null);
+			manager.batchContainerInitializationsProgress.initializeAfterLoadMonitor.remove();
 		}
 
 		// avoid leaking source attachment properties (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=183413 )
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BufferCache.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BufferCache.java
index bb84927..043f930 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BufferCache.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BufferCache.java
@@ -62,7 +62,7 @@
 		List<IBuffer> buffers = this.buffersToClose.get();
 		if (buffers == null)
 			return;
-		this.buffersToClose.set(null);
+		this.buffersToClose.remove();
 		for (int i = 0, length = buffers.size(); i < length; i++) {
 			buffers.get(i).close();
 		}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathChange.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathChange.java
index f569df8..bca0333 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathChange.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathChange.java
@@ -375,7 +375,7 @@
 					} catch (JavaModelException e) {
 						pkgFragmentRoots =  new PackageFragmentRoot[] {};
 					} finally {
-						JrtPackageFragmentRoot.workingOnOldClasspath.set(null);
+						JrtPackageFragmentRoot.workingOnOldClasspath.remove();
 					}
 				}
 				addClasspathDeltas(delta, pkgFragmentRoots, IJavaElementDelta.F_REMOVED_FROM_CLASSPATH);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java
index e14ff60..c01127e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java
@@ -699,7 +699,7 @@
 						new IOException(e.getMessage());
 				throw new AbortCompilationUnit(null, ioException, encoding);
 			} else {
-				Util.log(e, Messages.bind(Messages.file_notFound, file.getFullPath().toString()));
+				Util.log(e);
 			}
 			return CharOperation.NO_CHAR;
 		}
@@ -1161,7 +1161,7 @@
 			return null;
 		}
 	} finally {
-		JavaModelManager.getJavaModelManager().abortOnMissingSource.set(null);
+		JavaModelManager.getJavaModelManager().abortOnMissingSource.remove();
 	}
 }
 /**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessingState.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessingState.java
index d22b1c0..70d6bf8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessingState.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessingState.java
@@ -84,7 +84,7 @@
 	public void doNotUse() {
 		// reset the delta processor of the current thread to avoid to keep it in memory
 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=269476
-		this.deltaProcessors.set(null);
+		this.deltaProcessors.remove();
 	}
 
 	/* A table from IPath (from a classpath entry) to DeltaProcessor.RootInfo */
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 9fbda9f..72da45e 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
@@ -718,7 +718,7 @@
 		if (perPathContainers.size() == 0)
 			perProjectContainers.remove(project);
 		if (perProjectContainers.size() == 0)
-			this.containersBeingInitialized.set(null);
+			this.containersBeingInitialized.remove();
 		return container;
 	}
 
@@ -926,7 +926,7 @@
 		if (projectInitializations.size() == 0)
 			initializations.remove(project);
 		if (initializations.size() == 0)
-			this.containerInitializationInProgress.set(null);
+			this.containerInitializationInProgress.remove();
 	}
 
 	private synchronized void containersReset(String[] containerIDs) {
@@ -2036,7 +2036,7 @@
 		// the owner will be responsible for flushing the cache
 		// we want to check object identity to make sure this is the owner that created the cache
 		if (zipCache.owner == owner) {
-			this.zipFiles.set(null);
+			this.zipFiles.remove();
 			zipCache.flush();
 		} else {
 			if (JavaModelManager.ZIP_ACCESS_VERBOSE) {
@@ -3058,7 +3058,7 @@
 							while (perProjectContainers != null && !perProjectContainers.isEmpty()) {
 								initKnownContainers(perProjectContainers, monitor);
 							}
-							JavaModelManager.this.containersBeingInitialized.set(null);
+							JavaModelManager.this.containersBeingInitialized.remove();
 						} finally {
 							if (monitor != null)
 								monitor.done();
@@ -3109,7 +3109,7 @@
 				// if we're being traversed by an exception, ensure that that containers are
 				// no longer marked as initialization in progress
 				// (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=66437)
-				this.containerInitializationInProgress.set(null);
+				this.containerInitializationInProgress.remove();
 			}
 		}
 
@@ -4112,22 +4112,17 @@
 	protected Object readState(IProject project) throws CoreException {
 		File file = getSerializationFile(project);
 		if (file != null && file.exists()) {
-			try {
-				DataInputStream in= new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
-				try {
-					String pluginID= in.readUTF();
-					if (!pluginID.equals(JavaCore.PLUGIN_ID))
-						throw new IOException(Messages.build_wrongFileFormat);
-					String kind= in.readUTF();
-					if (!kind.equals("STATE")) //$NON-NLS-1$
-						throw new IOException(Messages.build_wrongFileFormat);
-					if (in.readBoolean())
-						return JavaBuilder.readState(project, in);
-					if (JavaBuilder.DEBUG)
-						System.out.println("Saved state thinks last build failed for " + project.getName()); //$NON-NLS-1$
-				} finally {
-					in.close();
-				}
+			try (DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(file)))) {
+				String pluginID = in.readUTF();
+				if (!pluginID.equals(JavaCore.PLUGIN_ID))
+					throw new IOException(Messages.build_wrongFileFormat);
+				String kind = in.readUTF();
+				if (!kind.equals("STATE")) //$NON-NLS-1$
+					throw new IOException(Messages.build_wrongFileFormat);
+				if (in.readBoolean())
+					return JavaBuilder.readState(project, in);
+				if (JavaBuilder.DEBUG)
+					System.out.println("Saved state thinks last build failed for " + project.getName()); //$NON-NLS-1$
 			} catch (Exception e) {
 				e.printStackTrace();
 				throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, "Error reading last build state for project "+ project.getName(), e)); //$NON-NLS-1$
@@ -4314,7 +4309,7 @@
 	 * Resets the temporary cache for newly created elements to null.
 	 */
 	public void resetTemporaryCache() {
-		this.temporaryCache.set(null);
+		this.temporaryCache.remove();
 	}
 
 	/**
@@ -4344,8 +4339,7 @@
 		if (file == null) return;
 		long t = System.currentTimeMillis();
 		try {
-			DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
-			try {
+			try (DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)))) {
 				out.writeUTF(JavaCore.PLUGIN_ID);
 				out.writeUTF("STATE"); //$NON-NLS-1$
 				if (info.savedState == null) {
@@ -4354,8 +4348,6 @@
 					out.writeBoolean(true);
 					JavaBuilder.writeState(info.savedState, out);
 				}
-			} finally {
-				out.close();
 			}
 		} catch (RuntimeException | IOException e) {
 			try {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelOperation.java
index 6911742..b9c1115 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelOperation.java
@@ -618,7 +618,7 @@
 		int size = stack.size();
 		if (size > 0) {
 			if (size == 1) { // top level operation
-				OPERATION_STACKS.set(null); // release reference (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=33927)
+				OPERATION_STACKS.remove(); // release reference (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=33927)
 			}
 			return (JavaModelOperation)stack.remove(size-1);
 		} else {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
index d48e80f..f72b975 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
@@ -529,9 +529,10 @@
 			return "JavaModelStatus[OK]"; //$NON-NLS-1$
 		}
 		StringBuilder buffer = new StringBuilder();
-		buffer.append("Java Model Status ["); //$NON-NLS-1$
+		buffer.append("Error in Java Model (code "); //$NON-NLS-1$
+		buffer.append(this.getCode());
+		buffer.append("): "); //$NON-NLS-1$
 		buffer.append(getMessage());
-		buffer.append("]"); //$NON-NLS-1$
 		return buffer.toString();
 	}
 }
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.java
index 275306c..99fd941 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.java
@@ -228,7 +228,7 @@
 	    	// else JavaProject has lost its nature (or most likely was closed/deleted) while reconciling -> ignore
 	    	// (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100919)
 	    } finally {
-			JavaModelManager.getJavaModelManager().abortOnMissingSource.set(null);
+			JavaModelManager.getJavaModelManager().abortOnMissingSource.remove();
 	        if (unit != null) {
 	            unit.cleanUp();
 	        }
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java
index 556f63d..cd363a0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.java
@@ -302,7 +302,9 @@
 }
 // SH}
 protected void cleanUp() {
-	this.nameEnvironment.cleanup();
+	if (this.nameEnvironment != null) {
+		this.nameEnvironment.cleanup();
+	}
 
 	this.javaBuilder = null;
 	this.nameEnvironment = null;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
index 4880ccd..413b791 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
@@ -246,10 +246,9 @@
 		new char[] {'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000'};
 	static final int TableSize = 30, InternalTableSize = 6; //30*6 =210 entries
 
-	public static final int OptimizedLength = 7;
-//{ObjectTeams: really static:
-	public static final char[][][][] charArray_length;
-// SH}
+	public static final int OptimizedLength = 6;
+	public /*static*/ final char[][][][] charArray_length =
+		new char[OptimizedLength - 1][TableSize][InternalTableSize][];
 	// support for detecting non-externalized string literals
 	public static final char[] TAG_PREFIX= "//$NON-NLS-".toCharArray(); //$NON-NLS-1$
 	public static final int TAG_PREFIX_LENGTH= TAG_PREFIX.length;
@@ -264,26 +263,16 @@
 	// generic support
 	public boolean returnOnlyGreater = false;
 
-//{ObjectTeams: really static:
-	static int si,sj,sk; // fields so IBM JVM has no chance to optimize out wrongly
-	static {
-		// predictable initialization:
-		charArray_length =
-			new char[OptimizedLength][TableSize][InternalTableSize][];
-		for (si = 0; si < 6; si++) {
-			for (sj = 0; sj < TableSize; sj++) {
-				for (sk = 0; sk < InternalTableSize; sk++) {
-// debug:
-//System.out.print("i="+i+", j="+j+", k="+k+"; O="+OptimizedLength+", T="+TableSize+", I="+InternalTableSize);
-//System.out.print(", l0="+charArray_length.length);
-//System.out.print(", l1="+charArray_length[i].length);
-//System.out.println(", l2="+charArray_length[i][j].length);
-					charArray_length[si][sj][sk] = initCharArray;
+	/*static*/ {
+		for (int i = 0; i < OptimizedLength - 1; i++) {
+			for (int j = 0; j < TableSize; j++) {
+				for (int k = 0; k < InternalTableSize; k++) {
+					this.charArray_length[i][j][k] = initCharArray;
 				}
 			}
 		}
 	}
-// SH}
+
 	/*static*/ int newEntry2 = 0,
 		newEntry3 = 0,
 		newEntry4 = 0,
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java
index 5ebf15c..ffb380d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java
@@ -1954,17 +1954,16 @@
 	}
 
 	public static void log(Throwable e) {
-		log(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Messages.internal_error, e));
+		if (e instanceof CoreException) {
+			log(((CoreException)e).getStatus());
+		} else {
+			log(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Messages.internal_error, e));
+		}
 	}
 
 	public static ClassFileReader newClassFileReader(IResource resource) throws CoreException, ClassFormatException, IOException {
-		InputStream in = null;
-		try {
-			in = ((IFile) resource).getContents(true);
+		try (InputStream in = ((IFile) resource).getContents(true)) {
 			return ClassFileReader.read(in, resource.getFullPath().toString());
-		} finally {
-			if (in != null)
-				in.close();
 		}
 	}
 
diff --git a/org.eclipse.jdt.core/pom.xml b/org.eclipse.jdt.core/pom.xml
index 7f5f1ef..c04798d 100644
--- a/org.eclipse.jdt.core/pom.xml
+++ b/org.eclipse.jdt.core/pom.xml
@@ -14,11 +14,11 @@
   <parent>
     <artifactId>eclipse.jdt.core</artifactId>
     <groupId>eclipse.jdt.core</groupId>
-    <version>4.21.0-SNAPSHOT</version>
+    <version>4.22.0-SNAPSHOT</version>
   </parent>
   <groupId>org.eclipse.jdt</groupId>
   <artifactId>org.eclipse.jdt.core</artifactId>
-  <version>3.27.50-SNAPSHOT</version>
+  <version>3.28.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <properties>
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
index dc1c1a4..4c77e20 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
@@ -259,8 +259,7 @@
 private void cacheDocumentNames() throws IOException {
 	// will need all document names so get them now
 	this.cachedChunks = new String[this.numberOfChunks][];
-	InputStream stream = this.indexLocation.getInputStream();
-	try {
+	try (InputStream stream = this.indexLocation.getInputStream()) {
 		if (this.numberOfChunks > 5) BUFFER_READ_SIZE <<= 1;
 		int offset = this.chunkOffsets[0];
 		stream.skip(offset);
@@ -275,7 +274,6 @@
 		this.cachedChunks = null;
 		throw e;
 	} finally {
-		stream.close();
 		this.indexLocation.close();
 		this.streamBuffer = null;
 		BUFFER_READ_SIZE = DEFAULT_BUFFER_SIZE;
@@ -435,7 +433,7 @@
 	}
 	if (this.indexLocation.createNewFile()) {
 		FileOutputStream stream = new FileOutputStream(this.indexLocation.getIndexFile(), false);
-		try {
+		try (stream) {
 			this.streamBuffer = new byte[BUFFER_READ_SIZE];
 			this.bufferIndex = 0;
 			writeStreamChars(stream, SIGNATURE_CHARS);
@@ -445,8 +443,6 @@
 				stream.write(this.streamBuffer, 0, this.bufferIndex);
 				this.bufferIndex = 0;
 			}
-		} finally {
-			stream.close();
 		}
 	} else {
 		if (DEBUG)
@@ -629,7 +625,7 @@
 		return CharOperation.NO_STRINGS;
 
 	InputStream stream = this.indexLocation.getInputStream();
-	try {
+	try (stream) {
 		int offset = this.chunkOffsets[0];
 		stream.skip(offset);
 		this.streamBuffer = new byte[BUFFER_READ_SIZE];
@@ -641,7 +637,6 @@
 			readChunk(docNames, stream, i * CHUNK_SIZE, i < lastIndex ? CHUNK_SIZE : this.sizeOfLastChunk);
 		return docNames;
 	} finally {
-		stream.close();
 		this.indexLocation.close();
 		this.streamBuffer = null;
 	}
@@ -797,7 +792,7 @@
 		this.streamBuffer = new byte[numberOfBytes];
 		this.bufferIndex = 0;
 		InputStream file = this.indexLocation.getInputStream();
-		try {
+		try (file) {
 			file.skip(start);
 			if (file.read(this.streamBuffer, 0, numberOfBytes) != numberOfBytes)
 				throw new IOException();
@@ -805,7 +800,6 @@
 			this.streamBuffer = null;
 			throw ioe;
 		} finally {
-			file.close();
 			this.indexLocation.close();
 		}
 		int numberOfNames = isLastChunk ? this.sizeOfLastChunk : CHUNK_SIZE;
@@ -827,7 +821,7 @@
 		return (int[]) arrayOffset;
 
 	InputStream stream = this.indexLocation.getInputStream();
-	try {
+	try (stream) {
 		int offset = ((Integer) arrayOffset).intValue();
 		stream.skip(offset);
 		this.streamBuffer = new byte[BUFFER_READ_SIZE];
@@ -835,7 +829,6 @@
 		this.bufferEnd = stream.read(this.streamBuffer, 0, this.streamBuffer.length);
 		return readStreamDocumentArray(stream, readStreamInt(stream));
 	} finally {
-		stream.close();
 		this.indexLocation.close();
 		this.streamBuffer = null;
 	}
@@ -954,6 +947,13 @@
 		// all the characters must already be in the buffer if we're at the end of the stream
 		if (charsInBuffer > length || stream == null  || (this.bufferEnd != this.streamBuffer.length && stream.available() == 0))
 			charsInBuffer = length;
+		{ // optimization for the typical case of pure ASCII chars:
+			byte b;
+			while (i < charsInBuffer && (b = this.streamBuffer[this.bufferIndex]) >= 0) {
+				word[i++] = (char) b;
+				this.bufferIndex++;
+			}
+		}
 		while (i < charsInBuffer) {
 			byte b = this.streamBuffer[this.bufferIndex++];
 			switch (b & 0xF0) {
@@ -1249,12 +1249,10 @@
 private void writeOffsetToHeader(int offsetToHeader) throws IOException {
 	if (offsetToHeader > 0) {
 		RandomAccessFile file = new RandomAccessFile(this.indexLocation.getIndexFile(), "rw"); //$NON-NLS-1$
-		try {
+		try (file) {
 			file.seek(this.headerInfoOffset); // offset to position in header
 			file.writeInt(offsetToHeader);
 			this.headerInfoOffset = offsetToHeader; // update to reflect the correct offset
-		} finally {
-			file.close();
 		}
 	}
 }
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchParticipant.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchParticipant.java
index 149193a..37a4081 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchParticipant.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/JavaSearchParticipant.java
@@ -53,12 +53,12 @@
 	@Override
 	public void beginSearching() {
 		super.beginSearching();
-		this.indexSelector.set(null);
+		this.indexSelector.remove();
 	}
 
 	@Override
 	public void doneSearching() {
-		this.indexSelector.set(null);
+		this.indexSelector.remove();
 		super.doneSearching();
 	}
 
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.java
index f298e30..ebf1d00 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.java
@@ -43,8 +43,7 @@
 		Index index = new Index(indexLocation, pathToJar, false /*reuse index file*/);
 		SearchParticipant participant = SearchEngine.getDefaultSearchParticipant();
 		index.separator = JAR_SEPARATOR;
-		ZipFile zip = new ZipFile(pathToJar);
-		try {
+		try (ZipFile zip = new ZipFile(pathToJar)) {
 			for (Enumeration e = zip.entries(); e.hasMoreElements();) {
 				// iterate each entry to index it
 				ZipEntry ze = (ZipEntry) e.nextElement();
@@ -57,8 +56,6 @@
 				}
 			}
 			index.save();
-		} finally {
-			zip.close();
 		}
 		return;
 	}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchRequestor.java b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchRequestor.java
index f3f532a..2f0174e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchRequestor.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/objectteams/otdt/core/search/OTSearchRequestor.java
@@ -47,7 +47,7 @@
     	this(true);
     }
     /**
-	 * @since 3.27 (OTDT 2.8.2)
+	 * @since 3.28 (OTDT 2.8.2)
 	 */
     public OTSearchRequestor(boolean acceptOrgObjectteamsTeam)
     {