Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Audel2008-01-07 09:56:51 +0000
committerDavid Audel2008-01-07 09:56:51 +0000
commit7aa41fe639eb46a740b35e612973cada9ba8267f (patch)
treedae513e3097fefc3ccd6b3149a7d441cd5a0a55e
parenta626dbe34a0108abdf11028aa7b5540f10df6847 (diff)
downloadeclipse.jdt.core-7aa41fe639eb46a740b35e612973cada9ba8267f.tar.gz
eclipse.jdt.core-7aa41fe639eb46a740b35e612973cada9ba8267f.tar.xz
eclipse.jdt.core-7aa41fe639eb46a740b35e612973cada9ba8267f.zip
HEAD - bug 210681
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java55
-rw-r--r--org.eclipse.jdt.core/buildnotes_jdt-core.html4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java4
3 files changed, 59 insertions, 4 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 2728d18313..0272e7a7f7 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
@@ -5762,6 +5762,61 @@ public void testCompletionInsideExtends12() throws JavaModelException {
requestor.getResults());
}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=212713
+public void testCompletionInsideExtends13() throws JavaModelException {
+ this.workingCopies = new ICompilationUnit[1];
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/Test.java",
+ "package test;\n"+
+ "public class Test {\n"+
+ " static class GrrrBug {}\n"+
+ " class Foo extends Grrr\n"+
+ "}\n");
+
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "Grrr";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+
+ assertResults(
+ "Test.GrrrBug[TYPE_REF]{GrrrBug, test, Ltest.Test$GrrrBug;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
+ requestor.getResults());
+}
+
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=212713
+public void testCompletionInsideExtends14() throws JavaModelException {
+ this.workingCopies = new ICompilationUnit[1];
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src/test/GrrrBug1.java",
+ "package test;\n"+
+ "public class GrrrBug1 {\n"+
+ " public static class GrrrBug2 {\n"+
+ " public static class GrrrBug3 {}\n"+
+ " }\n"+
+ " public static class GrrrBug4 extends Grrr {\n"+
+ " public static class GrrrBug5 {}\n"+
+ " }\n"+
+ "}\n"+
+ "class GrrrBug6 {\n"+
+ " public static class GrrrBug7 {}\n"+
+ "}\n");
+
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "extends Grrr";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+
+ assertResults(
+ "GrrrBug1.GrrrBug2.GrrrBug3[TYPE_REF]{test.GrrrBug1.GrrrBug2.GrrrBug3, test, Ltest.GrrrBug1$GrrrBug2$GrrrBug3;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_NON_RESTRICTED) + "}\n" +
+ "GrrrBug6.GrrrBug7[TYPE_REF]{test.GrrrBug6.GrrrBug7, test, Ltest.GrrrBug6$GrrrBug7;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_NON_RESTRICTED) + "}\n" +
+ "GrrrBug1[TYPE_REF]{GrrrBug1, test, Ltest.GrrrBug1;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
+ "GrrrBug1.GrrrBug2[TYPE_REF]{GrrrBug2, test, Ltest.GrrrBug1$GrrrBug2;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
+ "GrrrBug6[TYPE_REF]{GrrrBug6, test, Ltest.GrrrBug6;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
+ requestor.getResults());
+}
+
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
public void testCompletionInsideExtends2() throws JavaModelException {
this.wc = getWorkingCopy(
diff --git a/org.eclipse.jdt.core/buildnotes_jdt-core.html b/org.eclipse.jdt.core/buildnotes_jdt-core.html
index 228d16b980..b3df56562d 100644
--- a/org.eclipse.jdt.core/buildnotes_jdt-core.html
+++ b/org.eclipse.jdt.core/buildnotes_jdt-core.html
@@ -49,7 +49,9 @@ Eclipse SDK 3.4M5 - %date% - 3.4 MILESTONE 5
<h2>What's new in this drop</h2>
<h3>Problem Reports Fixed</h3>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=211881">211881</a>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=210681">210681</a>
+Code assist fails to propose inner type
+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=211881">211881</a>
[assist] Code assist fails inside an if statement
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=212153">212153</a>
stack overflow when press ctrl+space
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 9bc929527d..9ff5ce4aeb 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
@@ -5201,8 +5201,6 @@ public final class CompletionEngine
if (typeName == null)
return;
- if (this.assistNodeIsSuperType && !this.insideQualifiedReference) return; // we're trying to find a supertype
-
if (this.insideQualifiedReference
|| typeName.length == 0) { // do not search up the hierarchy
@@ -5369,7 +5367,7 @@ public final class CompletionEngine
if (typeName == null || typeName.length == 0)
return;
- if (this.assistNodeIsSuperType && !this.insideQualifiedReference) return; // we're trying to find a supertype
+ if (this.assistNodeIsSuperType && !this.insideQualifiedReference && this.isForbidden(currentType)) return; // we're trying to find a supertype
findMemberTypes(
typeName,

Back to the top