Update jdt.core to I20210503-1800

* re-fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=561820#c12 (JDT)
* adjust syntax error msg
* improve/differentiate keyword completion
  - revert previous test adjustments
  - add more OT-Tests
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java
index 4cbfc2a..16e9146 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java
@@ -5215,9 +5215,19 @@
 		"6. ERROR in X.java (at line 6)\n" +
 		"	return new R(i);\n" +
 		"	              ^\n" +
-		"Syntax error, insert \")\" to complete MethodDeclaration\n" +
+		"Syntax error, insert \")\" to complete MethodSpecLong\n" +
 		"----------\n" +
-		"7. ERROR in X.java (at line 12)\n" +
+		"7. ERROR in X.java (at line 6)\n" +
+		"	return new R(i);\n" +
+		"	              ^\n" +
+		"Syntax error, insert \"<-\" to complete CallinBindingLeft\n" +
+		"----------\n" +
+		"8. ERROR in X.java (at line 6)\n" +
+		"	return new R(i);\n" +
+		"	              ^\n" +
+		"Syntax error, insert \"MethodSpecsLong EmptyParameterMappings\" to complete RecordBodyDeclarations\n" +
+		"----------\n" +
+		"9. ERROR in X.java (at line 12)\n" +
 		"	record.a(1);\n" +
 		"	       ^\n" +
 		"The method a(int) is undefined for the type X.Point\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
index fa21d33..ce80821 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java
@@ -197,9 +197,11 @@
 	 // add 14 specific test here (check duplicates)
 	 ArrayList since_14 = new ArrayList();
 	 since_14.add(SwitchExpressionsYieldTest.class);
+//{ObjectTeams: wrong in JDT
 	 since_14.add(RecordsRestrictedClassTest.class);
 	 since_14.add(PatternMatching16Test.class);
 	 since_14.add(JavadocTestForRecord.class);
+// SH}
 	 since_14.add(BatchCompilerTest_14.class);
 
 	 // add 15 specific test here (check duplicates)
@@ -217,6 +219,11 @@
 	 since_16.add(PreviewFeatureTest.class);
 	 since_16.add(ValueBasedAnnotationTests.class);
 	 since_16.add(BatchCompilerTest_16.class);
+//{ObjectTeams: moved
+	 since_16.add(RecordsRestrictedClassTest.class);
+	 since_16.add(PatternMatching16Test.class);
+	 since_16.add(JavadocTestForRecord.class);
+// SH}
 
 	 // Build final test suite
 	TestSuite all = new TestSuite(TestAll.class.getName());
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests18.java
index b866ff1..83c77c1 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
@@ -299,9 +299,6 @@
 	assertResults(
 			"[POTENTIAL_METHOD_DECLARATION]{, LX;, ()V, , null, " + (R_DEFAULT + 9) + "}\n" +
 			"abstract[KEYWORD]{abstract, null, null, abstract, null, " + (R_DEFAULT + 19) + "}\n" +
-//{ObjectTeams:
-			"callin[KEYWORD]{callin, null, null, callin, null, " + (R_DEFAULT + 19) + "}\n" +
-// SH}
 			"class[KEYWORD]{class, null, null, class, null, " + (R_DEFAULT + 19) + "}\n" +
 			"enum[KEYWORD]{enum, null, null, enum, null, " + (R_DEFAULT + 19) + "}\n" +
 			"final[KEYWORD]{final, null, null, final, null, " + (R_DEFAULT + 19) + "}\n" +
@@ -313,9 +310,6 @@
 			"static[KEYWORD]{static, null, null, static, null, " + (R_DEFAULT + 19) + "}\n" +
 			"strictfp[KEYWORD]{strictfp, null, null, strictfp, null, " + (R_DEFAULT + 19) + "}\n" +
 			"synchronized[KEYWORD]{synchronized, null, null, synchronized, null, " + (R_DEFAULT + 19) + "}\n" +
-//{ObjectTeams:
-			"team[KEYWORD]{team, null, null, team, null, " + (R_DEFAULT + 19) + "}\n" +
-// SH}
 			"transient[KEYWORD]{transient, null, null, transient, null, " + (R_DEFAULT + 19) + "}\n" +
 			"volatile[KEYWORD]{volatile, null, null, volatile, null, " + (R_DEFAULT + 19) + "}\n" +
 			"I[TYPE_REF]{I, , LI;, null, null, " + (R_DEFAULT + 22) + "}\n" +
@@ -353,9 +347,6 @@
 	assertResults(
 			"[POTENTIAL_METHOD_DECLARATION]{, LX;, ()V, , null, " + (R_DEFAULT + 9) + "}\n" +
 			"abstract[KEYWORD]{abstract, null, null, abstract, null, " + (R_DEFAULT + 19) + "}\n" +
-//{ObjectTeams:
-			"callin[KEYWORD]{callin, null, null, callin, null, " + (R_DEFAULT + 19) + "}\n" +
-// SH}
 			"class[KEYWORD]{class, null, null, class, null, " + (R_DEFAULT + 19) + "}\n" +
 			"enum[KEYWORD]{enum, null, null, enum, null, " + (R_DEFAULT + 19) + "}\n" +
 			"final[KEYWORD]{final, null, null, final, null, " + (R_DEFAULT + 19) + "}\n" +
@@ -367,9 +358,6 @@
 			"static[KEYWORD]{static, null, null, static, null, " + (R_DEFAULT + 19) + "}\n" +
 			"strictfp[KEYWORD]{strictfp, null, null, strictfp, null, " + (R_DEFAULT + 19) + "}\n" +
 			"synchronized[KEYWORD]{synchronized, null, null, synchronized, null, " + (R_DEFAULT + 19) + "}\n" +
-//{ObjectTeams:
-			"team[KEYWORD]{team, null, null, team, null, " + (R_DEFAULT + 19) + "}\n" +
-// SH}
 			"transient[KEYWORD]{transient, null, null, transient, null, " + (R_DEFAULT + 19) + "}\n" +
 			"volatile[KEYWORD]{volatile, null, null, volatile, null, " + (R_DEFAULT + 19) + "}\n" +
 			"I[TYPE_REF]{I, , LI;, null, null, " + (R_DEFAULT + 22) + "}\n" +
@@ -3254,9 +3242,6 @@
 	assertResults(
 			"[POTENTIAL_METHOD_DECLARATION]{, LObject;, ()V, , null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
 			"abstract[KEYWORD]{abstract, null, null, abstract, null, "+keywordRelevance+"}\n" +
-//{ObjectTeams:
-			"callin[KEYWORD]{callin, null, null, callin, null, "+keywordRelevance+"}\n" +
-// SH}
 			"class[KEYWORD]{class, null, null, class, null, "+keywordRelevance+"}\n" +
 			"enum[KEYWORD]{enum, null, null, enum, null, "+keywordRelevance+"}\n" +
 			"final[KEYWORD]{final, null, null, final, null, "+keywordRelevance+"}\n" +
@@ -3307,9 +3292,6 @@
 	assertResults(
 			"[POTENTIAL_METHOD_DECLARATION]{, LObject;, ()V, , null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
 			"abstract[KEYWORD]{abstract, null, null, abstract, null, "+keywordRelevance+"}\n" +
-//{ObjectTeams:
-			"callin[KEYWORD]{callin, null, null, callin, null, "+keywordRelevance+"}\n" +
-// SH}
 			"class[KEYWORD]{class, null, null, class, null, "+keywordRelevance+"}\n" +
 			"enum[KEYWORD]{enum, null, null, enum, null, "+keywordRelevance+"}\n" +
 			"final[KEYWORD]{final, null, null, final, null, "+keywordRelevance+"}\n" +
@@ -3321,9 +3303,6 @@
 			"static[KEYWORD]{static, null, null, static, null, "+keywordRelevance+"}\n" +
 			"strictfp[KEYWORD]{strictfp, null, null, strictfp, null, "+keywordRelevance+"}\n" +
 			"synchronized[KEYWORD]{synchronized, null, null, synchronized, null, "+keywordRelevance+"}\n" +
-//{ObjectTeams:
-			"team[KEYWORD]{team, null, null, team, null, "+keywordRelevance+"}\n" +
-// SH}
 			"transient[KEYWORD]{transient, null, null, transient, null, "+keywordRelevance+"}\n" +
 			"volatile[KEYWORD]{volatile, null, null, volatile, null, "+keywordRelevance+"}\n" +
 			"Test[TYPE_REF]{Test, p, Lp.Test;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED + R_CASE + R_UNQUALIFIED)+"}\n" +
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 fb5966a..3e00626 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
@@ -2784,7 +2784,12 @@
 
 		findTypesAndPackages(this.completionToken, scope, true, true, new ObjectVector());
 		if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
+//{ObjectTeams: argument added:
+/* orig:
 			findKeywordsForMember(this.completionToken, field.modifiers, astNode);
+  :giro*/
+			findKeywordsForMember(this.completionToken, field.modifiers, astNode, scope);
+// SH}
 		}
 
 		if (!field.isLocalVariable && field.modifiers == ClassFileConstants.AccDefault) {
@@ -3457,7 +3462,12 @@
 		setSourceAndTokenRange(type.sourceStart, type.sourceEnd);
 		findTypesAndPackages(this.completionToken, scope.parent, true, true, new ObjectVector());
 		if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
+//{ObjectTeams: argument added:
+/* orig:
 			findKeywordsForMember(this.completionToken, method.modifiers, null);
+  :giro */
+			findKeywordsForMember(this.completionToken, method.modifiers, null, scope);
+// SH}
 		}
 
 		if (method.modifiers == ClassFileConstants.AccDefault) {
@@ -3970,7 +3980,12 @@
 				else if ( astNodeParent instanceof InstanceOfExpression) {
 					// propose final keyword
 					if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
+//{ObjectTeams: argument added:
+/* orig:
 						findKeywordsForMember(this.completionToken, (~ClassFileConstants.AccFinal  & 0xFF), astNode);
+  :giro */
+						findKeywordsForMember(this.completionToken, (~ClassFileConstants.AccFinal  & 0xFF), astNode, scope);
+// SH}
 					}
 				}
 
@@ -9190,8 +9205,12 @@
 		// add expected type else final keyword will be buried inside multiple Fin* classes
 		return this.parser.assistNodeParent instanceof InstanceOfExpression ? R_FINAL + R_EXPECTED_TYPE : 0;
 	}
-
+//{ObjectTeams: signature extended:
+/* orig:
 	private void findKeywordsForMember(char[] token, int modifiers, ASTNode astNode) {
+  :giro */
+	private void findKeywordsForMember(char[] token, int modifiers, ASTNode astNode, Scope scope) {
+// SH}
 		char[][] keywords = new char[Keywords.COUNT][];
 		int count = 0;
 
@@ -9273,7 +9292,10 @@
 					keywords[count++] = Keywords.SYNCHRONIZED;
 				}
 //{ObjectTeams: OT specific modifier "callin"
-				if((modifiers & ExtraCompilerModifiers.AccCallin) == 0)	{
+				if((modifiers & ExtraCompilerModifiers.AccCallin) == 0
+						&& scope.enclosingReceiverType() != null
+						&& scope.enclosingReceiverType().isRole())
+				{
 				    keywords[count++] = Keywords.CALLIN;
 				}
 // gbr}
@@ -9281,7 +9303,10 @@
 
 			if(canBeType) {
 //{ObjectTeams: OT specific modifier
-				if((modifiers & ExtraCompilerModifiers.AccTeam) == 0) {
+				if((modifiers & ExtraCompilerModifiers.AccTeam) == 0
+						&& scope.enclosingReceiverType() != null
+						&& scope.enclosingReceiverType().isTeam())
+				{
 				    keywords[count++] = Keywords.TEAM;
 				}
 //gbr}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java
index 0689a65..cf53d77 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java
@@ -102,6 +102,7 @@
  */
 public class CodeCompletionTest {
 
+	private static final int KEYWORD_RELEVANCE = R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_NON_RESTRICTED;
 	private static final int CALLOUT_BASE_RELEVANCE = R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_METHOD_OVERIDE+R_NON_RESTRICTED;
 	private static final int INTERESTING_CALLIN_CALLOUT_PROPOSAL = CompletionAdaptor.R_METHOD_MAPPING * CALLOUT_BASE_RELEVANCE;
 	private static final int VERY_INTERESTING_CALLIN_CALLOUT_PROPOSAL = CompletionAdaptor.R_METHOD_MAPPING * (CALLOUT_BASE_RELEVANCE+R_EXPECTED_TYPE);
@@ -1358,6 +1359,54 @@
 	}
 
 	@Test
+	public void testCallinMethodModifier() throws Exception {
+		createBaseClass("    public void foo() {}\n");
+		assertTypeBodyProposal(
+				"	 	 |",
+				"callin",
+				"	 	 callin",
+				KEYWORD_RELEVANCE);
+	}
+
+	@Test
+	public void testTeamKeywordToplevel() throws Exception {
+		StringBuffer teamContent = new StringBuffer();
+		teamContent.append("package test1;\n");
+		teamContent.append("public  class MyTeam {\n");
+		teamContent.append("}");
+
+		StringBuffer expectedContent = new StringBuffer();
+		expectedContent.append("package test1;\n");
+		expectedContent.append("public team class MyTeam {\n");
+		expectedContent.append("}");
+
+		String completeAfter = "public ";
+		int pos = teamContent.indexOf(completeAfter)+completeAfter.length();
+
+		assertProposal("te", null, null, teamContent, new Region(pos, 0), expectedContent, new Region(pos+4, 0), 0);
+	}
+
+	@Test
+	public void testTeamKeywordNested() throws Exception {
+		StringBuffer teamContent = new StringBuffer();
+		teamContent.append("package test1;\n");
+		teamContent.append("public team class MyTeam {\n");
+		teamContent.append("	protected \n");
+		teamContent.append("}");
+
+		StringBuffer expectedContent = new StringBuffer();
+		expectedContent.append("package test1;\n");
+		expectedContent.append("public team class MyTeam {\n");
+		expectedContent.append("	protected team\n");
+		expectedContent.append("}");
+
+		String completeAfter = "protected ";
+		int pos = teamContent.indexOf(completeAfter)+completeAfter.length();
+
+		assertProposal("te", null, null, teamContent, new Region(pos, 0), expectedContent, new Region(pos+4, 0), 0);
+	}
+
+	@Test
 	public void testRoleTag1() throws Exception {
 		IPackageFragment teamPkg = CompletionTestSetup.getTestPackage(this.fJProject1, "MyTeam");
 		teamPkg.createCompilationUnit("MyRole.java",