[英]How to find out in Eclipse if certain method is called from another method directly or indirectly?
How to find out in Eclipse if certain method is potentially invoked or reachable (directly or indirectly) from another method? 如果可以从另一个方法中直接或间接地调用或访问某些方法,如何在Eclipse中查找?
Assume I want to refactor A.one()
which can be negatively influenced by a side-effect in D.four()
. 假设我想重构A.one()
,这可能会受到D.four()
中D.four()
负面影响。 Therefore I'd like to find out if D.four()
can potentially be invoked from A.one()
. 因此,我想知道是否可以从A.one()
调用D.four()
A.one()
。 I can see which methods are called from A.one()
using the Call Hierarchy. 我可以看到使用Call Hierarchy从A.one()
调用哪些方法。 I can navigate the call tree and eventually find that A.one()
calls B.two()
which calls C.three()
which calls D.four()
. 我可以导航调用树并最终发现A.one()
调用B.two()
调用C.three()
调用D.four()
。
Is there a way in Eclipse to make this search somehow automatic? 在Eclipse中是否有办法以某种方式自动进行此搜索?
ps. PS。 There's a "Filters..." option in Call Hierarchy Dialog, but it only hides matching names. “调用层次结构对话框”中有一个“过滤器...”选项,但它只隐藏匹配的名称。
This is a modified version of the way you (@lexicore) found, that involves significantly less button punching (my changes in bold ): 这是你(@lexicore)找到的方式的修改版本,它显着减少了按钮打孔(我的粗体更改):
Notes 笔记
Update 更新
Here is some documentation , where the * key is mentioned. 这是一些文档 ,其中提到了*键。
We've just encountered a way. 我们刚刚遇到了一个方法。 Not really "automatic", involves a lot of ->
-button punching. 不是真的“自动”,涉及很多->
按钮冲孔。 :) :)
A.one()
, Show Callee Hierarchy. 打开A.one()
,显示Callee层次结构的调用层次结构。 ->
button many many times. 从根开始,通过多次单击->
按钮展开整个树。 Really many times. 真的很多次。 :) :) D.four()
. 全文搜索D.four()
。 I hope there are better ways not involving punching the ->
-button. 我希望有更好的方法不涉及打击->
按钮。
我所知道的最简单的方法是手动导航到D.four()
,在该方法上使用Call Hierarchy
,看看A.one()
是否包含在层次结构中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.