Bug 7987 - Field reference search should do lookup in 1.4 mode
Summary: Field reference search should do lookup in 1.4 mode
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-22 06:10 EST by Jerome Lanneluc CLA
Modified: 2002-02-04 06:39 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2002-01-22 06:10:58 EST
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.
Comment 1 Jerome Lanneluc CLA 2002-01-22 06:12:13 EST
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
Comment 2 Philipe Mulet CLA 2002-01-23 07:05:34 EST
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.
Comment 3 Philipe Mulet CLA 2002-02-02 06:54:39 EST
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).

Comment 4 Jerome Lanneluc CLA 2002-02-03 10:34:11 EST
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())
Comment 5 Jerome Lanneluc CLA 2002-02-04 06:39:02 EST
Codegen binding is set only during code gen!
Closing.