Summary: | [assist] Allow proposals for static fields in initializers of fields being declared textually in advance | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Ayushman Jain <amj87.iitr> | ||||
Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | srikanth_sankaran | ||||
Version: | 3.7 | Flags: | srikanth_sankaran:
review+
|
||||
Target Milestone: | 3.7 M5 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Ayushman Jain
2010-12-10 00:45:36 EST
(In reply to comment #0) > With fix for bug 310427, we no longer allow the proposals for fields that have > not yet been declared inside the initializer of a field being currently > declared. But acc. to JLS 8.3.2.2 > > "Initialization expressions for instance variables may use the simple name of > any static variable declared in or inherited by the class, even one whose > declaration occurs textually later. > Thus the example: > class Test { > float f = j; > static int j = 1; > } > compiles without error; it initializes j to 1 when class Test is initialized, > and initializes f to the current value of j every time an instance of class > Test is created " > > So content assist should not hide 'j' in the above case. Note that this is only true when the field being currently initialized is not itself static . Created attachment 185770 [details]
proposed fix extended
Srikanth, can you please do a quick review? Thanks!
Looks good. Released in HEAD for 3.7M5 Verified for 3.7 M5 using build id: I20110124-1800 |