Bug 331271

Summary: [assist] Reconsider assumption to filter not yet declared fields from being proposed
Product: [Eclipse Project] JDT Reporter: Ayushman Jain <amj87.iitr>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, srikanth_sankaran
Version: 3.7Flags: jarthana: review+
Target Milestone: 3.7 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed fix none

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