Bug 331271 - [assist] Reconsider assumption to filter not yet declared fields from being proposed
Summary: [assist] Reconsider assumption to filter not yet declared fields from being p...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M4   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-27 07:07 EST by Ayushman Jain CLA
Modified: 2010-12-07 03:43 EST (History)
2 users (show)

See Also:
jarthana: review+


Attachments
proposed fix (4.78 KB, patch)
2010-11-27 08:44 EST, Ayushman Jain CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ayushman Jain CLA 2010-11-27 07:07:00 EST
In Bug 312603#c2, we had observed that whenever content assist is invoked inside the initialization of a field, the 'initialization'
of the FieldDeclaration corresponding to the field was not null. In other cases, it is set to null be CompletionParser#consumeExitVariableWithInitialization().

But as bug 330842 showed, this assumption is not correct in all cases. So the fixes for bug 312603, bug 236306, bug 328674 need to reworked to do complete checking of the ASTNode lying inside the initialization and not use this assumption.
Comment 1 Ayushman Jain CLA 2010-11-27 08:44:40 EST
Created attachment 183977 [details]
proposed fix

This patch takes care of removing the doubtful assumption for bug 312603. I'm leaving alone bug 236306, bug 328674 for now since they're for local variables and not fields, and unlike for fields, local variables will not be collected from other source files to be proposed in the currently desired place.
Comment 2 Ayushman Jain CLA 2010-11-28 07:05:30 EST
Jay, appreciate a quick review. TIA!
Comment 3 Jay Arthanareeswaran CLA 2010-11-29 05:40:10 EST
+1 for the patch.
Comment 4 Ayushman Jain CLA 2010-11-29 09:18:15 EST
Released in HEAD for 3.7M4.

Verification to be done through code inspection.
Comment 5 Srikanth Sankaran CLA 2010-12-07 03:43:07 EST
Verified for 3.7M4 using build id I20101205-2000