Community
Participate
Working Groups
In 1.4 mode, the following test case will fail when searching to reference to A.x: public class A { int x; } public class B extends A { void foo() { this.x++; } } In this case, the declaring class of the field refence binding will be B, and the match locator will not find the reference because it looks for A exactly.
2 solutions to this problem: - the match locator does a lookup as it is done for method references - the original binding is stored on the field ref and the match locator uses this original binding
This should not be necessary, I will keep the old binding as is, and rather introduce a distinct slot to hold onto the codegen binding.
Jerome, can you please double check that the search behaves ok in 1.4 mode (will need to manually toggle the compiler option since no UI for it yet - the option is "Compliance" which you'll need to set to "1.4" by default).
Search behaves ok in 1.4 mode, but in the above test case, the codegen binding has class A as the declaring class. Shouldn't it rather be B? (see JavaSearchTests.testFieldReference5())
Codegen binding is set only during code gen! Closing.