| Summary: | Call Hierarchy for a method is missing valid callers | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | ai12796 |
| Component: | Core | Assignee: | Satyam Kandula <satyam.kandula> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | amj87.iitr, eclipse, picard, satyam.kandula, schierlm |
| Version: | 3.7.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
The method foo being called from M.m() is actually I.foo not B.foo. Call hierarchy on I.foo does show M.m(). Am i missing something? (In reply to comment #1) > The method foo being called from M.m() is actually I.foo not B.foo. Call > hierarchy on I.foo does show M.m(). Am i missing something? but B is providing the implementation for I.foo and hence it should be reported. (In reply to comment #2) > (In reply to comment #1) > > The method foo being called from M.m() is actually I.foo not B.foo. Call > > hierarchy on I.foo does show M.m(). Am i missing something? > but B is providing the implementation for I.foo and hence it should be > reported. Hm, but even search for references for B.foo doesn't show up anything. So, is this is a Java search issue? (In reply to comment #3) > Hm, but even search for references for B.foo doesn't show up anything. So, is > this is a Java search issue? Yes, this is a Java search issue. It also affects Ctrl+Click->"Open implementation" on method call foo(), which finds nothing.
As a workaround, it helped in my case to refactor the classes to look like this:
public abstract class B implements I {public void foo(){}}
public class D extends B {}
Or add a foo method to class D that just calls super.foo().
Although I don't think refactoring code just to make sure Eclipse search "works" is a good workaround.
I will not be able to contain this for M7. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. For the record, bug is still happening in 2020-03 and still relevant. For some reason the fields for editing the version and status are readonly for me, though. |
Build Identifier: M20090211-1700 This bug is still present in Build id: M20110909-1335 public interface I {public void foo();} public class B {public void foo(){}} public class D extends B implements I {} public class M { public void m(){ ((I)new D()).foo(); } } Call Hierarchy of B.foo() does not show M.m()!!! Refactoring does work properly though. Reproducible: Always Steps to Reproduce: 1. Create a Java project 2. Create classes and interfaces as in details 3. Select B.foo() and click "Call Hierarchy"