Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2013-01-15 14:56:25 +0000
committerStephan Herrmann2013-01-15 14:56:25 +0000
commit0504562060997061b2d6297d8b6e21a4b9263676 (patch)
treea9f2350657f78c778fd179778ef8cb5b3ae9fcc3
parent54e409247b657534eb689ed2b45e2cb3b6a17ab4 (diff)
downloadorg.eclipse.objectteams-0504562060997061b2d6297d8b6e21a4b9263676.tar.gz
org.eclipse.objectteams-0504562060997061b2d6297d8b6e21a4b9263676.tar.xz
org.eclipse.objectteams-0504562060997061b2d6297d8b6e21a4b9263676.zip
Bug 395762 - [assist] completion in c-t-f parameter mapping hangs
Conflicts: testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java7
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/CodeCompletionTest.java38
2 files changed, 23 insertions, 22 deletions
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
index 5a2bedf71..a10cbdf42 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
@@ -1584,12 +1584,7 @@ public void parseBlockStatements(AbstractMethodMappingDeclaration mapping, Compi
mapping.hasParsedParamMappings = true;
}
- checkNonNLSAfterBodyEnd(mapping.declarationSourceEnd);
-
-// FIXME(SH): should re-enable this?
-// if (this.lastAct == ERROR_ACTION) {
-// return;
-// }
+// SH: no return on ERROR_ACTION, which would spoil completion in (incomplete) parameter mappings.
// mapping has no explicitDeclarations:
// mapping.explicitDeclarations = this.realBlockStack[this.realBlockPtr--];
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 3964ba720..a302a958f 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
@@ -524,6 +524,28 @@ public class CodeCompletionTest extends CoreTests {
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
+ // See Bug 395762: this case could trigger the reported hang
+ public void testCompleteParameterMapping1() throws Exception {
+ createBaseClass(" java.util.List<String> names;\n");
+ assertNosuchTypeBodyProposal(
+ " String setName(int i, String n) -> set java.util.List<String> names\n" +
+ " with { n -> base.| }",
+ "names",
+ INTERESTING_CALLIN_CALLOUT_PROPOSAL);
+ }
+
+ // similar to above, positive case
+ public void testCompleteParameterMapping2() throws Exception {
+ createBaseClass(" java.util.List<String> names;\n");
+ assertTypeBodyProposal(
+ " String getName(int i) -> get java.util.List<String> names\n" +
+ " with { result <- base.| }",
+ "names",
+ " String getName(int i) -> get java.util.List<String> names\n" +
+ " with { result <- base.names|| }",
+ INTERESTING_CALLIN_CALLOUT_PROPOSAL);
+ }
+
// Bug 353468 - [completion] completing a method binding inserts nested class by its binary name
public void testCreateMethodBinding1() throws Exception {
// secondary types:
@@ -621,22 +643,6 @@ public class CodeCompletionTest extends CoreTests {
INTERESTING_CALLIN_CALLOUT_PROPOSAL);
}
- // create callin with non-default selections in linked mode
- // DISABLED because I'm yet to find a way for triggering linked mode selection in a test
- public void _testCreateCallin2() throws Exception {
- createBaseClass(" public String foo() {}\n");
- assertTypeBodyProposal(
- " fo|",
- "foo(",
- "\n" + // TODO(SH): initial newline is not intended?
- " /* (non-Javadoc)\n" +
- " * @see test1.B#foo()\n" +
- " */\n" +
- " |String| foo() <- before void foo();\n" +
- " ",
- INTERESTING_CALLIN_CALLOUT_PROPOSAL);
- }
-
/* short, with callinModifier, follows: callout binding. */
public void testCompleteCallin2() throws Exception {
createBaseClass(" public void foo() {}\n");

Back to the top