Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2023-03-30 18:14:00 +0000
committerStephan Herrmann2023-03-30 18:14:00 +0000
commita4bf2a34eb5d9333c3c8a7e2b06e54205ec5e426 (patch)
tree0cd51e09d36f25480c420e2e815b4867dc5d2ae1 /org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt
parente62383ae874c28c94a09ac99a6668392af54dd57 (diff)
downloadorg.eclipse.objectteams-a4bf2a34eb5d9333c3c8a7e2b06e54205ec5e426.tar.gz
org.eclipse.objectteams-a4bf2a34eb5d9333c3c8a7e2b06e54205ec5e426.tar.xz
org.eclipse.objectteams-a4bf2a34eb5d9333c3c8a7e2b06e54205ec5e426.zip
update jdt.core to I20230327-1800
Diffstat (limited to 'org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt')
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java66
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java3
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests16.java80
3 files changed, 133 insertions, 16 deletions
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 d61ce7ba4..e03fe5569 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
@@ -15919,9 +15919,10 @@ public void testConstructor1() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
assertResults(
- "TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
- " TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
+ "TestConstructor1[TYPE_REF<ARRAY>]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "
+ + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED
+ + R_EXACT_EXPECTED_TYPE)
+ + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262932
@@ -15951,9 +15952,10 @@ public void testConstructor2() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
assertResults(
- "TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
- " TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
+ "TestConstructor1[TYPE_REF<ARRAY>]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "
+ + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED
+ + R_EXACT_EXPECTED_TYPE)
+ + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262932
@@ -15983,9 +15985,10 @@ public void testConstructor3() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
assertResults(
- "TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
- " TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
+ "TestConstructor1[TYPE_REF<ARRAY>]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "
+ + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED
+ + R_EXACT_EXPECTED_TYPE)
+ + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262932
@@ -16016,9 +16019,10 @@ public void testConstructor4() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
assertResults(
- "TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
- " TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
+ "TestConstructor1[TYPE_REF<ARRAY>]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "
+ + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED
+ + R_EXACT_EXPECTED_TYPE)
+ + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262932
@@ -16048,8 +16052,10 @@ public void testConstructor5() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
assertResults(
- "TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
- " TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
+ "TestConstructor1[TYPE_REF<ARRAY>]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "
+ + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED
+ + R_EXACT_EXPECTED_TYPE)
+ + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=262932
@@ -16079,8 +16085,10 @@ public void testConstructor6() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner, monitor);
assertResults(
- "TestConstructor1[CONSTRUCTOR_INVOCATION]{(), Ltest.TestConstructor1;, (I)V, TestConstructor1, (i), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}\n" +
- " TestConstructor1[TYPE_REF]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_CONSTRUCTOR)+"}",
+ "TestConstructor1[TYPE_REF<ARRAY>]{TestConstructor1, test, Ltest.TestConstructor1;, null, null, "
+ + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED
+ + R_EXACT_EXPECTED_TYPE)
+ + "}",
requestor.getResults());
}
public void testConstructor7() throws JavaModelException {
@@ -26470,4 +26478,30 @@ public void testCompletionConstructorsForSubTypes() throws JavaModelException, I
" CompletionConstructorsForSubTypes1[TYPE_REF]{CompletionConstructorsForSubTypes1, , LCompletionConstructorsForSubTypes1;, null, null, 82}",
requestor.getResults());
}
+public void testGH504PrimitiveArrayTypeRecieverExpectArrayCompletion() throws JavaModelException {
+ this.workingCopies = new ICompilationUnit[1];
+ this.workingCopies[0] = getWorkingCopy(
+ "Completion/src/ArrayTest.java",
+ "public class ArrayTest {\n" +
+ " public void test() {\n" +
+ " int[] numbers = new \n" +
+ " }\n" +
+ "}\n");
+
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ requestor.allowAllRequiredProposals();
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "new ";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ assertResults(
+ "ArrayTest[TYPE_REF]{ArrayTest, , LArrayTest;, null, null, "
+ + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)
+ + "}\n" +
+ "int[TYPE_REF<ARRAY>]{int, null, I, null, null, "
+ + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED
+ + R_EXACT_EXPECTED_TYPE)
+ + "}",
+ requestor.getResults());
+}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
index a97f7e8fb..56591e6ec 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
@@ -399,6 +399,9 @@ public class CompletionTestsRequestor2 extends CompletionRequestor {
break;
case CompletionProposal.TYPE_REF :
buffer.append("TYPE_REF"); //$NON-NLS-1$
+ if (proposal.getArrayDimensions() > 0) {
+ buffer.append("<ARRAY>"); //$NON-NLS-1$
+ }
break;
case CompletionProposal.VARIABLE_DECLARATION :
buffer.append("VARIABLE_DECLARATION"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests16.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests16.java
index 99b9ede71..22b9b2c74 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests16.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests16.java
@@ -299,4 +299,84 @@ public void testissue342_001() throws Exception {
deleteProject(p);
}
}
+public void testGH612_001() throws Exception {
+ if (!isJRE16)
+ return;
+ IJavaProject p = createJava16Project("p");
+ createFolder("/p/src/a");
+ try {
+ String source =
+ "package a;\n"
+ + "public class X {\n"
+ + " public static void main(String[] args) {\n"
+ + " Sub sub = new Sub();\n"
+ + " sub.method1();\n"
+ + " }\n"
+ + "\n"
+ + " static class Outer<T> { \n"
+ + " class Inner {\n"
+ + " void sayHi() {\n"
+ + " System.out.println(\"hello world!\");\n"
+ + " }\n"
+ + " }\n"
+ + " }\n"
+ + "\n"
+ + " static class Sub extends Outer<Sub.Inner> {\n"
+ + " void method1() {\n"
+ + " Inner inner = new Inner();\n"
+ + " inner.sayHi();\n"
+ + " }\n"
+ + " }\n"
+ + "}\n";
+ createFile("p/src/a/X.java",
+ source);
+ p.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = p.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("markers in p",
+ "",
+ markers);
+ } finally {
+ deleteProject(p);
+ }
+}
+public void testGH612_002() throws Exception {
+ if (!isJRE16)
+ return;
+ IJavaProject p = createJava16Project("p");
+ createFolder("/p/src/a");
+ try {
+ String source =
+ "package a;\n"
+ + "public class X {\n"
+ + " public static void main(String[] args) {\n"
+ + " Sub sub = new Sub();\n"
+ + " sub.method1();\n"
+ + " }\n"
+ + "\n"
+ + " static interface Outer<T> { \n"
+ + " class Inner {\n"
+ + " void sayHi() {\n"
+ + " System.out.println(\"hello world!\");\n"
+ + " }\n"
+ + " }\n"
+ + " }\n"
+ + "\n"
+ + " static class Sub implements Outer<Sub.Inner> {\n"
+ + " void method1() {\n"
+ + " Inner inner = new Inner();\n"
+ + " inner.sayHi();\n"
+ + " }\n"
+ + " }\n"
+ + "}\n";
+ createFile("p/src/a/X.java",
+ source);
+ p.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = p.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("markers in p",
+ "",
+ markers);
+ } finally {
+ deleteProject(p);
+ }
+}
}

Back to the top