Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 51852 Details for
Bug 160655
[assist] Bug with code assist and generics
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug160655_001.txt (text/plain), 3.88 KB, created by
David Audel
on 2006-10-12 09:54:10 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-10-12 09:54:10 EDT
Size:
3.88 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java,v >retrieving revision 1.159 >diff -u -r1.159 CompletionParser.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 10 Oct 2006 10:19:01 -0000 1.159 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 12 Oct 2006 13:58:02 -0000 >@@ -324,8 +324,19 @@ > if(this.genericsPtr > -1) { > ASTNode node = this.genericsStack[this.genericsPtr]; > if(node instanceof Wildcard && ((Wildcard)node).bound == this.assistNode){ >- buildMoreGenericsCompletionContext(node); >- return; >+ int kind = topKnownElementKind(COMPLETION_OR_ASSIST_PARSER); >+ if (kind == K_BINARY_OPERATOR) { >+ int info = topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER); >+ if (info == LESS) { >+ buildMoreGenericsCompletionContext(node, true); >+ return; >+ } >+ } >+ if(this.identifierLengthPtr > -1 && this.identifierLengthStack[this.identifierLengthPtr]!= 0) { >+ this.pushOnElementStack(K_BINARY_OPERATOR, LESS); >+ buildMoreGenericsCompletionContext(node, false); >+ return; >+ } > } > } > >@@ -406,7 +417,7 @@ > } > } > if(node == this.assistNode){ >- buildMoreGenericsCompletionContext(node); >+ buildMoreGenericsCompletionContext(node, true); > } > } > } >@@ -854,7 +865,7 @@ > } > } > } >-private void buildMoreGenericsCompletionContext(ASTNode node) { >+private void buildMoreGenericsCompletionContext(ASTNode node, boolean consumeTypeArguments) { > int kind = topKnownElementKind(COMPLETION_OR_ASSIST_PARSER); > if(kind != 0) { > int info = topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER); >@@ -875,7 +886,7 @@ > } > if(info == LESS && node instanceof TypeReference) { > if(this.identifierLengthPtr > -1 && this.identifierLengthStack[this.identifierLengthPtr]!= 0) { >- this.consumeTypeArguments(); >+ if (consumeTypeArguments) this.consumeTypeArguments(); > TypeReference ref = this.getTypeReference(0); > if(prevKind == K_PARAMETERIZED_CAST) { > ref = computeQualifiedGenericsFromRightSide(ref, 0); >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java,v >retrieving revision 1.25 >diff -u -r1.25 GenericsCompletionParserTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java 20 Apr 2006 11:53:38 -0000 1.25 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java 12 Oct 2006 13:58:06 -0000 >@@ -9393,4 +9393,33 @@ > expectedReplacedSource, > "diet ast"); > } >+public void test0212(){ >+ String str = >+ "public class Test {\n" + >+ " List<? extends Obj>\n" + >+ "}\n"; >+ >+ String completeBehind = "Obj"; >+ int cursorLocation = str.indexOf("Obj") + completeBehind.length() - 1; >+ String expectedCompletionNodeToString = "<CompleteOnType:Obj>"; >+ String expectedParentNodeToString = "<NONE>"; >+ String completionIdentifier = "Obj"; >+ String expectedReplacedSource = "Obj"; >+ String expectedUnitDisplayString = >+ "public class Test {\n" + >+ " List<? extends <CompleteOnType:Obj>>;\n" + >+ " public Test() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ checkDietParse( >+ str.toCharArray(), >+ cursorLocation, >+ expectedCompletionNodeToString, >+ expectedParentNodeToString, >+ expectedUnitDisplayString, >+ completionIdentifier, >+ expectedReplacedSource, >+ "diet ast"); >+} > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 160655
: 51852