如何从其他方法直接或间接调用某些方法在Eclipse中找到? [英] How to find out in Eclipse if certain method is called from another method directly or indirectly?

查看:170
本文介绍了如何从其他方法直接或间接调用某些方法在Eclipse中找到?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果某种方法有可能从另一种方法潜在地被调用或可达(直接或间接),那么在Eclipse中如何找到?

How to find out in Eclipse if certain method is potentially invoked or reachable (directly or indirectly) from another method?

假设我想重构 A.one()可能会在 D.four()中受到副作用的负面影响。因此,我想知道如果 D.four()可以从 A.one() 。我可以使用呼叫层次结构从 A.one()中查看哪些方法。我可以浏览调用树,最终找到 A.one()调用 B.two() code> C.three()调用 D.four()

Assume I want to refactor A.one() which can be negatively influenced by a side-effect in D.four(). Therefore I'd like to find out if D.four() can potentially be invoked from A.one(). I can see which methods are called from A.one() using the Call Hierarchy. I can navigate the call tree and eventually find that A.one() calls B.two() which calls C.three() which calls D.four().

在Eclipse中有没有办法使自动搜索?

Is there a way in Eclipse to make this search somehow automatic?

ps。在呼叫层次对话中有一个过滤器...选项,但它只会隐藏匹配的名称。

ps. There's a "Filters..." option in Call Hierarchy Dialog, but it only hides matching names.

推荐答案

版本的(@lexicore)发现,这显着减少了按钮打孔(我的更改 bold ):

This is a modified version of the way you (@lexicore) found, that involves significantly less button punching (my changes in bold):


  • 打开A.one()的呼叫层次结构,显示Callee层次结构。

  • 选择根节点,然后按*键直到整个树展开。请注意,您只需要在根节点上按*。

  • 右键单击,复制扩展层次结构。

  • 粘贴到文本中文件。

  • 全文搜索D.four()。

  • Open Call Hierarchy for A.one(), Show Callee Hierarchy.
  • Select the root node, and press the * key until the whole tree is expanded. Note that you only need to press * on the root node. This will expand the whole tree in "no time".
  • Right mouse click, Copy Expanded Hierarchy.
  • Paste into a text file.
  • Full-text search for D.four().


  • 键*将所有未展开的叶节点扩展一层。

  • 键+和 - 适用于扩展和关闭所选节点。

  • 我在瑞典语键盘上尝试过这样的设置,其中*位于与美国键盘不同的位置,但是希望Eclipse不会在乎。

更新

这里是一些文档,其中*键被提及

这篇关于如何从其他方法直接或间接调用某些方法在Eclipse中找到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆