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 167879 Details for
Bug 292087
anonymous class in array member initializer confuses content assist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed fix
patch292087.txt (text/plain), 3.21 KB, created by
Ayushman Jain
on 2010-05-11 04:57:30 EDT
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Ayushman Jain
Created:
2010-05-11 04:57:30 EDT
Size:
3.21 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.214 >diff -u -r1.214 CompletionParser.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 22 Apr 2010 12:56:48 -0000 1.214 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 5 May 2010 05:57:54 -0000 >@@ -4465,6 +4465,14 @@ > } > return false; > } >+protected boolean isInsideArrayInitializer(){ >+ int i = this.elementPtr; >+ if (i > -1 && this.elementKindStack[i] == K_ARRAY_INITIALIZER) { >+ return true; >+ } >+ >+ return false; >+} > public CompilationUnitDeclaration parse(ICompilationUnit sourceUnit, CompilationResult compilationResult, int cursorLoc) { > > this.cursorLocation = cursorLoc; >@@ -4620,6 +4628,17 @@ > if(oldElement != this.currentElement) { > popElement(K_LOCAL_INITIALIZER_DELIMITER); > } >+ } else if(this.currentElement != null && this.currentElement instanceof RecoveredField) { >+ // To make sure the array initializer is popped when the focus is shifted to the parent >+ // in case we're restarting recovery inside an array initializer >+ RecoveredElement oldElement = this.currentElement; >+ super.recoveryExitFromVariable(); >+ if(oldElement != this.currentElement) { >+ if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_ARRAY_INITIALIZER) { >+ popElement(K_ARRAY_INITIALIZER); >+ popElement(K_FIELD_INITIALIZER_DELIMITER); >+ } >+ } > } else { > super.recoveryExitFromVariable(); > } >Index: codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java,v >retrieving revision 1.91 >diff -u -r1.91 AssistParser.java >--- codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java 30 Mar 2010 06:36:00 -0000 1.91 >+++ codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java 5 May 2010 05:58:02 -0000 >@@ -1241,6 +1241,9 @@ > } > return false; > } >+protected boolean isInsideArrayInitializer(){ >+ return false; >+} > protected int lastIndexOfElement(int kind) { > int i = this.elementPtr; > while(i > -1) { >@@ -1638,13 +1641,19 @@ > // only look for headers > if (this.referenceContext instanceof CompilationUnitDeclaration > || this.assistNode != null){ >- if(isInsideMethod() && >+ if((isInsideMethod() || isInsideArrayInitializer()) && > isIndirectlyInsideFieldInitialization() && > this.assistNode == null > ){ > prepareForBlockStatements(); > goForBlockStatementsOrCatchHeader(); >- } else { >+ } /*else if(isInsideArrayInitializer() && >+ isIndirectlyInsideFieldInitialization() && >+ this.assistNode == null >+ ){ >+ prepareForBlockStatements(); >+ goForInitializer(); >+ } */else { > prepareForHeaders(); > goForHeaders(); > this.diet = true; // passed this point, will not consider method bodies
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 292087
:
163070
|
163490
|
167879
|
193572
|
193863
|
201378