Bug 47162 - [call hierarchy] Suggestion for extension of call hierarchy
Summary: [call hierarchy] Suggestion for extension of call hierarchy
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-20 15:33 EST by Jens Odborg CLA
Modified: 2010-09-21 09:00 EDT (History)
4 users (show)

See Also:


Attachments
MockUp (quick and dirty screenshot C&P) (17.44 KB, image/gif)
2004-02-20 13:22 EST, Markus Keller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Odborg CLA 2003-11-20 15:33:11 EST
I would suggest that the call hierarchy to be extended in the following way:

Calls from method:
When a function “f()” from class “C” is listed as called (on form “f() - C”), 
then functions from derivered classes of “C” that overrides the method “f()” 
are listed as siblings of “f()” (e.g. on form “method that overrides C2.f()” 
with image “implements method from interface” or “overrides method from super 
class”)

Calls to method:
When a function “g()” from class “C2” have its callers listed then if it 
override a function in a supper class an additional pseudo caller are listed  
(e.g. on form “calls to super C.g()”)
(There can be only one such super tree-child for a method since e.g. “calls to 
super IC.g()” would be a tree-child of “calls to super C.g()" and NOT an 
additional tree-child of “g() - C2”)

I have suggested a different text form to make a better distinction between 
overrides and true calls 

Some people would properly want this off so a check option in filter and/or a 
toggle button in view header bar are needed.
Comment 1 Dirk Baeumer CLA 2003-11-21 05:05:00 EST
I like the idea of honoring dynamic binding in the call hiararchy, but adding 
reimplemented methods as children to the tree will make the tree clumsy. From 
a user perspective I most of the time follow one call path. So I would like to 
have the choice to exchange one node in the hierarchy with a super or sub 
implementation. 

Jesper, what do you think about this?
Comment 2 Jens Odborg CLA 2003-11-25 17:44:40 EST
I under stand you consern making the tree clumpsy

When I wrote this proposal I actually considered:
Calls from method:
Having "f()"s overridden implementaitions located in a child of "f()" lable 
e.g. "overridden implementations"
Calls to method:
but then using a similar approach for "g()" saw a little pointless since "g()" 
typical only have one super implementaion (except when an implementation 
honnors several interfaces)
at that point I saw the extra tree levels as a bigger issue

I am not sure what exacly you mean with:
> So I would like to have the choice to exchange one node 
> in the hierarchy with a super or sub implementation.
but if mean replacing the node so the old node is deleted and a new is created 
then I not sure I like it, I see the folowing problem:
some times there are several sub implementations and I would like to wisit them 
one at the time until I find the one I search, and the visibility of the other 
nodes tell me somthing about where I have already been

I guess for to see what works best some mockups are needed. 

I just got an idea what do you think about adding check boxes to all nodes 
signalling whether or not to show sub/super implementation as sibling?
(sub in calls from methods and super in calls to method) 
There must of course be a hint text for the checkbox describing its purpose

Comment 3 Markus Keller CLA 2004-02-20 13:18:31 EST
I would not exchange the node, but let the user replace it with a special "Show
overriding methods" node. That special node could then show all overriding
methods as children.
Comment 4 Markus Keller CLA 2004-02-20 13:22:25 EST
Created attachment 8074 [details]
MockUp (quick and dirty screenshot C&P)

This picture shows the "special node" for the method
   run(TestResult): void - junit.framework.Test
and its overriding methods (including the original method itself) as children.
Comment 5 Pavol Zibrita CLA 2010-09-17 09:04:50 EDT
I use the call hierarchy a lot. The option to see overrides is a must in some cases, it's much harder to do some refactorings without it.

I would give you 10$ when it is implemented. Maybe u can use http://www.bidforfix.com/