This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 231024 - Java call hierarchy of callers doesn't go through interface call, hierarchy of callees doesn't work either
Summary: Java call hierarchy of callers doesn't go through interface call, hierarchy o...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-10 11:12 UTC by kalwi
Modified: 2013-06-22 02:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kalwi 2013-06-10 11:12:59 UTC
Caller.someMethod() --call>> Iface.method() --impl>> Impl.method()

When a method implements a method from an interface, java call hierarchy of callers performed on that implemented method (i.e. Impl.method()) won't search any caller that calls the interface method (i.e. Caller.someMethod() is not found). This worked in 7.3 so it seems to be a regression.

When I perform call hierarchy directly on interface method (i.e. Iface.method()), it works.

Call hierarchy of callees (performed on Caller.someMethod()) doesn't work at all, message "Select some method to explore." is displayed.

Clean installation of:
Product Version: NetBeans IDE Dev (Build 201306100004)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\<...>\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\<...>\AppData\Local\NetBeans\Cache\dev

I use JDK 1.6 Maven projects with JDK 1.6 configured globally in .m2/settings.xml in default profile (if it would somehow help):
<netbeans.hint.jdkPlatform>JDK_1.6</netbeans.hint.jdkPlatform>
Comment 1 Jiri Prox 2013-06-10 11:41:50 UTC
This is designed change. There is now new option to run call hierarchy from the base class or from current place. 

For behavior, you're expecting you have to enable 'Search from base class'.
To do so, click on the 'scope' button ()and select and select related item in menu.
Comment 2 kalwi 2013-06-10 13:32:11 UTC
Well, 'Search from base class' works for my first use case when it goes through one interface.

But, this case still doesn't work either with search from base class (two interfaces in hierarchy of callers):

A.method1() --call>> IfaceB.method2() --impl>> BImpl.method2() --call>> IfaceC.method3() --impl>> CImpl.method3()

When I perform call hierarchy of callers on CImpl.method3(), only BImpl.method2() is found as a caller, but A.method1() is not found.

(When I perform it on BImpl.method2(), A.method1() is found.)

For completeness, I have A.method1() placed in another opened project and 'Open projects' radio button is selected.

---

There is also the second problem with hierarchy of _callees_ which doesn't work at all (as I wrote).

And even more, when I switch the other of caller/callee button and then press refresh button, it seems like it was refreshed for the original caller/callee and new perspective was not selected (it doesn't work either for switching from caller to caller, or from callee to caller).

But when I switch the other of caller/callee button, then close call hierarchy window and then perform a new search, then the last selected caller/callee perspective is correctly used (with note that callee doesn't find anything).
Comment 3 Ralph Ruijs 2013-06-18 08:55:51 UTC
changeset:   7b33f8acf759
user:        Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date:        Tue Jun 18 10:09:29 2013 +0200
summary:     #231024 - Java call hierarchy of callers doesn't go through interfa
ce call, hierarchy of callees doesn't work either
Comment 4 Quality Engineering 2013-06-22 02:09:08 UTC
Integrated into 'main-golden', will be available in build *201306212301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7b33f8acf759
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #231024 - Java call hierarchy of callers doesn't go through interface call, hierarchy of callees doesn't work either