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 115571 Details for
Bug 246276
NPE during code completion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug246276_002.txt (text/plain), 3.12 KB, created by
David Audel
on 2008-10-20 11:05:38 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2008-10-20 11:05:38 EDT
Size:
3.12 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.199 >diff -u -r1.199 CompletionParser.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 10 Oct 2008 07:28:57 -0000 1.199 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 20 Oct 2008 15:05:06 -0000 >@@ -3370,9 +3370,22 @@ > if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) != K_ARRAY_CREATION) { > pushOnElementStack(K_BETWEEN_LEFT_AND_RIGHT_BRACKET); > } else { >- if(previous == TokenNameIdentifier) { >- this.invocationType = NO_RECEIVER; >- this.qualifier = -1; >+ switch (previous) { >+ case TokenNameIdentifier: >+ case TokenNameboolean: >+ case TokenNamebyte: >+ case TokenNamechar: >+ case TokenNamedouble: >+ case TokenNamefloat: >+ case TokenNameint: >+ case TokenNamelong: >+ case TokenNameshort: >+ case TokenNameGREATER: >+ case TokenNameRIGHT_SHIFT: >+ case TokenNameUNSIGNED_RIGHT_SHIFT: >+ this.invocationType = NO_RECEIVER; >+ this.qualifier = -1; >+ break; > } > } > break; >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java,v >retrieving revision 1.189 >diff -u -r1.189 CompletionTests.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 10 Oct 2008 07:29:03 -0000 1.189 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 20 Oct 2008 15:05:10 -0000 >@@ -115,6 +115,32 @@ > } > } > >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=246276 >+public void testArrayInitializer1() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/ArrayInitializer.java", >+ "public class ArrayInitializer {\n"+ >+ " int bar() {return 0;}\n"+ >+ " void foo(int[] i) {\n"+ >+ " i = new int[] {\n"+ >+ " bar()\n"+ >+ " };\n"+ >+ " }\n"+ >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); >+ >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "bar("; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "bar[METHOD_REF]{, LArrayInitializer;, ()I, bar, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} >+ > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=164311 > public void testBug164311() throws JavaModelException { > this.workingCopies = new ICompilationUnit[1];
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 246276
:
111750
| 115571