diff options
author | Srikanth | 2012-01-12 12:12:14 +0000 |
---|---|---|
committer | Srikanth | 2012-01-12 12:12:14 +0000 |
commit | b51c36b1246bd1345c3afae01728763dcd171e5a (patch) | |
tree | 5cd6d413e597781da5286caf0ac9f33639a0ca3e | |
parent | b0bd844e638d627fddf9ed3dbc5637db4513a8de (diff) | |
download | eclipse.jdt.core-b51c36b1246bd1345c3afae01728763dcd171e5a.tar.gz eclipse.jdt.core-b51c36b1246bd1345c3afae01728763dcd171e5a.tar.xz eclipse.jdt.core-b51c36b1246bd1345c3afae01728763dcd171e5a.zip |
Fixed bug 361963: Stack overflow when trying to code complete a genericv20120112-1212
list
3 files changed, 27 insertions, 4 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java index 4cc93905c1..652161417e 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14286,4 +14286,24 @@ public void testBug351426l() throws JavaModelException { "X1<T>[TYPE_REF]{, test, Ltest.X1<TT;>;, null, null, replace[77, 77], token[77, 77], " + relevance + "}", requestor.getResults()); } +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=361963 +public void test361963() throws JavaModelException { + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy( + "/Completion/src/X.java", + "public class X<T> {\n" + + " void g() {\n" + + " return new X() {\n" + + " void g() {\n" + + " Object o = new X<\n"); + CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, true, true); + requestor.allowAllRequiredProposals(); + String str = this.workingCopies[0].getSource(); + String completeBehind = "new X<"; + int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); + this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); + assertResults( + "X<T>[TYPE_REF]{, , LX<TT;>;, null, null, replace[116, 116], token[116, 116], 51}", + requestor.getResults()); +} } diff --git a/org.eclipse.jdt.core/buildnotes_jdt-core.html b/org.eclipse.jdt.core/buildnotes_jdt-core.html index c427ac7943..71a98c7eab 100644 --- a/org.eclipse.jdt.core/buildnotes_jdt-core.html +++ b/org.eclipse.jdt.core/buildnotes_jdt-core.html @@ -52,7 +52,9 @@ Eclipse SDK 3.8.0 - %date% - 3.8.0 M5 <h2>What's new in this drop</h2> <h3>Problem Reports Fixed</h3> -<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=365437">365437</a> +<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=361963">361963</a> +Stack overflow when trying to code complete a generic list +<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=365437">365437</a> Private methods tagged with @Inject should not be flagged with unused warning <br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=366131">366131</a> [1.5][compiler] New generics compile error in Indigo SR1 for code that compiles in earlier Eclipse and javac diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java index 927db1b7be..fc8930772f 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -1167,7 +1167,8 @@ private void buildMoreGenericsCompletionContext(ASTNode node, boolean consumeTyp if (prevKind == K_BETWEEN_NEW_AND_LEFT_BRACKET) { AllocationExpression exp; - if (this.expressionPtr > -1 && this.expressionStack[this.expressionPtr] instanceof AllocationExpression) { + if (this.expressionPtr > -1 && this.expressionStack[this.expressionPtr] instanceof AllocationExpression + && this.invocationType == QUALIFIED_ALLOCATION) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=361963 exp = new QualifiedAllocationExpression(); exp.type = ref; ((QualifiedAllocationExpression)exp).enclosingInstance = this.expressionStack[this.expressionPtr]; |