Community
Participate
Working Groups
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.
(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