Eclipse IDE - Open Call Hierarchy is empty/broken
Asked Answered
L

12

37

What should I do, if the "Open Call Hierarchy" is broken (empty for every method in a project)? It only shows the name of the method I wanted to see the call hierarchy for. This happens for all methods I try, even though they are all called by other methods.

It is very useful for code navigation. I do not know how to work without it!

I've tried:

  1. Opening eclipse.exe -clean -refresh
  2. Restarting Eclipse
  3. Closing and reopening the project
  4. Updating the project
  5. Renaming the .metadata file

I've checked that it searches the whole workspace, and there are no filters on.

Literality answered 21/3, 2013 at 7:59 Comment(1)
I also found that it didn't work from the editor, but it still works from the PHP Explorer. Which is annoying, but workable.Hue
L
34

The following may help:

  • Calling eclipse with eclipse.exe -clean -refresh forces Eclipse to rebuild the index. After that the feature worked again.
  • Closing and re-opening the project.
Literality answered 16/8, 2013 at 7:32 Comment(3)
I hit this issue today, and this resolution did work for me, on Version: Kepler Service Release 1 Build id: 20130919-0819.Hearst
I am using the vrapper plugin to make a vim-like editing experience and discovered that this after installing this plugin that you have to highlight the whole function name in the editor (double click on it) and then it worksNipper
Does not work for me with: Version: Luna Release (4.4.0) Build id: 20140612-0600Ertha
P
16

I also tried the suggestions above, as well as the hint given here: http://mschrag.blogspot.co.at/2009/01/open-type-cant-find-your-class.html

Nothing worked until today when I found out that I am a donkey... I once configured a filter in the "Call Hierarchy" view and so no entries were shown because filtered out. Once I removed / disabled the filter everything worked fine again.

Padauk answered 13/10, 2014 at 7:17 Comment(3)
Thanks. My problem was similar except that for some reason, it changed the Search Scope to one of my other projects. I set it to Workspace and that resolved the problem.Newson
I had similar problem, but even "donkier". I had no project created, but it wasn't obvious to me because I had migrated the code from another computer, and I had a Remote Explorer, was seeing source files, the source tree, I was even able to do some debugging... but none of that means I had a project created! I created project now. BTW, I had to wait a long time for all the DLTK Indexing to take place.Behka
Strange that I saw this answer several times and thought, "No way. Not me." But somehow my filter I had previously set up went bonkers. I had previously set it up to filter out all calls from JUnits, but somehow it's now stripping out actual calls. I guess I'll have to look into what happened there.Tippet
S
7

When you go to the eclipse bug report for this issue, somebody says, you should install over the Market place the Java 12 support.
When I installed it, it was working properly again

Semiliquid answered 23/5, 2019 at 12:23 Comment(1)
for the newer version of Eclipse, everything was running again, without installing the Java 12 supportSemiliquid
D
1

Also, you can try to delete the workspace and get it recreated. Make sure all your projects are backed up.

Disinter answered 17/1, 2014 at 9:17 Comment(0)
W
1

For Kepler and PDT (PHP IDE) it is broken in at least PDT 3.2.0 and 3.3.0 (tried them both). The fix is in 3.3.1 and updating to that was all I had to do get the call hierarchy working again.

(apologies, I'm not yet allowed to add comments, however this should prove handy to many)

Wristlet answered 19/9, 2014 at 13:15 Comment(0)
P
1

In my case it seemed my workspace was contaminated.

Opening/closing projects and starting with clean did not fix. I had to start off a new workspace.

Fedora 20, Eclipse Kepler.

Pearliepearline answered 10/10, 2014 at 14:46 Comment(0)
D
0

I have the same behavior with eclipse Kepler (4.3.2).

I found out, that there is a bug with methods with signature of:

void get(Object o)
Object get(Object o)

In the eclipse Error Log view I find the following exception:

java.lang.NullPointerException
    at org.eclipse.jdt.internal.core.search.matching.ClasspathSourceDirectory.directoryTable(ClasspathSourceDirectory.java:52)
    at org.eclipse.jdt.internal.core.search.matching.ClasspathSourceDirectory.findClass(ClasspathSourceDirectory.java:109)
    at org.eclipse.jdt.internal.core.search.matching.JavaSearchNameEnvironment.findClass(JavaSearchNameEnvironment.java:146)
    at org.eclipse.jdt.internal.core.search.matching.JavaSearchNameEnvironment.findType(JavaSearchNameEnvironment.java:185)
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:145)
    at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:197)
    at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2799)
    at org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:2556)
    at org.eclipse.jdt.internal.core.search.matching.MatchLocator.getType(MatchLocator.java:899)
    at org.eclipse.jdt.internal.core.search.matching.MatchLocator.getMethodBinding0(MatchLocator.java:955)
    at org.eclipse.jdt.internal.core.search.matching.MatchLocator.getMethodBinding(MatchLocator.java:907)
    at org.eclipse.jdt.internal.core.search.matching.MethodLocator.matchMethod(MethodLocator.java:327)
    at org.eclipse.jdt.internal.core.search.matching.MethodLocator.resolveLevel(MethodLocator.java:664)
    at org.eclipse.jdt.internal.core.search.matching.ClassFileMatchLocator.locateMatches(ClassFileMatchLocator.java:209)
    at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1699)
    at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1143)
    at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1184)
    at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1301)
    at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:95)
    at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:231)
    at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:515)
    at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:584)
    at org.eclipse.jdt.internal.corext.callhierarchy.CallerMethodWrapper.findChildren(CallerMethodWrapper.java:155)
    at org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.performSearch(MethodWrapper.java:301)
    at org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.doFindChildren(MethodWrapper.java:232)
    at org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.getCalls(MethodWrapper.java:84)
    at org.eclipse.jdt.internal.ui.callhierarchy.DeferredMethodWrapper.getCalls(DeferredMethodWrapper.java:65)
    at org.eclipse.jdt.internal.ui.callhierarchy.DeferredMethodWrapper.fetchDeferredChildren(DeferredMethodWrapper.java:79)
    at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

In the end, it looks like a bug in this version:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=401272

I assume, that upgrading at least to version 4.4 (Luna) will solve this problem.

Divergency answered 12/1, 2016 at 12:36 Comment(0)
F
0

In my case I was trying to get the call hierarchy of a method in the derived class of an abstract class. The requested method was declared abstract in the base class. When I opened the call hierarchy directly on the abstract method instead of the implemented one, everything worked well. (Eclipse Neon).

Fyrd answered 30/8, 2016 at 11:58 Comment(0)
P
0

My problem was that Open Call Hierarchy was searching only the project not the entire Workspace. So I had to click on the small down arrow (in the Call Hierarchy view window on the right; it is the "View Menu" arrow -- a triangle pointing down) in Call Hierarchy view, set the Search Scope > Workspace.

Postimpressionism answered 4/1, 2017 at 16:0 Comment(0)
F
0

Tried everything in all the answers here, but none of them worked for me. Later I figured out that this was a bug in Eclipse 2019-03 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=545293). Try to upgrade your eclipse or install a newer version. For me installing a newer version(latest version Eclipse 2019-09) solved the problem.

Felicidadfelicie answered 17/10, 2019 at 9:35 Comment(0)
Q
0

I tried many answers all were great, it helped many except few and I was in few.

My eclipse version is 2019-03(4.11.0). This is which has a bug. Which can be fixed by add-ons.

Go to the Eclipse Marketplace and search for plugin java 12 Support for Eclipse 2019-03(4.11)… and install it. On completion of installation restart the eclipse. Hopefully this will fix the problem. Have a nice day.

Quirinus answered 10/1, 2020 at 15:57 Comment(0)
S
-1

If the call Hierarchy is not opening, it might be because of the project is not imported as a java project, rather it would be displayed in the file stucture. You may want to enable the project facet through:

right click on the project -> project facet.  

If you dont see anything listed, you need

configure the project facet -> Apply -> ok. 
Syndactyl answered 27/3, 2019 at 9:6 Comment(1)
I have project facet itself still showing error .. I am have imported it as genral project .. does it can cause issue?Wheedle

© 2022 - 2024 — McMap. All rights reserved.