开发者

Search for all instances of foo(Bar.class)

Does eclipse have an easy way to search for all invocations of a method based on the type of the argument(s)? For example if a and b are inst开发者_如何学Goance of Foo and x and y are instances of Bar, I want to find foo(x) and foo(y) but not foo(a) or foo(b).


You could temporarily declare an overloaded "fake" method foo with the specific types of parameters in which you are interested. All relevant invocations of the real foo should be resolved to the fake one. Then do a "Find all References" for the fake foo (before deleting it).

[EDIT]

This will work provided certain constraints regarding subclassing hold. Otherwise, you will get a superset of the invocations in which you are interested, which may still be narrow enough to be useful.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜